Merge pull request #23579 from n-dawson/fix-23578

Fixes #23578 - Check taxes enabled before adding totals row to order
This commit is contained in:
Gerhard Potgieter 2019-05-10 11:21:19 +02:00 committed by GitHub
commit b9a75c474a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 1 deletions

View File

@ -1848,7 +1848,7 @@ abstract class WC_Abstract_Order extends WC_Abstract_Legacy_Order {
*/
protected function add_order_item_totals_tax_rows( &$total_rows, $tax_display ) {
// Tax for tax exclusive prices.
if ( 'excl' === $tax_display ) {
if ( 'excl' === $tax_display && wc_tax_enabled() ) {
if ( 'itemized' === get_option( 'woocommerce_tax_total_display' ) ) {
foreach ( $this->get_tax_totals() as $code => $tax ) {
$total_rows[ sanitize_title( $code ) ] = array(