S
S
Said Shukurov2021-09-28 13:18:28
WordPress
Said Shukurov, 2021-09-28 13:18:28

How to send a link to the product that the customer wants to buy in the lead form in one click in a letter to the store owner and the client?

How to make it so that in pop-up forms in Contact Form 7, when sending a notification to the client and the store owner, a link to the product that the client wants to buy is left? And the same thing with the purchased product, that is, a person bought something, and he needs to send a letter in which there is a link to his product, and in the same lead form, request a photo "
Here is a link to the site with the theme forms: https ://xn---24-qddplg.xn--p1ai/vysotnye-elki/

Answer the question

In order to leave comments, you need to log in

1 answer(s)
O
Orkhan Hasanli, 2021-09-28
@Said927

How to make it so that in pop-up forms in Contact Form 7, when sending a notification to the client and the store owner, a link to the product that the client wants to buy is left?

I understand that you decided to abandon the functionality of the WC itself and instead of a full-fledged cart design, you decided to use CF7?
If so, then you can implement your task in different ways.
1) The CF7 plugin has its own tags. This option may not work in some cases. For example, the user clicked the Add to Cart button while on the product category page and, accordingly, instead of the link of the product itself, the email will receive a category link
https://contactform7.com/special-mail-tags/
Search for:
[_url]
or
[_post_url]
2) (As for me, a more acceptable way). To do this, you need to know JavaScript and jQuery. By clicking "Add to Cart" you get a link to the current product, then find the field selector from the pop-up window and paste your link there. But you need to take into account that the user can add several products to the cart and, accordingly, the link to each of them must get into the CF7 form.
Useful links:
Catch a click on the element
https://www.w3schools.com/jquery/event_click.asp
or https ://api.jquery.com/on/
Insert link in input field
https://ruseller.com/jquery.php?id=47
3) If you can use the functionality of the shopping cart and are ready to abandon CF7, then try looking for some plugin for offline payment. Then you won't need to add the link of each selected product to the letter, as this issue will be resolved by internal WC tools.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question