Get Total Quantity & Subtotal for Products in Specific Category WooCommerce

$75.00
Quick Demo

This code displays the total quantity of products in 1 or more set categories along with the total subtotal price without adding products in other categories.

The code enables you to :

  • Use a custom function to modify get_cart_total.
  • Use a custom function to modify the cart quantity get_cart_contents_count.
  • Includes child/sub terms.
  • Works with any taxonomy terms.
  • Dynamically update the cart subtotals using ajax without the need to reload any pages.
  • Add the cart content subtotals to your nav menu.

Both the total quantity and total price for products in set categories are updated dynamically on the cart page. This does not affect the subtotal on the cart page or on the checkout page as seen in the demo video.

Display Total Quantity & Price for Products in Specific Category WooCommerce

Video Demo

Shows products from multiple categories added to the cart but only displaying the cart item count and sum of subtotals for products in a specific category or taxonomy term.

Installation

There’s 2 steps :

Step 1 – Swap out your category, tag or other taxonomy term slug on lines 25 and 58 of the plugin.php file.

Step 2 – Install the download folder as a new plugin or copy & paste the PHP code to the end of your child themes functions.php file or custom functionality plugin.