Variant Save Price and Percentage not changing on Product Page

Variant Save Price and Percentage not changing on Product Page

This issue can be fixed by changing code from in product-template.liquid

change this: <span class="save-price">SAVE {{ saved_amount }}</span>
to : <span id="save_price" class="save-price">SAVE {{ saved_amount }}</span>

and adding the following code after the line
 var shop_curr = '{{shop.money_format}}';
in product-template.liquid
  1.  {% if wc_sale_type == 'percentage' %}
          var save_perc = ((variant.compare_at_price - variant.price)/variant.compare_at_price)*100;
          var save_percn = save_perc.toFixed(0); 
          jQuery('#save_price').html('SAVE '+ save_percn + '%');
         {% else %}
          var save_amnt = (variant.compare_at_price - variant.price)/100;
          var save_amntn = save_amnt.toFixed(2); 
          jQuery('#save_price').html('SAVE '+ (Shopify.formatMoney(save_amntn, shop_curr)));
          {% endif %}