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

Topic summary

A developer wants to dynamically add or remove items from a customer’s cart based on their current selections using Shopify cart/checkout functions.

Proposed Solution:

  • Checkout UI Extensions can handle this requirement
  • useCartLines API allows monitoring cart state, including line item quantities and attributes
  • useApplyCartLinesChange API enables creating, updating, or deleting items based on specific conditions

Technical Requirements:

  • Knowledge of Remix, React, and Node.js is necessary
  • Provides flexible customization capabilities

Alternative Approach:

  • If building a custom extension seems challenging, using a compatible Shopify app is recommended instead
  • The responder requests app suggestions if anyone knows of suitable options
Summarized with AI on November 3. AI used: claude-sonnet-4-5-20250929.

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?

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

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! :waving_hand:

2 Likes