diff --git a/plugins/woocommerce-blocks/src/StoreApi/Schemas/V1/CartSchema.php b/plugins/woocommerce-blocks/src/StoreApi/Schemas/V1/CartSchema.php index 3fbcdf479dd..8714f684782 100644 --- a/plugins/woocommerce-blocks/src/StoreApi/Schemas/V1/CartSchema.php +++ b/plugins/woocommerce-blocks/src/StoreApi/Schemas/V1/CartSchema.php @@ -387,8 +387,13 @@ class CartSchema extends AbstractSchema { * @return array */ protected function get_tax_lines( $cart ) { + $tax_lines = []; + + if ( 'itemized' !== get_option( 'woocommerce_tax_total_display' ) ) { + return $tax_lines; + } + $cart_tax_totals = $cart->get_tax_totals(); - $tax_lines = []; foreach ( $cart_tax_totals as $cart_tax_total ) { $tax_lines[] = array(