I need to display the total price on the product page when the quantity changes.
This is the same as the price of the line in the basket if you add the quantity of goods to the basket.
I'm still new to WooCommerce, so I'm not sure where to start. But if someone can help me in the right direction, I think I can handle it on my own.
So, here are my thoughts on how to do this.
I think my jquery will be like that.
jQuery(document).ready(function($){
$('.qty').on('change',function(){
var price = $('[itemprop="price"]').attr('content');
var total_price = price * this.value;
console.log(price, this.value, total_price);
});
})
this works when pasted to the console. But I'm not sure where to put this code on WooCommerce.

source
share