mirror of
https://github.com/woocommerce/woocommerce-paypal-payments.git
synced 2025-09-05 08:59:14 +08:00
Merge pull request #2372 from woocommerce/PCP-3250-apple-pay-and-google-pay-buttons-dont-appear-in-pay-pal-button-stack-on-multi-step-checkout
Apple Pay and Google Pay buttons don't appear in PayPal Button stack on multi-step Checkout (3250)
This commit is contained in:
commit
6785ca9b06
5 changed files with 164 additions and 20 deletions
|
@ -1,6 +1,7 @@
|
|||
import {loadCustomScript} from "@paypal/paypal-js";
|
||||
import {loadPaypalScript} from "../../../ppcp-button/resources/js/modules/Helper/ScriptLoading";
|
||||
import GooglepayManager from "./GooglepayManager";
|
||||
import {setupButtonEvents} from '../../../ppcp-button/resources/js/modules/Helper/ButtonRefreshHelper';
|
||||
|
||||
(function ({
|
||||
buttonConfig,
|
||||
|
@ -15,21 +16,12 @@ import GooglepayManager from "./GooglepayManager";
|
|||
manager.init();
|
||||
};
|
||||
|
||||
jQuery(document.body).on('updated_cart_totals updated_checkout', () => {
|
||||
setupButtonEvents(function() {
|
||||
if (manager) {
|
||||
manager.reinit();
|
||||
}
|
||||
});
|
||||
|
||||
// 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',
|
||||
() => {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue