Fix block cart continuation

This commit is contained in:
Alex P 2023-04-17 17:15:37 +03:00
parent 6049f8b396
commit 0d8f86eefa
No known key found for this signature in database
GPG key ID: 54487A734A204D71
2 changed files with 19 additions and 1 deletions

View file

@ -108,7 +108,12 @@ const PayPalComponent = ({
shipping_address: shippingAddress,
});
location.href = config.scriptData.redirect;
const checkoutUrl = new URL(config.scriptData.redirect);
// sometimes some browsers may load some kind of cached version of the page,
// so adding a parameter to avoid that
checkoutUrl.searchParams.append('ppcp-continuation-redirect', (new Date()).getTime().toString());
location.href = checkoutUrl.toString();
} catch (err) {
console.error(err);