Merge pull request #27985 from woocommerce/set_rate_id_on_recalculate

Update the tax rate meta when recalculating and updating order tax items
This commit is contained in:
Claudio Sanches 2021-03-19 12:40:43 -03:00 committed by GitHub
commit 9398c894c9
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 0 deletions

View File

@ -1633,6 +1633,7 @@ abstract class WC_Abstract_Order extends WC_Abstract_Legacy_Order {
continue;
}
$saved_rate_ids[] = $tax->get_rate_id();
$tax->set_rate( $tax->get_rate_id() );
$tax->set_tax_total( isset( $cart_taxes[ $tax->get_rate_id() ] ) ? $cart_taxes[ $tax->get_rate_id() ] : 0 );
$tax->set_label( WC_Tax::get_rate_label( $tax->get_rate_id() ) );
$tax->set_shipping_tax_total( ! empty( $shipping_taxes[ $tax->get_rate_id() ] ) ? $shipping_taxes[ $tax->get_rate_id() ] : 0 );