Check tax display type before returning the tax lines (https://github.com/woocommerce/woocommerce-blocks/pull/7084)
* Check tax display type before returning the tax lines * Return early if not itemized
This commit is contained in:
parent
c2c639dee1
commit
04743add72
|
@ -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(
|
||||
|
|
Loading…
Reference in New Issue