0
在WooCommerce中,我想在不使用優惠券的情況下打折,折扣計算將基於產品價格,例如「以3件產品的價格爲2件。購物車add_fee()在結賬頁面不起作用
在function.php
我的活動主題的,我使用此代碼:
function promo() {
if (is_cart()) {
$woocommerce->cart->add_fee(__('des', 'woocommerce'), -50.00`enter code here`, true, '');
}
}
add_action ('woocommerce_cart_calculate_fees', 'promo');
我的問題:如果我在複習順序打折迫使這個代碼不結賬頁面上工作
。出現了,但總價值沒有變化,我認爲它沒有節省費用。
我該如何使其工作(在結帳頁面上)?
感謝