Merge pull request #1915 from woocommerce/PCP-2472-google-pay-and-apple-pay-buttons-disappear-when-adding-a-product-to-the-cart-on-the-shop-page

GooglePay and ApplePay buttons disappear from the minicart when adding a product to the cart on the shop page (PCP-2472)
This commit is contained in:
Emili Castells 2024-01-05 12:08:17 +01:00 committed by GitHub
commit e465bfb900
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 18 additions and 0 deletions

View file

@ -21,6 +21,15 @@ import ApplepayManager from "./ApplepayManager";
}
});
// Use set timeout as it's unnecessary to refresh upon Minicart initial render.
setTimeout(() => {
jQuery(document.body).on('wc_fragments_loaded wc_fragments_refreshed', () => {
if (manager) {
manager.reinit();
}
});
}, 1000);
document.addEventListener(
'DOMContentLoaded',
() => {

View file

@ -21,6 +21,15 @@ import GooglepayManager from "./GooglepayManager";
}
});
// Use set timeout as it's unnecessary to refresh upon Minicart initial render.
setTimeout(() => {
jQuery(document.body).on('wc_fragments_loaded wc_fragments_refreshed', () => {
if (manager) {
manager.reinit();
}
});
}, 1000);
document.addEventListener(
'DOMContentLoaded',
() => {