Function inputs, line item properties, and metafields

Updated · SMART Functions Creator (E-TRADE PARTNER)

Choose a Function input that includes the data your conditions need. Line item properties use Attribute input; product and variant metafields use the dedicated metafield input. The input type is locked after the function is created.

5.0 · SMART Functions Creator builds this as a Shopify Function, free on live stores, no code.

Install free
On this page
  1. Choose the input before saving
  2. Line item properties: data attached to a cart line
  3. Product and variant metafields
  4. Do not trust customer-entered prices
  5. Check these cases before activation

Choose the input before saving

The editor can select a compatible input while you build a new function. Once created, the input type is locked. If an existing function does not provide the data you need, create a function with the appropriate input and test it before switching over.

Line item properties: data attached to a cart line

In a Line group, select Line item property/attribute, enter the key, choose the operator, and enter the value. For example, match key _offer with value custom. The property must actually be submitted to the cart; a selected product-page checkbox alone is insufficient. Follow the line item property discount guide.

  • The function reads one property key. That key is shared across its Line groups; groups can compare different values for the same key.
  • The condition requires a nonempty key and comparison value. A negative comparison can also match a missing or empty property, but it matches other unexpected values too. It is not a dedicated missing-property test.
  • Attribute input does not include every selector offered by other inputs. Use the available product tags or collections when combining product targeting with property conditions; do not assume the standard input's specific product and variant picker is available.

Product and variant metafields

The metafield input reads a configured product namespace/key and a configured variant namespace/key. Each is shared across the function's Line groups. You can compare different values without configuring a different key in every group.

  • For numeric comparisons, use plain numeric values in the expected format and test both sides of the boundary.
  • Metafields act as conditions. A stored value of 15 can select a rule with a fixed 15% action; the editor does not dynamically turn any metafield value into a discount percentage.
  • Line item properties belong to individual cart lines. Product and variant metafields belong to Shopify catalog records. Choose the source that matches how your storefront or integration stores the data.

Do not trust customer-entered prices

A cart property can help identify an option or promotion, but buyer-supplied values are not proof of authorization or a trusted price. Configure the allowed discount in the app and combine it with suitable eligibility conditions. A property-based discount also does not add a checkbox or option selector to your theme.

Check these cases before activation

  1. Confirm the actual cart line contains the expected key and value.
  2. Test matching, nonmatching, missing, and empty values.
  3. Add two lines of the same variant with different properties and confirm only the intended line qualifies.
  4. Check mixed carts and customer eligibility, then inspect the checkout amount.
  5. If the needed selector is unavailable, verify Function input before rebuilding the conditions.

Related articles