Fix SimulateCart to prevent cart race conditions

This commit is contained in:
Pedro Silva 2023-09-28 15:14:19 +01:00
parent e530382a7c
commit fcfbdbe1fa
No known key found for this signature in database
GPG key ID: E2EE20C0669D24B3

View file

@ -159,9 +159,7 @@ class SimulateCartEndpoint extends AbstractCartEndpoint {
$this->remove_cart_items();
// Restore cart and unset cart clone.
if ( null !== $this->real_cart ) {
WC()->cart = $this->real_cart;
}
unset( WC()->cart );
unset( $this->cart );
}