Use cart permalink to get to cart and not checkout

Highlighted
Shopify Expert
195 0 23

I'm using this doc to insert permalinks on my store. However, the permalinks redirect you straight to checkout, and I would like to have it redirect to the cart page. 

Does anyone know how to do this?

Maukau - Shopify Experts in Paris, France
0 Likes
Highlighted
Shopify Expert
10007 116 1818

Sure.

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

or 

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

 

★ Winning Partner of the Build a Business competition. ★ http://freakdesign.com.au
Highlighted
Shopify Expert
195 0 23

Thanks Jason, you're the man!

Maukau - Shopify Experts in Paris, France
0 Likes
Highlighted
Tourist
8 0 2

Hi Jason, I'm trying to do exactly this too! Could you please help?  I'm currently doing this in the address bar but it takes me to checkout instead of cart: 

https://littlekoha.co.nz/cart/13071991767103:1,13825481048127:1,13996566183999:1,13825272709183:1,13...

Highlighted
Tourist
7 0 1

Hey Chloe,

 

Your permalink you're using is a Checkout permalink. Take another look at the URL: https://domain.com/cart/add?id=XXXXXX&quantity=1 it is a little different :D

 

Replace the XXXXXX with the variant ID.

Also, if anyone is interested, if you're trying to add multiple items to cart (so you don't have to buy a bundle plugin!) try this: https://domain.com/cart/add?id[]=XXXXXX&id[]=XXXXXX&id[]=XXXXXX that will add 3 products. 

 

Bundle to checkout is this: https://domain.com/cart/XXXXXX:QTY,XXXXXX:QTY,XXXXXX:QTY add a discount to checkout by adding ?discount=your-discount-code

 

If you want to add a discount at cart via permalink you can't. You'll have to write a custom script. 

 

0 Likes
Highlighted
New Member
2 0 0

Hey James_drone

 

Can you please explain the square brackets in your solution to add multiple items to cart?

 

 


@James_Drones wrote:

Hey Chloe,

 

Your permalink you're using is a Checkout permalink. Take another look at the URL: https://domain.com/cart/add?id=XXXXXX&quantity=1 it is a little different :D

 

Replace the XXXXXX with the variant ID.

Also, if anyone is interested, if you're trying to add multiple items to cart (so you don't have to buy a bundle plugin!) try this: https://domain.com/cart/add?id[]=XXXXXX&id[]=XXXXXX&id[]=XXXXXX that will add 3 products. 

 

Bundle to checkout is this: https://domain.com/cart/XXXXXX:QTY,XXXXXX:QTY,XXXXXX:QTY add a discount to checkout by adding ?discount=your-discount-code

 

If you want to add a discount at cart via permalink you can't. You'll have to write a custom script. 

 


 

0 Likes
Highlighted
Tourist
7 0 1
Hi wesleyr,

No I can't haha. Just leave them in there they're important. Nothing goes in between them that I know of.
0 Likes
Highlighted
New Member
2 0 0
Right-o!

Well, I kept getting a domain error trying to use that format and eventually was able to troubleshoot it (with some help from another post from Jason) — the brackets have to be escaped for it to work

ie. https://domain.com/cart/add?id%5B%5D=XXXXX&id%5B%5D=XXXXXX

0 Likes
Highlighted
Tourist
7 0 1
That's so interesting! I'm a super novice so I'm just curious and I asked the same question to my dev, who gave me that bracket solution.

This is one of the links we use
https://shop.droneit.com.au/cart/add?id[]=19197200236613&id[]=19258116505669&id[]=19258119553093

Do you get a domain error there?
0 Likes
Highlighted
New Member
2 0 1

Is this supposed to work for both logged in and logged out members? I am taken to the account login page whenever I try to use the /cart/[VARIANT ID] method. 

 

Is this normal behavior or specific to my theme?

0 Likes