I have followed what I believe to be the correct steps to add a new product template but am not seeing any changes.
I went to my theme customizer > products > Create template > created one called “myname-default”
I went online store > themes > edit code (this is for my active published theme)
I created a new liquid file named “myname-template-product.liquid“ in the themes sections folder.
I copied the contents of my themes default product template file “vela-template-product.liquid“ which is also in the sections folder.
I pasted this content into my “myname-template-product.liquid“ in the themes sections folder and saved it.
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"
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.
I went to one of my products and assigned this new “myname-default” template and saved the product.
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.
@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
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:
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
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 ><