Answer the question
In order to leave comments, you need to log in
How to get the price and name of a product variation?
The variable product card has a link with attributes data-variation-title
anddata-variation-price
<a class="btn" data-variation-title="" data-variation-price="" href="#">Заказать</a>
data-variation-title
How can I transfer the values ​​(name and data-variation-price
price) of the selected product variation to
this link in attributes ?
Answer the question
In order to leave comments, you need to log in
If I understand correctly, then this should be done on the product page when selecting all the attributes of the variations, then the selected variation can be obtained like this:
$( '.variations_form' ).each( function() {
$(this).on( 'found_variation', function( event, variation ) {
console.log(variation);
});
});
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question