product
The product
object has the following attributes:
product.currency
Returns a uppercase ISO 4217 currency code of the product.
product.description
Returns the raw markdown description of the product. To render the markdown, use the markdown
tag.
product.id
Returns the id of the product.
product.image
Returns a image object of the product's banner.
Input
{% if product.image %}<div class="product-image" style="background-image: url({{ product.image.url }})"></div>{% endif %}
Output
<div class="product-image" style="background-image: url(https://cdn.selly.io/s/dbe57d3c3ffd42793ead029443ba6c57bd924886...)"></div>
product.layout
Returns the layout used for the product page. 1
being the default layout, and 2
being the compact layout.
product.price
The price of the product. To format the price, refer to the Money Filters.
product.stock
The stock of the product. Can return either a string or integer depending on the product type. If the product.product type is 1
, 3
or 4
, it will return ∞
.
If the product.product is 2
, it will return the stock determined by the stock delimiter.
For example, with a product
with a product.product of 2
and product.stock of 8
:
Input
{% if product.stock != "∞" && product.stock == 0 %}<div>Out of stock</div>{% else %}<div>{{ product.stock }} in stock</div>{% endif %}
Output
<div>8 in stock</div>
product.title
Returns the title of the product.