Fix update shipping option in block pages.

This commit is contained in:
Pedro Silva 2024-04-04 18:11:59 +01:00
parent 2ffb580ef1
commit 4a5b1fbc90
No known key found for this signature in database
GPG key ID: E2EE20C0669D24B3

View file

@ -299,6 +299,7 @@ const PayPalComponent = ({
try {
const shippingOptionId = data.selectedShippingOption?.id;
if (shippingOptionId) {
await wp.data.dispatch('wc/store/cart').selectShippingRate(shippingOptionId);
await shippingData.setSelectedRates(shippingOptionId);
}
@ -358,6 +359,7 @@ const PayPalComponent = ({
try {
const shippingOptionId = data.selectedShippingOption?.id;
if (shippingOptionId) {
await wp.data.dispatch('wc/store/cart').selectShippingRate(shippingOptionId);
await shippingData.setSelectedRates(shippingOptionId);
}
} catch (e) {