Skip to main content
Discount Kit Live surfaces up to 25 of the discounts you’ve tagged dk:live — both automatic and code-based. It doesn’t filter by who’s viewing the page, what market they’re in, or what’s already in their cart. Use these inline Liquid patterns to do that filtering in your theme.
The max_reward_percent and max_reward_cents scalar metafields automatically exclude targeted discounts (test mode, GWP, customer-tagged, market-specific, and code-based). If you use the scalar metafields for badges, no filtering is needed. The patterns below are only needed when working with the full discounts array.

Filtering by Method (Automatic vs Code)

Each discount in the discounts array carries a method field of either 'automatic' or 'code'. Split your rendering accordingly:

Hiding Codes Already Applied to the Cart

When a shopper has already entered a discount code, advertising it again is noise. Compare the code against cart.discount_applications to detect what’s in play:
Shopify normalises discount codes case-insensitively at checkout, so we downcase both sides of the comparison. The cart.discount_applications array is populated server-side on each page render, so this works without any JavaScript.

Filtering Test Mode Discounts

Discounts in test mode only apply to customers tagged test. Use the test field to exclude them from your storefront display.

Filtering by Market

Discounts can be restricted to specific Shopify Markets. Filter to show only those applicable to the customer’s current market.

How It Works

  • Uses localization.market.handle to identify the current market
  • Empty included_markets means the discount applies to all markets
  • If included_markets has values, the current market must match
  • Checks excluded_markets to exclude specific markets

Complete Example

Filtering by Customer Tags

Discounts can target specific customers using tags. Filter to show only those applicable to the current customer.

How It Works

  • Included Tags: Customer must have at least one tag from included_customer_tags
  • Excluded Tags: Customer must not have any tag from excluded_customer_tags
  • Not Logged In: Customers who aren’t logged in are excluded from tag-targeted discounts

Complete Example

Combined Filtering

Combine both market and customer tag checks for complete eligibility filtering:

Next Steps