- CrystalCommerce Liquid Documentation for Designers

Product Drop

Properties

id
Product ID for use in forms.
catalog_id
Official Catalog Product ID if applicable.
name
Name of the product.
Example: "Shivan Dragon"
qty
Quantity in stock across all variants.
Example: 2
in_stock?
Returns whether or not this product has at least 1 qty in stock. This should be preferred over qty > 0 because it takes into account variants configured for infinite qty.
wtb_qty
Quantity the store wants to buy (buylist mode) across all variants.
Example: 2
description
Long-form description of the product.
Example: "Super cool shiny object."
buylist_mode?
Returns true if being accessed from buylist mode. False otherwise.
has_variants
Currently always turns true.
row_id
The unique string id to be used in the markup for this product.
Example: "product_12345"
main_photo
Returns the main photo for the product as a Photo Drop.
large_photo
Shortcut for {{"{{ product.main_photo | photo_url: 'large' "}}}}
medium_photo
Shortcut for {{"{{ product.main_photo | photo_url: 'medium' "}}}}
thumb_photo
Shortcut for {{"{{ product.main_photo | photo_url: 'thumb' "}}}}
original_photo
Shortcut for {{"{{ product.main_photo | photo_url: 'original' "}}}}
sell_price
Returns the formatted base sell price for the product.
Example: "$13.50"
buy_price
Returns the formatted base buy price for the product.
Example: "$13.50"
store_credit_buy_price
Returns the formatted store credit buy price of the product.
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.
price_range
Returns an object that responds to min and max for the range. Use the money filter on the price to get it formatted.
product.price_range.min will return the lowest in-stock price for the product, from all in-stock variants
product.price_range.max will return the highest in-stock price for the product, from all in-stock variants
category
Returns the category to which the product belongs as a Category Drop.
url
Returns a path to the product in question.
Example: "/catalog/magic_singles-core_sets-10th_edition/craw_wurm/10164"
buylist_url
Returns a path to the product in question in buylist mode.
Example: "/buylist/magic_singles-core_sets-10th_edition/craw_wurm/10164"
variants
Returns a list of displayable variants for this product as Variant Drops. Variants are ordered in descending order by price (buy or sell, depending on context).
default_variant
Returns the default variant for the product as a Variant Drop.
photos
Returns a list of all photos associated with the product as Photo Drops.
preorder?
Returns true if the item is a preorder item and the preorder date is in the future. Will return false otherwise.
available_on
Returns formatted date string of the date the item will become availabe on if preorder? is true.
Example: "Friday, April 15, 2011"
tag_list
Returns an array of tags that the product is tagged with
Example: ["FNM", "!Anathemancer", "Foil", ".Buylist Slider"]
related_tag_list
Returns the tags that are used to show the Related Products section (ie ones that start with an !)
Example: ["!Anathemancer"]
possible_variants_count
Count of possible variants for a product. Magic cards has between 7 and 121 possible variants. Sealed product often has 1 possible variant.
msrp:
Formatted, with symbol, MSRP of the Product
Example: $12.99
msrp_to_f
Unformatted numerical representation of the MSRP
Example: 12.99
has_variants_with_infinite_qty?
Returns whether or not any of the available variants are set to have infinite qty.
variant_descriptor_names:
Returns a sorted list of the variant’s dimension names, EX: ['Condition', 'Language']
Usage:
{% for name in product.variant_descriptor_names %}
{{ name }},
{% endfor %}
domestic_only?:
Returns whether or not the product can only be sold domestically.
descriptor_hash:
Returns the product’s descriptors as a hash, so it can be accessed per value. For example, if the product’s “Card Type” descriptor was “Creature”:
{{ product.descriptor_hash.card_type }}
manufacturer_sku:
Returns the manufacturer sku of the product