How to add a contact form to a product page?

Artic
Tourist
10 0 1

I'm trying to add a contact form to a product page. But how? I'm using the Mobilia theme.

0 Likes
Nick
Community Moderator
Community Moderator
3802 364 751

Hi Arctic, 

Nick here from Shopify. 

This is something which will require some custom editing to the coding of your store from the backend. You would need to go to Online Store > Themes > Action Required > Edit Code > product-template.liquid. The best and easiest way to go about this would be to use product tags and assign a tag, say contact-required for this particular product and add the following code in:

{% if product.tags contains 'contact-required' %}
   ... your form code ...
{% endif %}

Another way to go about it is to create a special product collection that has the name contact-required in it and check if the product belongs to that collection:

{% for coll in product.collections %}
  {% if coll.handle  contains "contact-required" %}
     ... your form code ...
     {% break %}
   {% endif %}
{% endfor %}

If adding/ editing code is something you're not sure/ comfortable with, your best might be to reach out to the theme developers directly about this. The theme was developed by Out of the Sandbox and you can reach them via their direct website here. They would know best as they wrote the code and developed the theme. 

All the best, Nick

Nick | Community Moderator @ Shopify 
 - Was my reply helpful? Click Like to let me know! 
 - Was your question answered? Mark it as an Accepted Solution
 - To learn more visit the Shopify Help Center or the Shopify Blog

0 Likes
Artic
Tourist
10 0 1

Thank you, it worked!

But the contact form was added above the product. Do you know how to put it below the product?

0 Likes
DeKsTech
Shopify Expert
54 4 9

Hey Artic, probably need to shift your code down a bit in the Product.Liquid. Where did you put it in your HTML code? Make sure it's below the <div> after your product description

DeKs Tech | www.dekstech.com
DeKsTech
Shopify Expert
54 4 9

If you put it in product template liquid it should be at bottom as well

DeKs Tech | www.dekstech.com
Artic
Tourist
10 0 1

Thank you.

Nick
Community Moderator
Community Moderator
3802 364 751

Hey Arctic, 

DeKs Tech beat me to the punch. Hopefully, that works and don't hesitate to ask should you have any other questions about this or anything else. 

All the best, Nick

Nick | Community Moderator @ Shopify 
 - Was my reply helpful? Click Like to let me know! 
 - Was your question answered? Mark it as an Accepted Solution
 - To learn more visit the Shopify Help Center or the Shopify Blog

0 Likes
yuum
Excursionist
15 0 6

Hi, has there been a better/easier solution to this issue by now? A new app? I want to add a contact form to a product page and be able to know from which page the inquiry came from without having the customer typing the product name/code in the form. There should be a straight forward way to do it? Thanks!

made4Uo
Tourist
69 0 3

Hi, 

I have seen people create a contact form but have not included a javascript code (that really send an email, not just a form). No back end is included. There is a no subscription (totally free), no app or API instructions on how to do add a contact form in your product, which also include the name of the product and SKU number. No coding rCheck this link to the blog

 

0 Likes