We're moving the community! Starting July 7, the current community will be read-only for approx. 2 weeks. You can browse content, but posting will be temporarily unavailable. Learn more

Can Shopify cart extensions remove items from a user's cart?

Can Shopify cart extensions remove items from a user's cart?

emiller
Shopify Partner
21 0 10

We have a scenario in which we want to add/remove items to a person's cart based on other items they've selected. Can this be one using shopify functions/cart extensions?

Reply 1 (1)

bluetree
Shopify Partner
23 3 18

@emiller It seems achievable using Checkout UI extensions. What do you think? 🐦

Checkout UI Extensions Documentation

 

You can use  useCartLines  to check the state of the cart, including retrieving line item quantities and attributes.

Additionally, by using useApplyCartLinesChange, you can create, update, or delete items based on certain conditions.

Knowledge of Remix, React, and Node.js will be required, but it allows for flexible customization.

 

If this seems challenging, I recommend using a compatible Shopify app instead.

If anyone knows of a good app, please share! 👋

あおき