WooCommerce progressive quantity discount for specific product categories
问题 I was researching a method to give a progressive discount if you have more than 1 product in the cart. I found this thread and actually using this code: //Discount by Qty Product add_action( 'woocommerce_before_calculate_totals', 'quantity_based_pricing', 9999 ); function quantity_based_pricing( $cart ) { global $product; if ( is_admin() && ! defined( 'DOING_AJAX' ) ) return; if ( did_action( 'woocommerce_before_calculate_totals' ) >= 2 ) return; // Define discount rules and thresholds and