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

iq180
Tourist
6 0 1

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

Replies 2 (2)

wool2022
Visitor
1 0 0

Hi, can you help me implement it? 

motiulbd
Shopify Partner
2 0 0

can you please sahre full code?