When a customer clicks on a permalink  they are taken to a checkout page which asks them for contact information. This page shows (in the right hand column) that the items specified in the permalink are now in their shopping cart. The page also has two links that take them to their shopping cart page (/cart): "Cart" in the breadcrumbs near the top of the page and "Return to cart" near the bottom of the page. However, the behaviour that the customer sees when they click these cart links depends on their previous history on your site:
In my opinion this is a bug. In case 1 above the user should see a properly loaded shopping cart.
It appears the problem springs from the fact that in case 1 above the customer does not have "cart=..." and "cart_ts=..." cookies in their browser. These cookies are created when a user first adds an item to their cart. When they do this a POST request is made using the Ajax API  and the response sets these two cookies in the browser.
It seems that this problem could be fixed if you were to also set these cookies (if they're not already set) when a customer clicks on a permalink and you redirect them from the cart URL (e.g. /cart/1234567:1) to the checkout URL (e.g. /12121212/checkouts/05c88505f195da538ce3154cb9596f3a). Without these cookies the browser won't be able to remember the id of the cart it's looking at on the checkout page.
A permalink is specifically designed to skip the cart creation step, and create a checkout instead. So when you click back to cart, what you'd be seeing is what you skipped. It could be empty, or it could contain other items not seen in that permalink checkout.
If you need to have them in a cart, add the items to the cart with AJAX and once they are all there redirect the user to the checkout (/checkout).
Hi Jason. The behaviour you describe is not what I see. If you click on a permalink then the current shopping basket is cleared and then populated with the items in the permalink. I even tested this using a permalink example that you provided elsewhere: https://weldmongerstore.com/cart/3409421701:1
Thanks, I'll probably have to resort to using the Ajax API to accomplish what I need but it would be much cleaner to use permalinks. I need the functionality that allows the customer to change their shopping cart when they click on the permalink; hence my interest here.
@Rory5 Did you end up using the API to add items to the Shopify cart when using permalinks to checkout?
It seems like an oversight on Shopify's part and I'm running into similar issues. Curious how you solved it
Hello - I'm trying to give users a URL so that it first clears any existing items from cart & then adds the items given in the URL to their cart. I don't want them to go to checkout due to the specific use case that I have + other cart attributes that I want users to fill
I'm able to do both of these separately by using /cart/clear & /cart/update but can't seem to find out how to do both at the same time.
I'm trying to send this URL to customers in a message so that they simply click this & their cart will now only contain these items. Also, in my use case, I dont want them to head to checkout directly but it should land on the cart page.
any help would be much appreciated!
You can chain them together.