Show subtotal on the Product page and changes as user adjust quantity in selector

iq180
New Member
6 0 0

Hi all

I am using the supply theme and trying to find out how to show sub total on the Product page and changes as user adjust quantity in selector.

Will anyone have done that? Or knows how to do it?

 

I found some jquery code but don't know how to apply

<script>
  $('.qty').change(function() {
    var qty = $('.qty').val();
    var price = $('.price').text();
    var newPrice = price.replace(/[^0-9\.]/g, '');
    var subtotal = (qty * newPrice);
    $('.subtotal').text(subtotal);
  }); 
</script>

 

Here is my page.

https://easygoing888.myshopify.com/

Thanks in advance

Jack

0 Likes