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:
commit
9398c894c9
|
@ -1633,6 +1633,7 @@ abstract class WC_Abstract_Order extends WC_Abstract_Legacy_Order {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
$saved_rate_ids[] = $tax->get_rate_id();
|
$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_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_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 );
|
$tax->set_shipping_tax_total( ! empty( $shipping_taxes[ $tax->get_rate_id() ] ) ? $shipping_taxes[ $tax->get_rate_id() ] : 0 );
|
||||||
|
|
Loading…
Reference in New Issue