Fix: Wait for the product to be added to cart before redirecting customer to the cart page (https://github.com/woocommerce/woocommerce-blocks/pull/6466)
This commit is contained in:
parent
4976afad58
commit
0b51900bd2
|
@ -142,8 +142,8 @@ const AddToCartButton = ( {
|
|||
} );
|
||||
};
|
||||
} else {
|
||||
buttonProps.onClick = () => {
|
||||
addToCart();
|
||||
buttonProps.onClick = async () => {
|
||||
await addToCart();
|
||||
dispatchStoreEvent( 'cart-add-item', {
|
||||
product,
|
||||
} );
|
||||
|
|
Loading…
Reference in New Issue