WooCommerce Dynamic Pricing: Product discount to override Category Discount

If you want product discounts to over ride the category discounts, then add the following snippet into your theme’s functions.php file.

When you enter the product bulk discount, you must add ‘0’ in minimum quantity, and ‘*’ in maximum quantity, then the discount information.

add_filter( 'woocommerce_dynamic_pricing_is_cumulative', '__return_false' );
add_filter( 'wc_dynamic_pricing_load_modules', 'custom_sort_dynamic_pricing_modules' );

function custom_sort_dynamic_pricing_modules( $modules ) {
   $module = $modules['simple_membership'];
   unset( $modules['simple_membership'] );
   $sorted = array(
      'simple_membership' => $module
   );
   return array_merge( $sorted, $modules );
}

Leave a Reply

Your email address will not be published. Required fields are marked *