Skip to main content
Discount Kit Live automatically syncs all of your 25 active automatic discounts, ensuring only current discounts are available. However, it does not filter based on customer tags or markets. Use these inline Liquid patterns to filter discounts based on customer and market eligibility.

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

{% assign discounts = product.metafields.app--9549316097--discount_kit.discounts.value %}
{% assign current_market = localization.market.handle %}
{% assign eligible_discount = nil %}

{% for discount in discounts %}
  {% assign is_eligible = true %}

  {% comment %} Check included markets {% endcomment %}
  {% if discount.included_markets.size > 0 %}
    {% assign market_match = false %}
    {% for market in discount.included_markets %}
      {% if market == current_market %}
        {% assign market_match = true %}
        {% break %}
      {% endif %}
    {% endfor %}
    {% unless market_match %}
      {% assign is_eligible = false %}
    {% endunless %}
  {% endif %}

  {% comment %} Check excluded markets {% endcomment %}
  {% if discount.excluded_markets.size > 0 %}
    {% for market in discount.excluded_markets %}
      {% if market == current_market %}
        {% assign is_eligible = false %}
        {% break %}
      {% endif %}
    {% endfor %}
  {% endif %}

  {% comment %} Take first eligible discount {% endcomment %}
  {% if is_eligible %}
    {% assign eligible_discount = discount %}
    {% break %}
  {% endif %}
{% endfor %}

{% if eligible_discount %}
  <div class="badge">
    {{ eligible_discount.maximum_reward_value }}% OFF
  </div>
{% endif %}

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

{% assign discounts = product.metafields.app--9549316097--discount_kit.discounts.value %}
{% assign eligible_discount = nil %}

{% for discount in discounts %}
  {% assign is_eligible = true %}

  {% comment %} Check included customer tags {% endcomment %}
  {% if discount.included_customer_tags.size > 0 %}
    {% if customer %}
      {% assign has_required_tag = false %}
      {% for required_tag in discount.included_customer_tags %}
        {% if customer.tags contains required_tag %}
          {% assign has_required_tag = true %}
          {% break %}
        {% endif %}
      {% endfor %}
      {% unless has_required_tag %}
        {% assign is_eligible = false %}
      {% endunless %}
    {% else %}
      {% comment %} Not logged in but tags required {% endcomment %}
      {% assign is_eligible = false %}
    {% endif %}
  {% endif %}

  {% comment %} Check excluded customer tags {% endcomment %}
  {% if discount.excluded_customer_tags.size > 0 %}
    {% if customer %}
      {% for excluded_tag in discount.excluded_customer_tags %}
        {% if customer.tags contains excluded_tag %}
          {% assign is_eligible = false %}
          {% break %}
        {% endif %}
      {% endfor %}
    {% endif %}
  {% endif %}

  {% comment %} Take first eligible discount {% endcomment %}
  {% if is_eligible %}
    {% assign eligible_discount = discount %}
    {% break %}
  {% endif %}
{% endfor %}

{% if eligible_discount %}
  <div class="vip-badge">
    {{ eligible_discount.discount_title }}
  </div>
{% endif %}

Combined Filtering

Combine both market and customer tag checks for complete eligibility filtering:
{% assign discounts = product.metafields.app--9549316097--discount_kit.discounts.value %}
{% assign current_market = localization.market.handle %}
{% assign eligible_discount = nil %}

{% for discount in discounts %}
  {% assign is_eligible = true %}

  {% comment %} Check market eligibility {% endcomment %}
  {% if discount.included_markets.size > 0 %}
    {% assign market_match = false %}
    {% for market in discount.included_markets %}
      {% if market == current_market %}
        {% assign market_match = true %}
        {% break %}
      {% endif %}
    {% endfor %}
    {% unless market_match %}
      {% assign is_eligible = false %}
    {% endunless %}
  {% endif %}

  {% if discount.excluded_markets.size > 0 %}
    {% for market in discount.excluded_markets %}
      {% if market == current_market %}
        {% assign is_eligible = false %}
        {% break %}
      {% endif %}
    {% endfor %}
  {% endif %}

  {% comment %} Check customer tag eligibility {% endcomment %}
  {% if is_eligible and discount.included_customer_tags.size > 0 %}
    {% if customer %}
      {% assign has_required_tag = false %}
      {% for required_tag in discount.included_customer_tags %}
        {% if customer.tags contains required_tag %}
          {% assign has_required_tag = true %}
          {% break %}
        {% endif %}
      {% endfor %}
      {% unless has_required_tag %}
        {% assign is_eligible = false %}
      {% endunless %}
    {% else %}
      {% assign is_eligible = false %}
    {% endif %}
  {% endif %}

  {% if is_eligible and discount.excluded_customer_tags.size > 0 %}
    {% if customer %}
      {% for excluded_tag in discount.excluded_customer_tags %}
        {% if customer.tags contains excluded_tag %}
          {% assign is_eligible = false %}
          {% break %}
        {% endif %}
      {% endfor %}
    {% endif %}
  {% endif %}

  {% if is_eligible %}
    {% assign eligible_discount = discount %}
    {% break %}
  {% endif %}
{% endfor %}

{% if eligible_discount %}
  <div class="badge">
    {{ eligible_discount.maximum_reward_value }}% OFF
  </div>
{% endif %}

Next Steps