Capturing product id from hyperlink in contact form

New Member
1 0 0


I would like my product page to have an enquire button - which links to the contact page. The form in the contact page - will have its topic - auto filled up with the product title - or page it came from.

Currently my idea is to make the Enquiry button a hyperlink.
 <a href="/pages/contact-us?topic={{ product.title }}"><input type="button" class="action-button" value="Enquire Here">

Problem is, i need help for the contact form to capture the product title. The current code in looks like this :

 <div class="input-row">
        <label for="topic">{{ 'contact.form.topic' | t }}</label>
        <input type="text" class="required" id="topic" class="contact[topic]" name="contact[topic]" />


Thanks in advance