- CrystalCommerce Liquid Documentation for Designers

Variant Drop

Properties

id
Variant ID for use in forms.
wtb_qty
Quantity the store is willing to buy (overall, not per-order) Example: 2.
in_stock?
Returns whether or not the variant is in stock. Using this interface should be preferred over qty > 0 because it takes into account variants configured for infinite qty.
info
String representation of the variant values for this particular item. Example: “Condition: NM-Mint | Language: English”.
product_id
Product ID for the corresponding product for this variant for use in forms.
has_multiple_descriptors?
Returns true if this variant represents the combination of multiple variant values (e.g. Language and Condition). False otherwise.
buylist_mode?
Returns true if the user is browsing in buylist mode. False otherwise.
price
Returns the formatted buy_price if in buylist mode. Otherwise returns the formatted sell price of the variant. Example: “$13.50”.
buy_price
See price.
store_credit_buy_price
Returns the formatted store credit buy price of the variant.
For example, if the store gives 30% for in store credit, and the buy price is $12.00, then the return value would be $15.60.
has_store_credit_buy_price?
Returns true if the store credit buy price is going to be different than the regular buy price.
qty
Returns the qty of variants in stock at the store. Example: 2.
short_info
Returns the variant values which represent this variant joined by “, “. Example: “English, NM-Mint”.
product
Returns the corresponding product for this variant as a Product Drop.
infinite_qty?
Returns whether or not the variant has infinite qty. If this is true, in most cases, the qty should be hidden and the buy button should be visible, regardless of the actual qty.
descriptor_values:
Returns a sorted list (sorted by the descriptor’s name) of the variant’s descriptor values, EX: ['Near Mint', 'English']
Usage:
{% for value in variant.descriptor_values %}
{{ value }},
{% endfor %}