Enquire on Product Page

Tourist
21 0 1

Hi i have an enquire contact form popup on my product pages, but im wanting to know if theres a way for the enquire form to include which page or product they were enquirying from included on the email

 

https://audioconnect.co.nz/products/uv-blacklight-slimbank-uv-18

 

Perhaps a code embedded in the input code? 

 

<div id="contact-form">
                                  <div class="form-group">
                                    <input required type="text" id="name" class="form-control" placeholder="First Name" value="{% if form.name %}{{ form.name }}{% elsif customer %}{{ customer.first_name }} {{ customer.last_name }}{% endif %}" name="contact[name]" />
                                  </div>
                                  <div class="form-group">
                                    <input required type="text" id="lname" class="form-control" placeholder="Last Name" value="" name="contact[lname]" />
                                  </div>
                                  <div class="form-group{% if form.errors contains 'email' %} error{% endif %}">
                                    <input required type="email" id="email" class="form-control" placeholder="{{'contact.form.email' | t }}" value="{% if form.email %}{{ form.email }}{% elsif customer %}{{ customer.email }}{% endif %}" name="contact[email]" />
                                  </div>
                                
                                  <div class="form-group">
                                     <input required type="text" id="datepicker" class="form-control" placeholder="Hire Date" value="{{ form.date }}" name="contact[date]" />
                                    
                                  </div>
                                   <div class="form-group">
                                    <input required type="text" id="phone" class="form-control" placeholder="{{'contact.form.phone' | t }}" value="{{ form.phone }}" name="contact[phone]" />
                                  </div>
                                  <div class="form-group{% if form.errors contains 'body' %} error{% endif %}">
                                    <textarea required id="message" class="form-control" placeholder="{{'contact.form.message' | t }}" cols="40" rows="7" name="contact[body]">{{ form.body }}</textarea>
                                  </div>
                                  <input type="hidden" name="contact[Product Name]" value="{{ product.title }}"  />

                                  <div class="form-actions">
                                    <button type="submit" class="btn btn-custom">{{'contact.form.submit_button' | t }}</button>
                                  </div>
                                </div>

 

 

0 Likes
New Member
2 0 0

Here is what I used, captures a number of values from the page, some as hidden fields and passes them into the email.

 

<div class="grid grid--small">
                    <input type="hidden" id="ContactFormQueryType" name="contact[QueryType]"  value="New Product Enquiry">
                    <div class="grid__item large">
                      <label for="ContactFormName" class="hidden-label">{{ 'contact.form.name' | t }}</label>
                      <input type="text" id="ContactFormName" class="input-full" name="contact[name]" placeholder="{{ 'contact.form.name' | t }}" autocapitalize="words" value="{% if form.name %}{{ form.name }}{% elsif customer %}{{ customer.name }}{% endif %}">
                    </div>

                    <div class="grid__item large">
                      <label for="ContactFormEmail" class="hidden-label">{{ 'contact.form.email' | t }}</label>
                      <input type="email" id="ContactFormEmail" class="input-full" name="contact[email]" placeholder="{{ 'contact.form.email' | t }}" autocorrect="off" autocapitalize="off" value="{% if form.email %}{{ form.email }}{% elsif customer %}{{ customer.email }}{% endif %}">
                    </div>
                    <div class="grid__item large">
                      <label for="ContactFormPhone" class="hidden-label">{{ 'contact.form.phone' | t }}</label>
                      <input type="tel" id="ContactFormPhone" class="input-full" name="contact[phone]" placeholder="{{ 'contact.form.phone' | t }}" pattern="[0-9\-]*" value="{% if form.phone %}{{ form.phone }}{% elsif customer %}{{ customer.phone }}{% endif %}">
                    </div>
                    <input type="hidden" id="ContactFormProductTitle" name="contact[ProductTitle]"  value="{{ product.title }}">
                    <input type="hidden" id="ContactFormProductSku" name="contact[ProductSku]"  value="{{ current_variant.sku }}">
                    <input type="hidden" id="ContactFormProductURL" name="contact[ProductURL]"  value="https://www.domain.com/collections/{{collection.handle}}/products/{{product.handle}}">
                    <input type="submit" class="btn right" value="{{ 'contact.form.send' | t }}">                
                  </div>

 

0 Likes
New Member
2 0 0

Here is what I used, captures a number of values from the page, some as hidden fields and passes them into the email.

 

<div class="grid grid--small">
    <input type="hidden" id="ContactFormQueryType" name="contact[QueryType]"  value="New Product Enquiry">
    <div class="grid__item large">
        <label for="ContactFormName" class="hidden-label">{{ 'contact.form.name' | t }}</label>
        <input type="text" id="ContactFormName" class="input-full" name="contact[name]" placeholder="{{ 'contact.form.name' | t }}" autocapitalize="words" value="{% if form.name %}{{ form.name }}{% elsif customer %}{{ customer.name }}{% endif %}">
    </div>
    <div class="grid__item large">
        <label for="ContactFormEmail" class="hidden-label">{{ 'contact.form.email' | t }}</label>
        <input type="email" id="ContactFormEmail" class="input-full" name="contact[email]" placeholder="{{ 'contact.form.email' | t }}" autocorrect="off" autocapitalize="off" value="{% if form.email %}{{ form.email }}{% elsif customer %}{{ customer.email }}{% endif %}">
    </div>
    <div class="grid__item large">
        <label for="ContactFormPhone" class="hidden-label">{{ 'contact.form.phone' | t }}</label>
        <input type="tel" id="ContactFormPhone" class="input-full" name="contact[phone]" placeholder="{{ 'contact.form.phone' | t }}" pattern="[0-9\-]*" value="{% if form.phone %}{{ form.phone }}{% elsif customer %}{{ customer.phone }}{% endif %}">
    </div>
    <input type="hidden" id="ContactFormProductTitle" name="contact[ProductTitle]"  value="{{ product.title }}">
    <input type="hidden" id="ContactFormProductSku" name="contact[ProductSku]"  value="{{ current_variant.sku }}">
    <input type="hidden" id="ContactFormProductURL" name="contact[ProductURL]"  value="https://www.domain.com/collections/{{collection.handle}}/products/{{product.handle}}">
    <input type="submit" class="btn right" value="{{ 'contact.form.send' | t }}">                
</div>

 

0 Likes