Discount Ninja
Search
K
Comment on page

Product Context

Provides context to the promotion engine

Attributes

handle (string) [required]
  • Handle of the product.
variant-id (number)
  • Optionally, defines the id of the product variant. If missing the context is assumed to relate to the default product variant.
collections (string) [required]
  • A comma separated list of the handles of the collections to which the product belongs.
  • If the product belongs to zero collections, set the attribute to "[[--NONE--]]"
collection-ids (string) [required]
  • A comma separated list of the ids of the collections to which the product belongs.
  • If the product belongs to zero collections, set the attribute to "[[--NONE--]]"
available (boolean)
  • If set to false, this indicates that the product should be marked as out-of-stock on the online storefront. If missing the default is true.
original-price (number) [required]
  • The price of the variant identified by the variant-id, or the default variant of the product with handle handle if no variant-id is specified. The price should be expressed in the selected presentment currency.
compare-at-price (number) [required]
  • The "compare at" price of the variant identified by the variant-id, or the default variant of the product with handle handle if no variant-id is specified. The price should be expressed in the selected presentment currency.
price-varies (boolean)
  • If the variant-id is not set, price-varies is required. If set to true, this indicates that the product contains product variants with different prices.
price-min (number)
  • If the variant-id is not set, price-min is required. It defines the price of the product variant with the lowest price.
tags (string) [required]
  • A comma separated list of the tags of the product.
  • If the product has no tags, set the attribute to "[[--NONE--]]"

Example

<la-dn-product-context
handle="product-1"
variant-id="12345678"
collections="collection-1,collection-2"
collection-ids="12345678,234567890"
available="true"
original-price="15000"
compare-at-price="20000"
price-varies="true"
price-min="15000"
tags="[[--NONE--]]">
</la-dn-product-context>