Adding products to cart via checkout extensions.

Shopify Partner
11 0 13

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)

Shopify Staff
1829 269 406

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 -

Scott | Developer Advocate @ Shopify