/// Custome Total Pirce Rule function custom_calculated_total( $total, $cart ){ if ( is_admin() && ! defined( 'DOING_AJAX' ) ) return; $coupons_50_price = array('sha001', 'sha002', 'sha003', 'sha004', 'sha005'); // Add add full list here $coupons_100_price = array('sha301', 'sha302', 'sha303', 'sha304', 'sha305'); // Add add full list here $coupons_200_price = array('sha601', 'sha602', 'sha603', 'sha604', 'sha605'); // Add add full list here $applied_coupons = WC()->cart->get_applied_coupons(); if($applied_coupons) { if(in_array($applied_coupons[0] , $coupons_50_price)) { if( $total >= 50 && $total <= 100 ){ return 50; } } if(in_array($applied_coupons[0] , $coupons_100_price)) { if( $total >= 100 && $total <= 200 ){ return 100; } } if(in_array($applied_coupons[0] , $coupons_200_price)) { if( $total >= 200 && $total <= 300 ){ return 200; } } } else { return $total; } } add_filter( 'woocommerce_calculated_total', 'custom_calculated_total', 30, 2 );