Direct URL links to populate Cart? (Buy Button)

Highlighted
Tourist
7 0 1

Hi All,

I'm attempting to use the buy button embeded in a LeadPages.net lander to populate my cart (essentially on the LeadPage Lander).  On my own URL, it's a simple embedded button and works flawlessly; on LeadPages the native "Buy Now" button requires a direct link URL.  Thus, I can go Lander --> Shopify Product Page --> Cart but I can't figure out how to go Lander --> Cart.

This *seems* like it would be a common task...

Unhelpfully, Leadpages has the lander HTML locked down .  I suspect that I *could* scrape my own lander and force the embed into the code, but then I'd also have to upgrade my hosting for added traffic instead of cleanly doing a/b testing on Leadpages, so sub-optimal.

Thanks!

K

 

0 Likes
Highlighted
Shopify Expert
10006 116 1820

If you're just using a link of your own creation you can do a link like so:

http://foo.com/cart/add?id=123456789&quantity=1

(123456789 = variant id)

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

Awesome- Thanks Jason, that worked great!

(Note for posterity- don't mix up product and varient IDs when doing this) 

https://docs.shopify.com/support/your-store/products/where-do-i-find-my-variant-id

 

0 Likes
Highlighted
New Member
3 0 0

Hi Jason,

 

Do you know whether it is also possible to add different products with a different quantity via this option?

 

I've tried this, but it does not work. https://shop.hethaakbeest.be/cart/add?id[]=17592948490340&quantity=4&id[]=17592948850788&quantity=3

0 Likes
Highlighted
New Member
1 0 0

@Jason Is it possible to send an array of products with quantities?

 

I am able to add multiple devices with the following example:

/cart/add?id[]=<variant-1>&id[]=<variant-2>

 

But if I add quantities it does not take an affect:

/cart/add?id[]=<variant-1>&quantity[]=2&id[]=<variant-2>&quantity[]=5

 

I even tried with the following syntax but got an error about unpermitted members in the array.

/cart/add?id[]=<variant-1>:2&id[]=<variant-2>:3

 

 

0 Likes
Highlighted
Excursionist
17 0 4

You can do multiple products like so:

/cart/70881412:1,70881382:1

and if you want additional query params, then:

/cart/70881412:1,70881382:1?additional_query_params=goes-here

See this tutorial for more info

0 Likes
Highlighted
New Member
2 0 0

Any answers for this? How to preload multiple products with multiple quantities before check out page?

0 Likes
Highlighted
New Member
2 0 0

For me this technique is not working, I get

 

'Oops, something went wrong.

Link expired: Link no longer exists.'
 
Pretty sure it's the correct IDs and such. Is this broken now, or just me?
0 Likes
Highlighted
New Member
2 0 0

Same here...

0 Likes
Highlighted
Tourist
8 0 1

My product does not have any variant. I'm getting an error when I use this number on url after ADD/: 

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

drearom_0-1603267492068.png

 

Please help how to get variant #.

 

0 Likes