Add to cart on the checkout page

fuad228
Visitor
2 0 0

Hi!

I'm trying to implement "add to cart" script on the checkout page (checkout.liquid file). Making calls to /cart/add.js perfectly works in inner pages of the theme. However, the same script doesn't work on the checkout page, item doesn't appear in the order summary when moved to the next step.

I'm aware that checkout page updates dynamically and invokes "page:change" event once content is changed. I wonder if there's any possibility to add an item to cart on the checkout page and keep it through all steps? I saw some apps do this.

Replies 2 (2)

Michal17
Shopify Partner
835 73 175

Hi @fuad228 

Hope you're having a great day!

The checkout process is rendered by the checkout.liquid file. Unlike theme.liquid, checkout.liquid is self-contained and does not render additional template files. This means that no changes to the layout of theme.liquid will have any effect on the checkout page.

The checkout.liquid layout is available to Shopify Plus merchants only. If your store isn't on Shopify Plus, then you can't customize your checkout pages (checkout.liquid).

fuad228
Visitor
2 0 0

Hey @Michal17 thanks for your reply!

Our store is on Shopify Plus plan, I'm aware that changes to theme.liquid will not be reflected on checkout.liquid, the questions was quite different.