Magento Add-to-Cart Integration


#1

Is it possible to integrate a Magento “add-to-cart” button into an Unbouce page?

We have the code in a few formats on an Unbounce page, but both send the click to a Magento cart with no product.

I asked a developer, and their initial feedback said that Magento is session based and may not be possible. Hoping someone here has had more luck.


#2

Hi @camarketer,

Short answer - Yes, it’s possible.

Long answer:

Before Magento 1.8, the task was really easy. You just append the product ID and quantity to the end of the add to cart URL and you are done. Each time someone clicks a link/button with that URL the product gets added to their cart.

However, after 1.8, Magento started requiring that the above URL must also have the form key.
The problem is that you need to generate it on the backend and append it to your link.

Therefore, you have a couple of options:

  • Get your developer to write you a pretty straightforward and simple script that would serve as an intermediate step. Clicks on your Unbounce landing pages would be directed to this script, which in turn would generate the desired URL and redirect again to the cart.

  • Look for an already made extension in the Marketplace. Depending on what version you are using there are a few.

Best,
Hristian


#3

I’m not terribly familiar with Magento2, but I do have a client asking about this. Is there a specific Marketplace extension we should look for?