D
D
dvakarandasha2018-11-27 15:11:36
JavaScript
dvakarandasha, 2018-11-27 15:11:36

Pass product name from Woocommerce Contact Form 7 category page?

There is a product category page - https://mobilecharger.info/product-category/chargers/
Under each card, a form made on Contact Form 7
How to transfer the product title in this form?
The product button has the following data:

<a class="product-enquiry-click click-link-btn" href="#" data-product="Портативная зарядка для кафе Easy" data-toggle="modal" data-target=".modal-price-quote">Узнать наличие и цену</a>

Using Contact Form Dynamics
[dynamichidden dynamichidden-737 "CF7_get_post_var key='title'"]

Transmits the title of the product if you go to the card itself, but does not transmit from the category page. How to be?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
D
Dmitry Vapelnik, 2015-12-08
@halalala

As far as I remember, if user.find()a promise returns, then it must be returned. That is, it should be something like this:

function findAll() {
  return user.find()
  .then(function(doc) {
    return user.find();  //(1)
                 // Да это глупо,но тут просто для примера так сделано
  });
}

V
Vitaly, 2018-11-27
@ya-vitaliy

$('.click-link-btn').on('click', function(){

    var $this = $(this),
        product = $this.closest('.product'),
        product_title = product.find('.product-title').text();

    $('.modal-body #hidden_title').val('product_title');

});

Of course, I can’t check this code in any way, but I think you will understand the essence.
PS Perhaps this will need to be done not directly, but by modal window callbacks.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question