plugins – Get Woocommerce Variation Price

Question

I need to show the prices in installments, but when I select more variations they will appear in sequence. I need one to appear for each selection.

enter image description here

How do I solve this problem?

this is the code:

 jQuery(document).ready(function() {
        jQuery('.variations_form').on( 'found_variation.id', function( event, variation ) {
            var variationPrice = variation.display_price;
            var qty = 12;
            var installment = (variationPrice / qty).toFixed(2);
            jQuery('.visit').before(`<p class="title is-5 hidden"> Em até ${qty} x sem juros de R$${installment}</p>`);       
        });
     
    });


0
Marcos De Barros Azevedo 1 month 2021-10-27T21:13:40-05:00 0 Answers 0 views 0

Leave an answer

Browse
Browse