it seems that the global liquid variables all_products and collections are not available in the checkout.liquid file. Is there any way to access liquid product object for a specified product? Code like the following, which is working in all other liquid files, is not working in checkout.liquid:
{{ all_products["product-handle"].title }}
I’m asking this because I want to display an upsell widget to customers that have only one product in their cart and ask them to add another (matching) one, so that they can get free shipping. But I don’t want to hard-code product images, titles, prices etc. Any suggestions?
I have the same problem, and the same request from a customer (upsell), we only have access to checkout and shop objects, but not products &collections. I’m interested in your solution.
I don’t know if you’ve finished your project, for my part, I have one last problem.
With my upsell, the customer is obliged to create a new order, and therefore a new shipment, did you manage to get around this problem?
Marked the answer about the AJAX API as the solution to the original thread.
As for your follow-up question, upselling through the API isn’t explicitly supported. You’d need to create a new order, and therefore a new shipment, as you mentioned.
This is a feature that we know the developer community wants though, so make sure to subscribe to our changelog to keep up to date on any relevant developments.
ok, I understand, I’m going to use a public application that allows it, I’ve seen this one : post purchase promotions that should suit me while waiting for this possibility