WooCommerce: Custom cart item counts by product category
问题 I found this script that allows me to show cart content total above the shopping cart icon within WooCommerce: <a class="cart-contents" href="<?php echo WC()->cart->get_cart_url(); ?>" title="<?php _e( 'View your shopping cart' ); ?>"><?php echo sprintf (_n( '%d item', '%d items', WC()->cart->get_cart_contents_count() ), WC()->cart->get_cart_contents_count() ); ?> - <?php echo WC()->cart->get_cart_total(); ?></a> If there are 100 items in my cart it shows 100. What I really want is to display