How to add a custom text field to a Craft theme product page?

Please help! I have searched & searched but cannot seem to be able to add the code to my Craft theme Product Pages so that customers are able to enter Custom Text.

Liquid codes seem to be blank so I’m assuming i should be using json but unsure on codes etc for this as most documentation seems to be around .liquid coding. It was all working fine when i was using the Debut theme but now that ive changed to Craft, I can’t get it to work.

Is anyone please able to assist?

@Boundless1 Follow below link for adding custom field into product page

https://www.shopify.com/partners/blog/metafields

Hi @Boundless1,

You can try this code by following these steps:

Step 1: Go to Online Store->Theme->Edit code.

Step 2: Search file main-product.liquid,

Step 3: Paste the below code same as my screenshots → Save

Result:

Hope my solution works perfectly for you!

Best regards,

Victor | PageFly

Hi, Thanks for your response. Unfortunately I can’t see any screenshot.

Are you able to send through the code in text format by any chance?

you can add code

  
                      
                     
                    

Thank you! That worked however has now added the field for all my products.
I actually wanted to add it as a template so that I can select which
products to apply it on?

you can try to add a tag for the product that you want to show a custom field

and replace old code

{% if product.tags contains "show_customField" %}
                          
                          
                         
                        

                    {% endif %}

1 Like

Hi, PageFly-Victor.

Having the same issue want to add input field like Dropdown and Redio Button on product page so customer can add there details related to products.
I as your suggestion I open my main-product.liquid page but it don’t have Form tag.

Hi @PageFly-Victor

this is my code, I’m using the refresh theme

{%- form 'product', product, id: product_form_installment_id, class: 'installment caption-large' -%}
                  

                  
  
                      
                     
                    

                    
                      
                     
                    

                  
                  {{ form | payment_terms }}
                {%- endform -%}

I can see the text fields in the product page though I don’t see them and the information I have entered in the cart.

for anyone looking for a https://youtube.com/watch?v=KgXiUPh_O9Q