0
我想購物車的折扣基於 超過600美元訂單的5%和10%超過1000美元? 我可以讓它工作超過600美元,但不是超過1000美元。我上線15WooCommerce - 多個購物車dlicounts
add_action('woocommerce_before_cart', 'apply_matched_coupons');
function apply_matched_coupons() {
global $woocommerce;
$coupon_code = 'over600'; // your coupon code here
$coupon_codeb = 'over1000'; // your coupon code here
if ($woocommerce->cart->has_discount($coupon_code)) return;
if ($woocommerce->cart->cart_contents_total >= 600) {
$woocommerce->cart->add_discount($coupon_code);
$woocommerce->show_messages();
}
if ($woocommerce->cart->cart_contents_total >= 1000) {
$woocommerce->cart->add_discount($coupon_codeb);
$woocommerce->show_messages();
}
}
歡迎StackOverflow的@dhcrain!請包括您所看到的錯誤消息的全文。 – eebbesen
什麼是錯誤?我們該如何知道15號線在哪裏? – helgatheviking