Woocommerce CF7 Get Product Name

“contact form 7 insert hidden field page url”


Product pages on Woocommerce have an enquiry form but we need to include the product code/name and product/page url in the sent emails.

– Install the dynamic field plugin: Contact Form 7 Dynamic Text Extension
– Add some hidden fields to your contact forms

[dynamictext post_id “CF7_get_post_var key=’ID'”]
[dynamictext product_name “CF7_get_post_var key=’product_name”]
[dynamictext product_url “CF7_get_post_var key=’product_url”]

Contact Form 7 Dynamic Text Extension

And hidden fields version:

[dynamichidden product_name “CF7_get_post_var key=’product_name”]

hidden fields

*product_url field doesn’t work but you can set this automatically in the email template (CF7 special mail tags).

Product: [product_name]
Product URL : [_post_url]


Sam Deering is a web developer from England (currently living in Australia). In his spare time he enjoys coding, playing chess, reading and investing.

Leave a Reply

Your email address will not be published. Required fields are marked *