diff --git a/includes/class-wc-cart.php b/includes/class-wc-cart.php index 41be737f665..bd4cbd14051 100644 --- a/includes/class-wc-cart.php +++ b/includes/class-wc-cart.php @@ -333,7 +333,6 @@ class WC_Cart extends WC_Legacy_Cart { */ public function get_cart_contents_taxes() { return apply_filters( 'woocommerce_cart_' . __FUNCTION__, $this->get_totals_var( 'cart_contents_taxes' ) ); - } /** diff --git a/includes/class-wc-checkout.php b/includes/class-wc-checkout.php index 8db90a15996..5d2e26c3415 100644 --- a/includes/class-wc-checkout.php +++ b/includes/class-wc-checkout.php @@ -469,7 +469,7 @@ class WC_Checkout { * @param WC_Cart $cart */ public function create_order_tax_lines( &$order, $cart ) { - foreach ( array_keys( $cart->taxes + $cart->shipping_taxes ) as $tax_rate_id ) { + foreach ( array_keys( $cart->get_cart_contents_taxes() + $cart->get_shipping_taxes() ) as $tax_rate_id ) { if ( $tax_rate_id && apply_filters( 'woocommerce_cart_remove_taxes_zero_rate_id', 'zero-rated' ) !== $tax_rate_id ) { $item = new WC_Order_Item_Tax(); $item->set_props( array(