In the form of contact form 7 on wp to send the data of the item cards woocomerce?

There is a shop on WP with plugin woocomerce c

Made button in the map item and attached it to the inside of modelco medalki stuck contakt form 7 shortcode, you need to in the mail we received which product sent the request and it is the name of the product, ie, so I knew what product I want to order
How to implement?
June 27th 19 at 15:35
4 answers
June 27th 19 at 15:37
Made in the shape of text box, hide it using css. The JavaScript you put into it the information you need (name, url, etc.). Or the same using a hidden field - then without css.

More difficult - make the field, make him a default value such as __PRODUCT-INFO__ . Next, when you do call the shortcode like this:

$info = "Product:" . get_the_title() . "\ssylka: ". get_the_permalink();
$cf = but this do_shortcode('[contact-form-7 .....]'); // shortcode of your form
$cf = str_replace("__PRODUCT-INFO__", $info, $cf);
echo $cf7;</code-->
I think to do it through javascript and css.
Using script add to the value attribute of the field is not difficult, the difficulty is that I don't know how to pass this dynamic value to the product title for example, it is the same as that of the variables in php to get?
If it could direct where to look or email if you know - Randal.Reynol commented on June 27th 19 at 15:40
So you are in the front-end script to write. Pull the JavaScript contents title page or any h1 tag with the product name (or whatever you have the page layout done), put it in the field as value. Cases - for 1 minute, then the solution yet) - keagan_Hartmann commented on June 27th 19 at 15:43
Wrote then he thought of!
Blunted shorter)
Thank you! - Randal.Reynol commented on June 27th 19 at 15:46
June 27th 19 at 15:39
Use this plugin Contact Form 7 Dynamic Text Extension -
June 27th 19 at 15:41
Add a hidden field
Or use the tag [_post_name]
June 27th 19 at 15:43
Take the above plugin Contact Form 7 Dynamic Text Extension, choose dynamic text or dynamic hidden in the template of the created form letter and put for example this value if you want to display title of product:
CF7_get_post_var key='title'
Here is the full code:
[dynamictext dynamictext-577 "CF7_get_post_var key='title'"] You have the numbers 577 be different.

Find more questions by tags WordPressWooCommerce