A space to discuss online store customization, theme development, and Liquid templating.
Hi,
I'm using the Shopify Dawn theme on my shop and I've placed a Contact Form on the product's page, so the customer can ask us questions about the product that he's viewing. We need to modify this form, so when the customer answers us, it includes some identification information (SKU, or link, or item's title...) on the subject field, so when we receive the contact form's email we can identify which product the customer's is talking about.
Any ideas?
Thanks and best regards,
Frank
Solved! Go to the solution
This is an accepted solution.
Hello
So add this lines above your contact form input type="email" on product page:
<input type="text" hidden name="contact [product_title]" value="{{ product.title }}">
You also add other product objects like sku, id by using the shopify product objects
Regards
Twinkle
If helpful please like and accept as solution. DM for any queries.
This is an accepted solution.
Hello
So add this lines above your contact form input type="email" on product page:
<input type="text" hidden name="contact [product_title]" value="{{ product.title }}">
You also add other product objects like sku, id by using the shopify product objects
Regards
Twinkle
If helpful please like and accept as solution. DM for any queries.
Hi @Savior ,
thanks for your answer. Dou you mean to insert this code on product.json template?
NO!!! In product.json you can see they is a section 'main-product.liquid'.
There where you have added the contact form {% form...%} you can add below this line. If you already have added the contact form.
Regards
Twinkle
If you still have issues or queries DM me.
How to make contact fields required and not optional?
We can't alter Shopify error code but we can add custom JS for contact form validation.
Thanks a lot for your reply! Could you help me make name, phone number and message required along with email?
I have also noticed that shipping form at checkout fields are all optional and not mandatory.