我在我的woocommerce网站上提供在线租赁服务我想收取可退还的金额,但是也想显示产品数量,但是当客户去查看购物车时。有产品总数以小计显示我希望产品总金额不包括在内的最终总金额,只包括可退款金额
一般购物车: - $ total = $ subtotal + $ refundable 我需要: - $ total = $ refundable
我该怎么做
答案 0 :(得分:0)
尝试将退款添加为自定义费用。请参阅此example
function woo_add_cart_fee() {
global $woocommerce;
$woocommerce->cart->add_fee( __('Refundable deposit', 'woocommerce'), -3750.00 );
// since its going to be refund we should add fee in negative value.
// You can add the refund as fee in this hook
}
add_action( 'woocommerce_cart_calculate_fees', 'woo_add_cart_fee' );