Hi, could someone please help me with this.
For some products, I want to give customers ability to upload more than 1 file
What I have done is create a separate product template, now, I assume I need to create a second product form (say form2) and add the extra lines in. Which I have done below
And I guess the 3rd step is reference this new form (form2) in the New product.json?
But running into an error
This could be the wrong way to do this, let me know if this is correct or if there is a better way to go about this
Hello @Tony1992 , this type is different from the form “product-form2.liquid” you created. Keep the type same as before and ipen the product.liquid or main-product.liquid and search for the type name. You’ll find a when statement like {% when ‘TYPE_NAME’ %} under this you will find a {% render ‘Product-form’ %}. There simply replace the product-form with “product-form2” and save it.
It should work, please do let me know if you need further assistance.
Regards,
Osama Farooqi
Hi Thank you so much for your reply, but I believe my theme uses .json
When I create a new product template from the editor, it created a new .json file
So now I have 2 .json files (product.json and producttshirt.json) I assume I have to modify these. Whereas I only have 1 product liquid. If I modify that, then I lose my current settings for products that uses product.json
Hello @Tony1992 , yes you’re right. Let me explain it little more, you need to implement both of ours solution to achieve this.
Step 1) Duplicate Template file. Which you already did, from ‘product.json’ to ‘product-tshirtcustom.json’.
Step 2) Create duplicate of section file named ‘product.liquid’ or ‘main-product.liquid’ (may vary from theme to theme).
Step 3) Then in this file you will need to follow the steps that I shared in my previous reply. You will need to find the place where ‘product-form’ is being rendered and replace it with ‘product-form2’.
Step 4) now you will need to add this new section name to the type of main in ‘product.tshirtcustom.json’.
Please let me know if you need further assistance to implement this on your store.
Regards,
Osama Farooqi
That worked so well, the part where I needed to change the code is actually in the Snippet so I had to go a step further and duplicate that snippet, change the code and reference that in the section.
Thank you so much for your help