Unique URL for add to cart

Highlighted
New Member
2 0 1

Hello, I am trying to create a link which will allow users to reach the cart page directly with the product already added to cart with quantity of 1.

I was following the exact instructions from this link and it still does not work. https://help.shopify.com/en/themes/customization/cart/use-permalinks-to-preload-cart?utm_source=guru...

This is how I did it according to the insturctions but not working, its showing cart is empty. 

https://store.uprightpose.com/cart/415226036260:1

 

Any help please?

 

Thank you

 

0 Likes
Highlighted
Community Moderator
Community Moderator
3073 231 503

Hi Ariav, 

Nick here from Shopify. 

I did a test and clicked the link which you provided in the post also and found the same result. This is what I see here when I followed the process. I'm going to take a deeper look into this for you and get back to you when I have an update if that's ok. I'm not quite sure why it isn't working. 

All the best, 

Nick

Nick | Community Moderator @ Shopify
 - Was my reply helpful? Click Like to let me know! 
 - Was your question answered? Mark it as an Accepted Solution
 - To learn more visit the Shopify Help Center or the Shopify Blog

0 Likes
Highlighted
Community Moderator
Community Moderator
3073 231 503

Hi Ariav, 

I did some further testing on this for you and found out why the link you added was not working. The reason behind the link not working is because it is a product id and not a variant id for the product. For the permalink to sync properly it must be a variant id. For example, it is like saying t-shirt instead of black t-shirt with the logo in red in small. So just to make sure to get the variant id in the search console after adding .xml at the end of the product page. 

I did one which works which you can see from the link below:

https://store.uprightpose.com/cart/43106781710:1

Hope this helps and makes it clear why this wasn't working with the link you used. Don't hesitate to ask should you have any other questions about this or anything else. 

Nick

 

Nick | Community Moderator @ Shopify
 - Was my reply helpful? Click Like to let me know! 
 - Was your question answered? Mark it as an Accepted Solution
 - To learn more visit the Shopify Help Center or the Shopify Blog

0 Likes
Highlighted
New Member
2 0 1

Thank you Nick, that's great and its working for me now. 
But this looks like its sending you directly to checkout page. Can we use the same concept for Cart page?

1 Like
Highlighted
Shopify Expert
9872 100 1710

You can do do a link like so:

https://yourstore.com/cart/add/43106781710

 

★ Winning Partner of the Build a Business competition. ★ http://freakdesign.com.au
1 Like
Highlighted
Community Moderator
Community Moderator
3073 231 503

Hi Ariav, 

Yep just as Jason shows us here, just to put /add after /cart should do the trick for you here. Yours would like this for example: - https://store.uprightpose.com/cart/add/43106781710

There is also a way to add different quantities for this feature also. It would slightly change the layout of this to something like this for example https://store.uprightpose.com/cart/add?id=43106781710&quantity=99. Maybe Jason knows a more simple way to put the link together for a different quantity in the cart?

Nick

 

Nick | Community Moderator @ Shopify
 - Was my reply helpful? Click Like to let me know! 
 - Was your question answered? Mark it as an Accepted Solution
 - To learn more visit the Shopify Help Center or the Shopify Blog

0 Likes
Highlighted
New Member
1 0 0

How do I make this AJAX add to cart?

0 Likes