Shopstack Work with us

Guides Build an offer

How do I make a conditional discount in Shopify, based on a customer tag, cart attribute, line item property or product metafield?

The four conditions, in plain words

A conditional discount applies only when something is true. These are the four things merchants ask about:

  • Customer tag: a label on a customer, like VIP or wholesale. Example: 15% off for customers tagged VIP.
  • Cart attribute: a note stored on the whole cart as a key and a value, like delivery_type = pickup. A theme or app adds it. Example: 10% off carts marked pickup.
  • Line item property: a note stored on one cart line, like Gift-wrap = Yes on a single product. Example: 10% off each line that has gift wrap.
  • Product metafield: a custom field on a product, like Eligible for promo = true. Example: 20% off only the products marked eligible.

The first and last have a native route. The middle two do not. Each section below says which.

Shopify's native routes, step by step

Shopify's discount form lets you limit a discount by customer (all customers, specific customers, or customer segments) and by product (specific products or collections). It has no field for a cart attribute or a line item property (amount off help page, checked November 7, 2026). A tag and a metafield get in through a segment and a collection.

Customer tag, through a customer segment. The full walk-through is in discounts by customer tag. The short version:

  1. In your Shopify admin, create a customer segment with the query `customer_tags CONTAINS 'VIP'` and save it, for example as VIP customers.
  2. Go to Discounts, click Create discount, and pick Amount off products or Amount off orders.
  3. Choose Discount code or Automatic discount, and set the Value.
  4. In the Eligibility section, select Customer segments, add VIP customers, and click Add.
  5. Set Combinations and Active dates, then click Save.

The same segment can use `number_of_orders` or `amount_spent` instead of a tag, for example `number_of_orders > 10` for repeat buyers (segment filters).

Product metafield, through an automated collection. You make a collection that holds every product with the metafield value, then point the discount at the collection.

  1. Go to Settings, then Metafields and metaobjects, then Products, and click your product metafield definition.
  2. In the Options section, turn on Use as a condition in collections and click Save.
  3. Go to Products, then Collections, and create a collection. In a Products source, click Add condition, then Metafield, pick the definition, and pick the value (collections with metafields).
  4. Go to Discounts, click Create discount, and pick Amount off products.
  5. In the Applies to section, select Specific collections and add the collection (amount off help page).
  6. Set the value, eligibility and dates, then click Save. Test with one product that has the metafield value and one that does not.

Use a product metafield here. A variant metafield puts a product in the collection when at least one of its variants has the value (collections with metafields), and a discount on that collection can then reach the variants that lack it. Test with a product whose variants differ.

Cart attribute or line item property. The discount form has no route for these. The workarounds change the question instead:

  • Turn the condition into a code. Give the offer a discount code and hand it only to the people or carts that qualify. The shopper's act of entering PICKUP10 is the condition.
  • Turn the line property into a product or variant. If gift wrap is a line property today, sell it as its own variant or product, put it in a collection, and discount the collection.
  • Write a Shopify Function. A Function can read cart attributes, line attributes and metafields as input. Stores on any plan can use public App Store apps that contain Functions. Only Shopify Plus stores can use custom apps that contain Functions (About Shopify Functions).
  • Use an app that has the condition built in, as in the next section.

Shopify can

  • Limit a discount to specific customers or customer segments. Source: help.shopify.com
  • Build a segment from a customer tag, an order count or total spent, such as `customer_tags CONTAINS 'VIP'`. Source: help.shopify.com
  • Apply a discount to specific products or specific collections. Source: help.shopify.com
  • Fill a collection from a product tag, type, vendor, price or metafield condition. Source: help.shopify.com
  • Use a metafield as a collection condition if its definition type is true or false, integer, decimal, rating, single line text or metaobject reference, on up to 128 product and 128 variant definitions. Source: help.shopify.com
  • Read metafields and cart attributes inside a Shopify Function. Source: shopify.dev

Shopify can’t

  • Use a cart attribute or a line item property as a condition in the discount form. The eligibility and applies-to settings cover customers, products and collections only. Source: help.shopify.com
  • Run a custom-coded Function from a custom app unless the store is on Shopify Plus. Source: shopify.dev
  • Use a metafield of another type, such as a date, as a collection condition. Source: help.shopify.com
  • Put more than 60 condition values on one collection source. Source: help.shopify.com

Make each condition with Discount Genie

Discount Genie is a Shopify discount app by Shopstack, built on Shopify Functions. Its forms have a condition for each of the four. Customer tags are in the Standard discount forms, so they work on the basic free plan, which covers up to 3 basic discounts. Cart attribute and line item property conditions sit in the Advanced style. The metafield condition is in the Standard product discount, but it is a paid feature.

  1. In Shopify admin, open Discount Genie, click Discounts, and under Create discounts like a Genie pick Product (or Order for a whole-order discount) (create your first discount).
  2. Under Method, choose Discount code or Automatic discount, and set the value.
  3. Customer tag: in the Customer eligibility card, choose Target customers by properties, add Tags, and under Select customer tags pick the tags. Choose whether the shopper must have any or all of them, or must not have them. Tick Require users to be logged-in, because a shopper who is not logged in has no tags.
  4. Product metafield: on a Standard Product discount, in the product conditions pick Product variant metafield. Under Choose targeted metafield pick a true or false variant metafield, then set Value. Value for products without metafield decides what happens to variants that lack it.
  5. Cart attribute: switch the Product or Order discount to the Advanced style. In the cart qualifiers, pick Cart has attribute. Keep Attribute from on Online store, type the key under Attribute key, press enter, then under Choose condition pick Contains any, Contains all, or a Not contains option, and type the values.
  6. Line item property: on a Product discount in the Advanced style, pick Has line item property in the cart qualifiers, or Product has line item property in the product conditions. Type the Property key and the values you want to match.
  7. To use several conditions, add up to 5. A selector chooses Apply if all properties are met or Apply if any property is met.
  8. Click Save, then test a cart that meets the condition and one that does not.

Details that decide whether a condition behaves as you expect:

  • Paid options on the basic free plan: the option still shows, with a Paid feature badge. Save stays off until you remove it or upgrade.
  • One key per field on the Product discount: the form takes one cart attribute key, one line item property key and one metafield. Test a setup that needs more than one before you rely on it.
  • Cart attribute and product line item property are substring matches: the cart's value matches if it contains the text you typed, so pickup also matches store-pickup. The cart-level line item property condition is an exact match.
  • Metafield is true or false only, on a variant metafield. For a text or number metafield, use the native collection route above.
  • Tags need a logged-in shopper: an include-tag rule never matches a guest.

Discount Genie's paid plans include all 11 discount types. New stores pay $0.99/mo for the first 3 months on any monthly paid plan, then Core $29.99, Growth $59.99, Pro $79.99 or Scale $99.99 a month. The plan offered depends on the store's Shopify plan.

Worked examples

  • Customer tag: 15% off for the tag VIP. A VIP buys $200 and gets $30 off. A shopper without the tag gets $0.
  • Product metafield: 20% off products where Eligible for promo is true. Cart: a $120 jacket (eligible) and a $40 hat (not). Discount: 20% of $120 = $24. Cart total: $160 - $24 = $136.
  • Cart attribute: 10% off when the cart attribute delivery_type contains pickup. A $150 cart marked pickup gets $15 off. The same cart marked ship gets $0.
  • Line item property: 10% off lines whose Gift-wrap property contains Yes. Two items at $50 each, one with gift wrap: $5 off the wrapped one, nothing off the other.

Setups to copy

  • VIP club, 15% off. Product discount, Automatic discount, Percentage 15, tag VIP, Require users to be logged-in ticked. Works on the basic free plan (up to 3 basic discounts).
  • Promo products, 20% off. Product discount, Discount code PROMO20, Percentage 20, Product variant metafield Eligible for promo = true. Paid plan.
  • Pickup orders, 10% off. Order discount, Advanced, Cart has attribute key delivery_type, Contains any pickup. Paid plan.

Test it before launch

For each condition, place two test orders with your saved discount (and its code, if you chose the Discount code method): one that meets the condition and one that does not.

  1. Meets it: expect the discount line at checkout.
  2. Misses it: expect no discount line.
  3. Guest checkout: for a tag condition, check as a logged-out shopper too.
  4. Edge value: for an attribute or property, try a value that only partly matches, like store-pickup, to see the substring match.

Shopify vs Discount Genie for each condition

ConditionShopifyDiscount Genie
Customer tagYes, through a customer segmentTags in Customer eligibility, basic free plan
Order count or total spentYes, through a customer segmentAdvanced Product, Order, Tiered and Volume discounts, paid plans
Product metafieldYes, through an automated collection (6 definition types); use product metafields, not variant onesProduct variant metafield, true or false, paid plans
Cart attributeNo, Function code onlyCart has attribute, Advanced style, paid plans
Line item propertyNo, Function code onlyHas line item property, Advanced style, paid plans
PriceIncluded with ShopifyBasic free plan (up to 3 basic discounts); paid plans: new stores pay $0.99/mo for the first 3 months on any monthly paid plan

FAQ

Can Shopify make a discount based on a cart attribute?

Not in the discount form. Shopify exposes cart attributes only to Shopify Functions, which means code or an app (Shopify Functions). Discount Genie's Cart has attribute condition covers it on paid plans.

Can I discount by product metafield in Shopify without an app?

Yes, through a collection. Turn on Use as a condition in collections for the metafield definition, build an automated collection on it, and select that collection under Applies to (Shopify help).

Does a customer tag discount work for guest checkouts?

It depends on the tool. Shopify applies a segment discount when it identifies the customer at checkout by email address or phone number (Shopify help). In Discount Genie a guest has no tags, so a rule that includes a tag never matches a guest. Tick Require users to be logged-in.

Can one discount have several conditions?

Yes. In Discount Genie you can add up to 5 and choose whether all or any must be met. In Shopify, a segment can combine filters, such as a tag and an order count, in one query (segment filters).

Is the tag condition on the basic free plan of Discount Genie?

Yes. Customer tags are included in the basic free plan, which covers up to 3 basic discounts. The other conditions need a paid plan. New stores pay $0.99/mo for the first 3 months on any monthly paid plan.