Developers

Product

Product object represents a product sold in web-store. Can be either product or product variant.

List of available attributes

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 is m.
  • display_unit- preferred unit for display. Usage example: {{ product.dimensions.display_unit }}. Default value is cm.

id

Returns product ID.

image?

Returns true when the product has an image. Returns false otherwise.

image

Returns Image object of the product image. Image URLs refers to the domain of the media server.

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 is kg.
  • unit - preferred unit for display. Usage example: {{ product.weight.display_unit }}. Default value is kg.