Skip to content
Advertisement

Display product total and cart subtotal on quantity change in WooCommerce product page

The idea is simple. On the WooCommerce product page, as the customer changes quantity, display the product total (increase or decrease in price) price and the cart subtotal.

I’m stuck right now. I get no errors even with debug turned on. Nothing shows on the product page.

JavaScript

Advertisement

Answer

There are some mistakes in your code, try the following that will display dynamically:

  • The product total amount from product price multiplied by the selected quantity
  • The sum of the Cart subtotal and the product total amount.

The code based on yours:

JavaScript

Code goes in functions.php file of your active child theme (or active theme). Tested and works.

User contributions licensed under: CC BY-SA
7 People found this is helpful
Advertisement