tax-rate

Get tax rate separately for every cart and order items in Woocommerce

空扰寡人 提交于 2021-01-24 08:57:47
问题 I'd like to modify the cart display (and later the invoice) so that there is another column showing the tax and tax rate for each product. I have not found a function or a getter for the tax rate as a number, only the name, with $_product->get_tax_class(). I was looking for a function like $_product->get_tax_rate() but found none. So I wrote a terrible workaround in woocommerce/templates/cart/cart.php. After the easy part of adding <th class="product-tax"><?php esc_html_e( 'Tax', 'woocommerce

Get tax rate separately for every cart and order items in Woocommerce

拜拜、爱过 提交于 2021-01-24 08:57:23
问题 I'd like to modify the cart display (and later the invoice) so that there is another column showing the tax and tax rate for each product. I have not found a function or a getter for the tax rate as a number, only the name, with $_product->get_tax_class(). I was looking for a function like $_product->get_tax_rate() but found none. So I wrote a terrible workaround in woocommerce/templates/cart/cart.php. After the easy part of adding <th class="product-tax"><?php esc_html_e( 'Tax', 'woocommerce