Answer the question
In order to leave comments, you need to log in
How to send woocomerce product card details in contact form 7 on wp?
There is a store on WP with woocomerce plugin plugin
dev.treppenhaus.ru/product/%D1%82%D0%B5%D1%81%D1%824 so that the mail receives data from which particular product the request was sent, namely the name of the product, i.e. so that I understand which product they want to order
How to implement?
Answer the question
In order to leave comments, you need to log in
Make a text field in the form, hide it with css. Javascript put the information you need into it (name, url, etc.). Or the same thing using a hidden field - then without css.
More complicated - make a field, make it a default value for example __PRODUCT-INFO__ . Next, when calling the shortcode, do something like this:
<?php
$info = "Товар: " . get_the_title() . " \nСсылка: " . get_the_permalink();
$cf = do_shortcode('[contact-form-7 .....]'); // шорткод вашей формы
$cf = str_replace("__PRODUCT-INFO__", $info, $cf);
echo $cf7;
Use this plugin Contact Form 7 Dynamic Text Extension - https://ru.wordpress.org/plugins/contact-form-7-dy...
Take the Contact Form 7 Dynamic Text Extension plugin mentioned above, select dynamic text or dynamic hidden in the template of the created email form and insert, for example, this value if you want to display the title of the product:
CF7_get_post_var key='title'
This is how the code looks like:
[dynamictext dynamictext -577 "CF7_get_post_var key='title'"] Your numbers 577 will be different.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question