mirror of
https://github.com/woocommerce/woocommerce-paypal-payments.git
synced 2025-09-04 08:47:23 +08:00
render message on checkout only when paypal payment method is selected
This commit is contained in:
parent
05be224b65
commit
51d89a8d4a
2 changed files with 4 additions and 2 deletions
|
@ -51,7 +51,9 @@ const bootstrap = () => {
|
||||||
checkoutBootstap.init();
|
checkoutBootstap.init();
|
||||||
}
|
}
|
||||||
|
|
||||||
messageRenderer.render();
|
if (context !== 'checkout') {
|
||||||
|
messageRenderer.render();
|
||||||
|
}
|
||||||
};
|
};
|
||||||
document.addEventListener(
|
document.addEventListener(
|
||||||
'DOMContentLoaded',
|
'DOMContentLoaded',
|
||||||
|
|
|
@ -45,7 +45,6 @@ class CheckoutBootstap {
|
||||||
this.gateway.hosted_fields.wrapper,
|
this.gateway.hosted_fields.wrapper,
|
||||||
actionHandler.configuration(),
|
actionHandler.configuration(),
|
||||||
);
|
);
|
||||||
this.messages.render();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
switchBetweenPayPalandOrderButton() {
|
switchBetweenPayPalandOrderButton() {
|
||||||
|
@ -63,6 +62,7 @@ class CheckoutBootstap {
|
||||||
if (currentPaymentMethod === 'ppcp-gateway') {
|
if (currentPaymentMethod === 'ppcp-gateway') {
|
||||||
this.renderer.showButtons(this.gateway.button.wrapper);
|
this.renderer.showButtons(this.gateway.button.wrapper);
|
||||||
this.renderer.showButtons(this.gateway.messages.wrapper);
|
this.renderer.showButtons(this.gateway.messages.wrapper);
|
||||||
|
this.messages.render();
|
||||||
this.renderer.hideButtons(this.gateway.hosted_fields.wrapper);
|
this.renderer.hideButtons(this.gateway.hosted_fields.wrapper);
|
||||||
}
|
}
|
||||||
if (currentPaymentMethod === 'ppcp-credit-card-gateway') {
|
if (currentPaymentMethod === 'ppcp-credit-card-gateway') {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue