Best practice: Several product.liquid files vs one product.liquid file

Beapyrice
New Member
2 0 0

Hello guys,

I just started working on shopify themes and after a month of diving into the code I got a question, where I can't really find an answer to: My company started with the Brooklyn theme in the past and now after a year it happens, that several product.liquid files were created, for each product a dedicated file.

My stomach tells me this is not a good practice but I'm not sure at all and can't find any answers on the web. So that's why I want to ask you guys how you handle multiple products in a store, that don't have the same attributes (e.g. Shirts have different select options as compared to Phone cases)

If anyone could help or give insights, this would be highly appreciated!

In the pictures below it's shown how product sites were created until now: for every new product there is a new product.liquid file created in the templates directory and within those files there is an include for a dedicated product-template.liquid.

For me it's really a pain to make changes, as I have to adapt every change to 6-8 files.

Bildschirmfoto 2021-04-30 um 17.40.09.pngBildschirmfoto 2021-04-30 um 17.43.00.png

0 Likes
JHKCreate
Shopify Partner
2499 412 595

Hi @Beapyrice 

How different are these templates? Are they mostly sections that are shown/hidden based on product type?

- Did we solve your issue? Like & Mark As Solution to help the community
- Should you need any direct help: contact@jhkcreate.com
0 Likes
Beapyrice
New Member
2 0 0

To be honest, they are actually quite the same.

The only difference right now would be the part where the product options (product select options) are being shown. You can have a look at https://oceanmata.com !

0 Likes