Product¶
The product variable represents a product for sale. Product objects are accessible in several ways:
- store.products array
- lineitem.product
- On the product page as the
productvariable
id¶
The product’s ID.
sku¶
Stock-keeping unit (SKU).
description¶
The product description (unescaped), as entered in the DPD admin.
<h2>{{ product.name|escape }}</h2>
<p>{{ product.description|escape }}</p>
Tip
Use the escape filter to filter your product’s description. It will automatically convert HTML special characters such as less-than (<), greater-than (>), and ampersand (&) into their HTML equivalents.
price¶
Default price.
type¶
Type of product. One of: combo, digital, digital_key, key, or tangible.
mime_type¶
The product’s MIME type. Always application/octet-stream.
files¶
List of files to be delivered.
Note
This only has one entry at this time. It is an array to support future expansion.
image¶
The product’s primary image. Use the product_img_url filter to create a full URL for the image.
{{ product.image|product_img_url("50x50")|img_tag }}
Would generate an <img src="..." /> tag for your product with a 50x50 image.
delivers_keycode¶
True if this product delivers a keycode.
delivers_file¶
True if this product delivers a file.
Important
delivers_file and delivers_keycode are not mutually exclusive.
A product can deliver a file and a keycode in one purchase.
combo¶
True if this product is a combo (bundle).
eula¶
EULA text (if entered).
requires_shipping¶
True if this product is shipped or requires shipping information.
quantities_enable¶
True if more than one of this product can be purchased at a time.