product
The product
template renders the product page, which contains a product's media and content, as well as a form for customers to select a variant and add it to the cart.
Refer to the product template and its main section in Dawn for an example implementation.

Anchor to LocationLocation
The product
template is located in the templates
directory of the theme:
Anchor to ContentContent
You should include the following in your product
template or a section inside of the template:
-
The product form, with the following components:
- A variant selector
- A quantity input
- Accelerated checkout buttons
- Input elements for line item properties
Optionally, you might want to show product recommendations on the product page.
If you're using a JSON template, then any HTML or Liquid code needs to be included in a section that's referenced by the template.
Anchor to The product objectThe product object
You can access the Liquid product
object to display the product details.
Anchor to The product formThe product form
The product form is the main method for customers to add a product variant to the cart. You can include the product form with the Liquid form
tag and accompanying 'product'
parameter:
Example
If you need to add custom attributes to the form, like a class or ID, then you can modify the form's default attributes.
Inside the form, you need the following:
Anchor to The variant selectorThe variant selector
A variant selector is typically structured as one or more option value inputs that enable a buyer to specify which product variant to purchase. You can refer the product variants section for an example implementation.
Anchor to The quantity inputThe quantity input
You should include a quantity input to allow customers to choose the quantity of a variant that they're adding to the cart. This input needs to have an attribute of name="quantity"
, and the value must be an integer greater than 1:
Example
You should include accelerated checkout buttons to allow customers to quickly buy the product they're viewing. These can be added with the payment_button
Liquid HTML filter:
Example
To learn about styling and customizing these buttons, refer to the accelerated checkout reference
Anchor to Line item propertiesLine item properties
You can give customers the option to include additional information for a variant that's added to the cart by using line item properties. You can use line item properties to enable customers to customize orders or provide supplementary information. For example, you can capture monogram or engraving text, or let a customer upload a file.
These properties are captured through input elements with an attribute of name="properties[property-name]"
, where property-name
is the name of your custom property. Any property inputs need to be included inside the product form:
Example
To learn about displaying any line item properties that are collected in the cart, refer to the cart template reference for line item properties.
Anchor to UsageUsage
When working with the product
template, you should familiarize yourself with the following:
If you're using a JSON template, then any HTML or Liquid code needs to be included in a section that's referenced by the template.
Anchor to The Cart AJAX APIThe Cart AJAX API
You can use the Cart API, which is part of the AJAX API, to allow customers to add a variant to the cart without redirecting them to the cart page afterwards.
Anchor to Show product recommendationsShow product recommendations
You can use the Product Recommendations API, which is part of the Ajax API, to upsell customers on related products. To learn more about how to use this API, refer to Product recommendations.