Adding products to cart via checkout extensions.

Adding products to cart via checkout extensions.

BIABAJay
Shopify Partner
15 0 15

I need to add "Recycling Fees" to the cart for 3 states. Currently I edited checkout.liquid to check the state and then add a recycling fee product to the cart. It looks like Shopify will be removing our ability to edit checkout.liquid. I need to find another way to accomplish this. Would checkout extensions be the answer??

Reply 1 (1)

SBD_
Shopify Staff
1829 272 417

Hey @BIABAJay 

 

Take a look at Checkout UI Extensions - This example uses an explicit buyer action to add the item to the cart, but you could also use an alternate trigger (e.g. if shipping state is X) if you wanted.

 

Alternatively, check out the Cart Transform API - https://shopify.dev/docs/api/functions/reference/cart-transform/graphql

Scott | Developer Advocate @ Shopify