我用的是这个代码:
WC()->cart->小计;
来检查顾客要花多少钱,直到她得到免费送货。免费送货金额考虑优惠券代码,所以我需要从WC()->cart->小计中减去任何折扣;在显示总金额之前。有什么想法吗?
我试过这样做:
$current = WC()->cart->subtotal - WC()->cart->discounts;但它什么也没做。
感谢你的帮助!
发布于 2022-07-25 08:26:54
如果要显示总额(小计-折扣),可以这样写:
WC()->cart->total;因此,您可以这样做,例如:
$amount_for_free_shipping= 49;
$cart = round(WC()->cart->total,2);
$remaining = $amount_for_free_shipping - $cart;https://stackoverflow.com/questions/73050692
复制相似问题