All Tutorials

Create alternate templates

All Tutorials

Create alternate templates

Create alternate templates

Creating an alternate template allows you to modify the way content is shown on your online store, but only for the products, collections, blogs, and other pages that you apply the alternate template to. For example, you can create an alternate product template that has no add to cart button, and apply it only to products that are not for sale. Or, you can create an alternate page template that doesn’t include a header, and apply it to a selection of your store’s pages.

Create a new template file in your theme

  1. In the Templates directory, click Add a new template.

  2. Choose a type option for your new template. For example, for an alternate product template, select product. Give your template a meaningful name, which will make it easy to find when you are assigning it in the admin. For example, an alternate product template with no prices or add to cart button might be called not-for-sale.

  3. Click Create template. Your new template will open in the code editor, and the file will be populated with default code.

  4. Edit your new template as needed.

  5. Click Save.

Assign your template in the admin

After you have created an alternate template, it will appear in your admin. You will see a Theme templates section in the sidebar of the appropriate admin page. For example, if you have created a new product template, a Theme templates section will be visible when you click to view, create, or edit a product. You can assign the template that you want to use for each product from the Template suffix list.

The Theme templates section won't appear on the product page unless your theme has more than one product template. If you don't see the Theme templates section after creating a new template, it's possible that you have created a template of a different type. For example, you might have created a page template instead of a product template.

Only templates present in your published theme will be available in the Theme templates section.