product
An offer - what a customer buys in this store.
Generated from the platform code - always matches what the theme engine allows.
An offer - what a customer buys in this store. Called product in templates so themes written for Shopify read naturally. One offer can have variants (options such as size) and a variant can be a bundle of several products.
Available on: offer page, home page, category page, feature value page, search, settings that point at it.
Properties
| Property | Type | Description |
|---|---|---|
product.id |
string | Offer identifier. |
product.title |
string | Offer title. |
product.handle |
string | The URL handle - /products/<handle>/. |
product.url |
string | Address of the offer page. |
product.description |
string | Long description, sanitised HTML - print it with |raw. |
product.shortDescription |
string | Short description, sanitised HTML. |
product.seoTitle |
string or null | The SEO title from the offer, empty when the merchant did not set one. The platform writes <title> itself. |
product.seoDescription |
string or null | The meta description from the offer. |
product.createdAt |
date | When the offer was created in this store - for a "New" badge. |
product.available |
boolean | True when at least one variant can be bought. |
product.bundle |
boolean | True when the offer is a bundle of several products. |
product.type |
string | What the merchant declared the offer is - single, variants or bundle. |
product.price |
number | Gross price of the variant the page shows, in minor units. Format with |money. |
product.priceFrom |
number or null | Lowest variant price, in minor units. |
product.priceTo |
number or null | Highest variant price, in minor units. |
product.priceVaries |
boolean | True when variants have different prices - show "from". |
product.compareAtPrice |
number or null | Regular price when a sale is running, for a crossed-out price. Null otherwise. |
product.selectedOrFirstAvailableVariant |
variant or null |
The variant chosen with ?variant= or the first one that can be bought. |
product.variants |
list of variant |
Variants a customer can buy. |
product.options |
list | Option axes for a variant picker: a list of { name, values }, for example { name: "Size", values: ["S", "M"] }. |
product.hasOptions |
boolean | True when the offer has option axes. |
product.media |
list of media |
Pictures and videos of the offer's products, in the order the merchant set. |
product.galleryLayout |
string | Gallery layout chosen on the offer - auto, thumbs or mosaic. |
product.featuredMedia |
media or null |
The first picture. |
product.features |
hash | The specification: feature name to displayed value, in the order set by the category. |
product.featuresByCode |
hash | Feature values keyed by feature code and by lowercase name, in the same form as features. |
product.fieldValues |
hash | Full feature values keyed by code - for themes that build content blocks from features. |
product.brand |
string or null | Brand of the first product of the offer. |
product.sku |
string or null | SKU of the first variant. |
product.categories |
list of category |
Store categories the offer is in, the main category first. |
product.mainCategory |
category or null |
The main category of the offer (marked with a star in the admin) - use it for breadcrumbs. |
product.rating |
number or null | Average review rating from 1 to 5, weighted across the offer's products. Null when there are no reviews. |
product.ratingCount |
number | Number of published reviews. |
product.reviews |
reviews or null |
Reviews to show. Only on the offer page; null elsewhere. |
product.preorder |
boolean | True when the variant the page shows (or the first one) is sold in pre-order - it can be bought and ships later. Use it for a "Pre-order" badge. |
product.preorderDate |
date or null | Expected shipping date of that pre-order. Null when there is no date. Format it with the date filter. |
product.optionFields |
list | Product option fields (engraving, gift wrap) for the add-to-cart form - each with a ready name attribute (properties[<id>]) and prices in minor units. Empty outside the offer page. |