There is a snippet for wp woocommerce:

<script> jQuery(document).ready(function($) { $('select').blur( function(){ if( '' != $('input.variation_id').val() ){ $('p.price').html($('div.woocommerce-variation-price > span.price').html()).append('<p class="availability">'+$('div.woocommerce-variation-availability').html()+'</p>'); console.log($('input.variation_id').val()); } else { $('p.price').html($('div.hidden-variable-price').html()); if($('p.availability')) $('p.availability').remove(); console.log('NULL'); } }); }); </script> 

It is necessary that the result was console.log - 10% How to do this? You can tell, otherwise I don’t understand anything in jQuery.

  • one
    Uh? Recall school math and percent determination? - Alexey Ten
  • Yes, I need a clear novice * 0.9 I ask how to write the code correctly in jQuery. How to this $('p.price').html($('div.woocommerce-variation-price > span.price').html()).append('<p class="availability">'+$('div.woocommerce-variation-availability').html()+'</p>'); add this * 0.9 ???? - Svetlana Zaitseva
  • What does * 0.9 mean? Did you type get your 10%? - eugene_v 6:07 pm
  • Yes, the usual example for php $price = 100; $price_got = $price * 0.9; echo $price_got; Ответ: 90; $price = 100; $price_got = $price * 0.9; echo $price_got; Ответ: 90; How to do it on jQuery in the above code? - Svetlana Zaitseva

0