Merge pull request #14716 from woocommerce/fix/14674
Correctly migrate legacy shipping taxes data
This commit is contained in:
commit
ac0984f4e2
|
@ -99,6 +99,9 @@ class WC_Order_Item_Shipping extends WC_Order_Item {
|
||||||
);
|
);
|
||||||
if ( ! empty( $raw_tax_data['total'] ) ) {
|
if ( ! empty( $raw_tax_data['total'] ) ) {
|
||||||
$tax_data['total'] = array_map( 'wc_format_decimal', $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_prop( 'taxes', $tax_data );
|
||||||
$this->set_total_tax( array_sum( $tax_data['total'] ) );
|
$this->set_total_tax( array_sum( $tax_data['total'] ) );
|
||||||
|
|
Loading…
Reference in New Issue