Byte Digital Themes

Discount codes

Inline discount input in drawer + cart page.

Updated 2026-05-09

Theme settings → Cart → Show discount code field.

When enabled, an input field appears in both the drawer and the cart page. Customers can apply codes without going through checkout.

Behavior

  1. Customer types code → click Apply
  2. Theme calls /cart/update.js with the code as a discount
  3. If valid: success toast + cart re-renders with the discount applied
  4. If invalid: red error message ("This discount code isn't valid.")

Persistence

The applied code persists across cart updates (qty changes, item removals). A removed-item rebuild reflects the recalculated cart from /cart.js so the discount badge stays accurate.

Limitations

  • Shopify's API allows only one discount code per cart at a time. Applying a second code replaces the first.
  • Automatic discounts (set up in Shopify admin) apply on top of any manual code, where eligible.

Hide entirely

Untoggle the setting to remove the input. Customers can still apply a code at checkout.

Need a hand? Contact support.