Issues creating a new product template

I have followed what I believe to be the correct steps to add a new product template but am not seeing any changes.

  1. I went to my theme customizer > products > Create template > created one called “myname-default”
  2. I went online store > themes > edit code (this is for my active published theme)
  3. I created a new liquid file named “myname-template-product.liquid“ in the themes sections folder.
  4. I copied the contents of my themes default product template file “vela-template-product.liquid“ which is also in the sections folder.
  5. I pasted this content into my “myname-template-product.liquid“ in the themes sections folder and saved it.
  6. I located my “product.myname-default.json“ within the themes templates folder and changed the line "type": "vela-template-product"to "type": "myname-template-product"
  7. I made a simple change to “myname-template-product.liquid” by adding “test!!!“ to the html just before the products h1 tags, and saved it. The word was added in html, not within any liquid or json code.
  8. I went to one of my products and assigned this new “myname-default” template and saved the product.
  9. I check the product, could not see the change, cleared the cache, still no change.

Any help appreciated. I have likely misunderstood or missed something simple as I primarily do Wordpress dev and have not done this in Shopify for a good few years.

Did you assign the product to the new template? @PhantomDentist

Hi ProtoMan44, thanks for the reply.

Yes I have selected “myname-default” under test product for the “Theme template“

Here is correct way to create and assign a custom product template

Create the product template file

In Shopify admin → Online Store → Themes → Edit code.

In the templates folder, click Add a new template.

Select Product.

In the file name box, type: product.myname-default.json

Click Done (Shopify will create product.myname-default.json).

Assign the template to a product

Go to Products in Shopify admin.

Open the product you want to change.

On the right side, under Theme template, select: product.myname-default

Then Save the product and view the product.

@PhantomDentist You need to create a new template in the theme files.

Go to Online Store > Edit Theme > Templates folder → select New Template → choose Product in the options → then write the name of the template and save it

I don’t appear to have the New Template option, possibly I am missing something.

Hi @PhantomDentist. A quick way to get this handled is to just create the new template from the Theme Editor and test the new section in here directly.

Just go to Online Store → Customize → The middle of the header and click here:

Click create template.

When the new template is created you can place the section (if created correctly) directly inside the theme editor.

@PhantomDentist Don’t worry, let me explain. Sorry, i forgot that shopify changed the theme editor.
select this icon to create ne file


put this file name “product.myname-template-product.json”

Then open the product.json file, copy all the code, and paste it in your new template.

then leave it and go product side and assing to one for test tempate and open in customizer.

Okay, I will give it a run. Thanks for the assistance.

@PhantomDentist If your issue is solved, please mark my comment as the solution. Thanks.

So that actually is and was working. I think it’s the next step where the issue lies.

I am able to assign that template to a product just fine. I can then modify the product template in theme customizer just fine :slight_smile:

I am trying to get the new “product.myname-template-product.json” file to reference a different .liquid file than the original “product.json“ file.

In the “product.json“ file on line 21 (screen cap below), the line "type": "vela-template-product" I believe the .json file is referencing the file "vela-template-product.liquid"which contains the html for the product page

The changes I need to make, but only for this specific product, are actually within the “vela-template-product.liquid" file as I need to completely restructure the products html code.

So I was assuming I can create a new file, place it in the same “sections“ folder as the "vela-template-product.liquid", copy the content from "vela-template-product.liquid" into it, save it as "myname-template-product.liquid", then edit line 21 of "product.myname-template-product.json” from

"type": "vela-template-product"

to

"type": "bikeventures-template-product"

And now my new .json file would be referencing my new .liquid file, so I can completely change the product layout both in the customizer and by altering the .liquid file whilst only affecting products that have this template selected.

However the modifications I am making in "myname-template-product.liquid"are not showing on my product, so I assume I have misremembered the correct way to reference a .liquid file from my .json file possibly ><

Thanks