Product
Product object represents a product sold in web-store. Can be either product or product variant.
List of available attributes
- alt_image?
- alt_image
- assets
- available?
- categories
- currency
- dimensions
- id
- image?
- image
- name
- og_image?
- og_image
- out_of_stock?
- price
- price_min
- price_max
- price_with_tax
- price_min_with_tax
- price_max_with_tax
- reserved_quantity
- sku
- slug
- status
- stock
- tax_rate
- uses_variants
- variants_count
- weight
alt_image?
Returns true
if the product has an alternative image (i.e. the product has a list of
assets with at least one member).
alt_image
Returns the product's alternative image (the first member of the product's assets list).
assets
Returns an array of the product's assets as Images. In addition to the list of assets, the product may have a main image.
available?
Returns true
if product is available, i.e product status is live, store is active and set up correctly. Returns true
even if product is out of stock.
categories
Returns an array with the products categories. Each item is of category type.
currency
Returns product currency.
dimensions
Returns an object with the product dimensions. The object has the following attributes:
height
- product height. Usage example:{{ product.dimensions.height }}
.length
- product length. Usage example:{{ product.dimensions.length }}
.width
- product width. Usage example:{{ product.dimensions.width }}
.unit
- unit of measurement. Usage example:{{ product.dimensions.unit }}
. Default value ism
.display_unit
- preferred unit for display. Usage example:{{ product.dimensions.display_unit }}
. Default value iscm
.
id
Returns product ID.
image?
Returns true
when the product has an image. Returns false
otherwise.
image
Returns the product's main image. Additionally, the product may have a list of secondary assets.
name
Returns translated product name based on locale.
og_image?
Returns true
when the product has an image. Returns false
otherwise.
og_image
Returns Image object of the product image. Image URLs refers to the current site domain.
out_of_stock?
Returns true
if the product is out of stock. Returns false
otherwise.
price
Returns product price before tax.
price_min
Returns the lowest price of product variants before tax. If product has no variants, returns the product price.
price_max
Returns the highest price of product variants before tax. If product has no variants, returns the product price.
price_with_tax
Returns product price after tax.
price_min_with_tax
Returns lowest product variant price after tax. If product has no variants, returns the product price.
price_max_with_tax
Returns highest product variant price after tax. If product has no variants, returns the product price.
reserved_quantity
Returns the number of reserved products.
sku
Returns the product SKU.
slug
Returns the product slug.
status
Returns the product status, "draft"
if the product is not live and "live"
when product is live.
stock
Returns the number of products in stock.
tax_rate
Returns the product's tax rate.
uses_variants
Returns true
if the product uses variants. Otherwise returns false
.
variants_count
Returns the number of variants the product has.
weight
Returns an object with the product weight. The object has the following attributes:
weight
- product weight. Usage example:{{ product.weight.weight }}
.unit
- unit of weight. Usage example:{{ product.weight.unit }}
. Default value iskg
.unit
- preferred unit for display. Usage example:{{ product.weight.display_unit }}
. Default value iskg
.