うったて
業務パック割引って同じ商品を2個以上とか、しかもパーセンテージで割引するの使いにくいよね。ってことで、買った商品点数で割引を出すほうがいいやという話です。コードには無駄があるかもしれませんが、一応概念の共有ということでお許し下さい。
やり方
functions.php
add_filter('usces_order_discount', 'item_count_order_discount', 10, 3);
function item_count_order_discount($discount, $carts, $entries){
global $usces;
$total = $usces->get_total_quantity( $cart );
if ( ($total >= 2) && ($total <= 3) ) {
$discount = -5000;
}
if ( ($total >= 3) && ($total <= 4) ) {
$discount = -7500;
}
return $discount;
}