Add to cart link

Highlighted
New Member
7 0 0

Hello.  I would like to use the "insert link" tool in the page editor to insert a link that puts a specific item in the user's cart.  I am using an image as the "button" / link instead of a real button.  Is there a url which will add a product to the cart that I can past into the url spot in the "instert link" tool?  This would be very helpfull. 

I'm basically trying to do the same thing as "using permalinks to pre load cart" but instead of taking the user to the payment page I want to take them to their cart.

Please help.  Thanks!

0 Likes
Highlighted
Shopify Expert
10006 116 1818

The url would look something like this:

http://some-store.com/cart/add?id=123456789

/* or */

http://some-store.com/cart/add?id=123456789&quantity=9

 

★ Winning Partner of the Build a Business competition. ★ http://freakdesign.com.au
Highlighted
New Member
7 0 0

Thanks!  works great

0 Likes
Highlighted
New Member
1 0 0

Hi, 

I tried to add UTM variables into the URL but somehow GA can't track these. Do the UTM parameters get lost when you add them to the link? 

Kind regards, 
Amaury

0 Likes
Highlighted
Tourist
4 0 2

Jason,

 

Could you explain where the ID code comes from? Or perhaps how you made that direct Add to Cart link? I cannot find that ID code anywhere in my products. I have a link like the one you posted that a colleague made, but I can't figure out how to make one for another product.

 

Any help you can provide would be greatly appreciated!

Highlighted
New Member
1 0 1

Hey @BAllison, I was looking for an answer to that exact question... I found it in the video on this page:

 

https://community.shopify.com/c/Shopify-Design/Cart-Use-permalinks-to-pre-load-the-cart/td-p/613702 

 

The basics of it is adding ".xml" to the end of the URL of your Product page, then finding the <variant> tag/id. That's your product variant number that you need to add to a link like this:

 

<a href="http://wlabsinnovations.com/cart/add?id=yourvariantIDnumber&quantity=1">Buy Now</a>

 

Hope that helps!

Highlighted
Tourist
4 0 2

Thanks very much Dan!

Highlighted
Tourist
8 0 4

We developed this app to help quicly build these pre-loaded cart links and quickly convert customers. Hope it helps!
https://apps.shopify.com/permalinks

Highlighted
New Member
3 0 0

Hello - I have a question regarding this solution. It works perfectly for one product or multiple product with the same quantity.

But how do you do multiple products with different quantities of each? 

Thank you

 

 

0 Likes
Highlighted
New Member
2 0 0

This is the final add to cart URL to I settled with: https://www.yoursite.com/cart/add?id=VARIANTID&quantity=1

  • "www.yoursite.com" should be replaced with your website
  • "VARIANTID" should be replaced with your products variant id
    • I didn't have any products with variations so the easiest way I found my product variation id was by going to admin page for the product I was trying to find the variant id for, adding ".xml" to the end of that URL and then looking for the text "<id type="integer">VARIANTID</id>". Youll probably find it right away if you search for "<id type="integer">"
  • "1" should  be replaced with the quantity that product you want to add to the cart
  • Adding Multiple Products and Quantities
0 Likes