问题 I have a custom field in checkout that adds a price to cart. $woocommerce->cart->add_fee($price_info['label'], $fee, $taxable, $tax_class); Everything works fine. But how do i make it non taxable ? 回答1: To make a fee non taxable you need to set the 3rd argument to false, so your code will be: WC()->cart->add_fee( $price_info['label'], $fee ); The default value for the 3rd argument is false , so no taxable. See its source code: /** * Add additional fee to the cart. * * @uses WC_Cart_Fees::add