Discuss and resolve questions on Liquid, JavaScript, themes, sales channels, and site speed enhancements.
Hello There,
My shop is hoponturkey.com and I have a get a quote form at every product page because we don't sell physical products rather customized services and there are no fixed prices and the aim is to get customers to contact us and ask about the price.
The main issue is that when a customer fills out the contact us form on one of the pages, I get an email telling me what the message was, the email of the customer and the basic info, but it doesn't tell me which page they filled the form on which is vital for my business since they would be asking about a particular service and wanting to get a price but I don't know which service, I would really appreciate if someone can tell me what to add but check the website before because I have a whole different thing going on there, I don't have an add to cart nor buy now nor prices there, only a contact form.
Thanks in advance
Solved! Go to the solution
This is an accepted solution.
So I'm just getting started on my own shop, but I believe that I have one method to accomplish this. On the product page where you've put the form, I think the product object information is available. You can, therefore, modify the form so as to include a (hidden, if you want) form field to pass on the product.title or other data about it ala {{ product.title }} or any other attribute. No guarantees, but may be worth looking into.
This is an accepted solution.
Hey @Shams123 ,
It looks like @JohnAtFisharply is on the right track! You will need to edit your 'product-template.liquid' file and add some code. This will get the product/service to be included in your contact form emails. Here's a quick how-to:
Before you customize your theme:
Edit your theme code
<input type="submit" class="btn right" value="{{ 'contact.form.send' | t }}">
{%- if product and product.title -%} <input type="hidden" id="contactFormProduct" name="contact[product]" value="{{ product.title }}"> {%- endif -%}
That's it! Do let me know if this solved your problem or if you need further help.
Brian | Shopify Partner | Ecommerce Consultant
- Was my reply helpful? Click Like to let me know!
- Was your question answered? Click Accept as Solution
- Need further assistance? Visit www.BrianAtWork.com
This is an accepted solution.
So I'm just getting started on my own shop, but I believe that I have one method to accomplish this. On the product page where you've put the form, I think the product object information is available. You can, therefore, modify the form so as to include a (hidden, if you want) form field to pass on the product.title or other data about it ala {{ product.title }} or any other attribute. No guarantees, but may be worth looking into.
This is an accepted solution.
Hey @Shams123 ,
It looks like @JohnAtFisharply is on the right track! You will need to edit your 'product-template.liquid' file and add some code. This will get the product/service to be included in your contact form emails. Here's a quick how-to:
Before you customize your theme:
Edit your theme code
<input type="submit" class="btn right" value="{{ 'contact.form.send' | t }}">
{%- if product and product.title -%} <input type="hidden" id="contactFormProduct" name="contact[product]" value="{{ product.title }}"> {%- endif -%}
That's it! Do let me know if this solved your problem or if you need further help.
Brian | Shopify Partner | Ecommerce Consultant
- Was my reply helpful? Click Like to let me know!
- Was your question answered? Click Accept as Solution
- Need further assistance? Visit www.BrianAtWork.com
Thank you guys very much, it worked like a charm. However, just for anyone reading this in the future, if you have removed the add to cart and buy now buttons from your store, and added only a form for customers to contact you, you might have a different Products template, so you must change to that template not the product-template.liquid the gentlemen suggested.
Thank you guys once again
Brian, I would like to add size and color to the email, is there a way to add them?
Thank you your code worked for me!! Took some time for me to figure it out as someone without coding knowledge but I was able to change the contact form so that I know which page (not necessarily product) the form was submitted, by adding the following to the contact form section code:
{%- if page_title -%}
<input type="hidden" id="contactFormPageTitle" name="contact[page title]" value="{{ page_title }}">
{%- endif -%}
This was based on your code and luckily I got it to work!
Thanks so much for this, works perfect and it was just what I was looking for.
Hi Shams,
I’m glad that you solved your problem. If you will look for a tool which gives you functionality of personalized contact form on every page in your store which is a simple ticket system (in ticket you will get information about the url where the message was sent), you can try Leave a Message. I am sure that the installation process will be easier!
Hey Community! As the holiday season unfolds, we want to extend heartfelt thanks to a...
By JasonH Dec 6, 2024Dropshipping, a high-growth, $226 billion-dollar industry, remains a highly dynamic bus...
By JasonH Nov 27, 2024Hey Community! It’s time to share some appreciation and celebrate what we have accomplis...
By JasonH Nov 14, 2024