Duplicating product-template.liquid does not work

Solved
Highlighted
New Member
5 0 0

I am trying to modify the product template for some of my products so I copied and pasted the entire content of the existing one into a new "section" file but have run into a few issues with that. What I did is as follows:

 

  • copied the contents of "product.liquid" under the templates and pasted it in a new product template called "product.tabbed.liquid"
  • In the new template I changed {% section 'product-template' %} to {% section 'producttabbed-template' %} which is the name of my new section file
  • Copied the contents of "product-template.liquid" in sections and pasted it in a new section file called "producttabbed-template.liquid"

Once that was done I changed the product template in one of my test products to the new template that I just created and even though it was an exact copy & paste the quantity selector box is now missing and the "ADD TO CART" looks different. Below is a product using the original product template and also a duplicate of that product using the "product.tabbed" template

 

CUSTOM TESTER - Showing quantity box & correct theme "ADD TO CART" button

 

CUSTOM TESTER 2 - Not showing quantity box and has non-theme "ADD TO CART" button

 

Any help would be greatly appreciated.

0 Likes
Highlighted
Shopify Partner
1840 177 707

This is an accepted solution.

Hello and welcome to the community!

 

I am going to assume you are using Supply theme by Shopify - looks like it. But it does help mentioning what theme you are using when asking theme related questions.

 

Regarding the button style - your add to cart button has an extra class added to it .btn--secondary-accent because of of a section setting called enable_payment_button. You need to go to your theme customiser and customise that section making sure that "Show dynamic checkout button" is disabled. Of course, if you wish to leave it enabled you could also change the code mentioned in the previous sentence.

 

Same goes for quantity - enable "Show quantity selector".

 

Hope this helps!

Liked this post? You might also like our fantastic upsell apps Candy Rack and Candy Cart or offer free gifts with Gift Box. All made with ❤️  and care by Digismoothie
1 Like
Highlighted
New Member
5 0 0

Thank you for the response. I do not see the dynamic checkout button or quantity selector in the supply theme customization but even if they were there I do not believe that would solve my issue. The add to cart button and quantity selector show correctly on all my products except the one using the duplicated product template.

 

My question was if I duplicated the code exactly by doing a select all and then copy & paste in a new file why is the add to cart button changing and quantity selector disappearing?

0 Likes
Highlighted
New Member
4 0 0

I am having the exact problem as yours. Have you finally resolved it?

Thank you

0 Likes
Highlighted
New Member
5 0 0

Yes. It was exactly as @KarlOffenberger  suggested and I just weren't thinking straight at the time about what he was referring to. Just go to the customize theme section (not the code and rather the GUI) and on the live view screen go to one of the products that uses the new template. Then click on the product section on the right menu and change it from there. Once done it will be saved on the backend

for that new templateAnnotation 2020-09-04 124408.png

0 Likes
Highlighted
New Member
5 0 0

Thank you very much for the prompt response and sorry for replying so late. I got busy with some other projects and totally forgot about this one. Worked perfectly as you suggested.

0 Likes