From 173846401264c11836efe3ebacc9750e5c371914 Mon Sep 17 00:00:00 2001 From: Mike Jolley Date: Wed, 26 Apr 2017 12:17:34 +0100 Subject: [PATCH] Correctly migrate legacy shipping taxes data Fixes #14674 --- includes/class-wc-order-item-shipping.php | 3 +++ 1 file changed, 3 insertions(+) diff --git a/includes/class-wc-order-item-shipping.php b/includes/class-wc-order-item-shipping.php index 813a17a66b6..9fc6108f149 100644 --- a/includes/class-wc-order-item-shipping.php +++ b/includes/class-wc-order-item-shipping.php @@ -99,6 +99,9 @@ class WC_Order_Item_Shipping extends WC_Order_Item { ); if ( ! empty( $raw_tax_data['total'] ) ) { $tax_data['total'] = array_map( 'wc_format_decimal', $raw_tax_data['total'] ); + } elseif ( ! empty( $raw_tax_data ) && is_array( $raw_tax_data ) ) { + // Older versions just used an array. + $tax_data['total'] = array_map( 'wc_format_decimal', $raw_tax_data ); } $this->set_prop( 'taxes', $tax_data ); $this->set_total_tax( array_sum( $tax_data['total'] ) );