Woocommerce - 结帐时字段为空时更改税级

时间:2016-07-15 13:39:06

标签: php ajax wordpress woocommerce

我在结帐时字段为空时尝试设置Zero Rate类,我尝试使用woocommerce_product_tax_class,但没有任何反应。

function wc_diff_rate_for_user( $tax_class, $product ) {
    $checkout = WC()->checkout();
    $billing_ie = $checkout->get_value( 'billing_ie' );

    if ($billing_ie == '') {
        $tax_class = 'Zero Rate';
    }
    else {
        $tax_class = 'ICMS';
    }
    return $tax_class;
}

你能帮助我吗?

0 个答案:

没有答案
相关问题