Checking multiple discounts in cart

Topic summary

A developer is attempting to stack multiple discount codes in the Shopify cart using the /discount/ endpoint but encounters a limitation: applying a new code replaces the existing one rather than stacking them.

Key Technical Details:

  • Using fetch("/discount/${code}?redirect=/cart") to apply codes
  • Shopify allows multiple discount codes at checkout but only one code at a time in the cart
  • Codes can appear stacked in cart if applied during checkout and user navigates back, but cannot be added programmatically via the endpoint

Current Status:

  • The limitation is confirmed as expected Shopify behavior
  • A potential workaround using discount functions is suggested
  • Discussion remains open pending the developer sharing their specific use case for further alternative approaches
Summarized with AI on October 31. AI used: claude-sonnet-4-5-20250929.

anyone have any luck appending multiple discounts with the

/discount/ endpoint in the cart? seems like Shopify allows one code during the cart, but the multiple during the checkout. When I enter a valid discount code in the cart, but where 1 code is already active in cart, it replaces the 1 code instead of allowing the stacking.

doing a fetch like this:

fetch(`/discount/${encodeURIComponent(code)}?redirect=/cart`)

Any ideas, much appreciated! Thank you so much!

Hi @Kamaboko ,

You’re correct—Shopify allows multiple discount codes to be stacked at checkout, but in the cart, only one discount code can be applied at a time. When you apply a new discount code using /discount/{code}, it replaces the existing discount in the cart instead of stacking.

Hope this helps :slightly_smiling_face:

1 Like

Ohhh okay gotcha, thank you so much @Abel_Lesle . Bummer it can recognize the 2 codes in cart if you enter during the checkout and go back. And sad but can’t be added from custom endpoint. Hope they add this feature in the future!

1 Like

Can you share the use case here @Kamaboko , there might be an alternative through discount functions.

Might be able to suggest an approach here.

Regards