This solution works perfectly, instead of using set_is_vat_exempt() I simply used $tax)class = 'Zero Rate':add_filter( 'woocommerce_before_cart_contents', 'wc_diff_rate_for_user', 1, 2 );add_filter( 'woocommerce_before_shipping_calculator', 'wc_diff_rate_for_user', 1, 2);add_filter( 'woocommerce_before_checkout_billing_form', 'wc_diff_rate_for_user', 1, 2 );add_filter( 'woocommerce_product_tax_class', 'wc_diff_rate_for_user', 1, 2 );function wc_diff_rate_for_user( $tax_class ) { if ( !is_user_logged_in() || current_user_can( 'customer' ) ) { $tax_class = 'Zero Rate'; } return $tax_class;} 这篇关于woocommerce/购物车页面中的基于角色的税收的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持! 09-18 12:52