Merge pull request #14716 from woocommerce/fix/14674

Correctly migrate legacy shipping taxes data
This commit is contained in:
Mike Jolley 2017-04-26 16:58:19 +01:00 committed by GitHub
commit ac0984f4e2
1 changed files with 3 additions and 0 deletions

View File

@ -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'] ) );