Dawn Theme including item's information on the Contact Form

Solved

Dawn Theme including item's information on the Contact Form

CaliforniaMotor
Visitor
2 0 1

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

Accepted Solution (1)

Savior
Shopify Partner
537 108 161

This is an accepted solution.

@CaliforniaMotor 

 

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.

banned

View solution in original post

Replies 7 (7)

Savior
Shopify Partner
537 108 161

This is an accepted solution.

@CaliforniaMotor 

 

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.

banned
CaliforniaMotor
Visitor
2 0 1

Hi @Savior ,

thanks for your answer. Dou you mean to insert this code on product.json template?

Savior
Shopify Partner
537 108 161

@CaliforniaMotor 

 

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.

banned
boauae
Excursionist
12 0 4

How to make contact fields required and not optional?

Savior
Shopify Partner
537 108 161

@boauae 

We can't alter Shopify error code but we can add custom JS for contact form validation.

banned
boauae
Excursionist
12 0 4

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. 

Savior
Shopify Partner
537 108 161

@boauae 

 

I will need your access to add the validation using Javascript. Do you have Shopify plus? because only Shopify plus can edit the checkout page.

 

If you want to send the access send your store URL at here with your requirement.

banned