Line groups: how a rule selects products
Updated · SMART Functions Creator (E-TRADE PARTNER)
A Line group is a named filter over cart lines. Conditions use Line groups to ask questions ("at least 2 units in this group") and actions use them as targets ("discount this group"). The same Line group model is available across Discounts, Payment customizations, Delivery customizations, and Cart and checkout validations.
SMART Functions Creator builds this as a Shopify Function, with rules or in JavaScript.
Start free trialOn this page
Ways to match a cart line
- Specific products or specific variants
- Collections (note: a collection whose source is variants may not match; select the variants directly)
- Product tags, vendor, product name
- SKU with text operators (is, contains, starts with, ends with, matches regex, and their negatives)
- Variant name with the same text operators, so every variant whose title matches joins the group without picking IDs
- Product or variant metafield values, with text operators and number operators such as is greater than (number)
- Line item property with a predefined key and value. Arbitrary matching on unknown property keys is not supported; the key must be configured in the rule
- Line quantity, Line total, Line subtotal, and per-item total or subtotal, so a group can hold only lines above or below an amount
- Weight and Requires shipping
- Selling plan present or absent, selling plan name, selling plan metafield, selling plan recurring deliveries, applied discount present, compare-at price present
Using Line groups
- To scope a discount to a collection, target the action at the collection's Line group. It does not become storewide by itself.
- To compare groups, use Line group quantity, Line group total, or Compare line groups conditions. Comparisons are direct (greater than, equal, and so on); the builder does not multiply, add, or round.
- A validation that caps quantity per product needs one Line group per product; a single collection or tag group sums every matching item.
- Very large product lists count toward the 10 KB configuration limit. Prefer collections or tags for big ranges.