render message on checkout only when paypal payment method is selected

This commit is contained in:
David Remer 2020-08-19 11:50:02 +03:00
parent 05be224b65
commit 51d89a8d4a
2 changed files with 4 additions and 2 deletions

View file

@ -51,7 +51,9 @@ const bootstrap = () => {
checkoutBootstap.init();
}
messageRenderer.render();
if (context !== 'checkout') {
messageRenderer.render();
}
};
document.addEventListener(
'DOMContentLoaded',

View file

@ -45,7 +45,6 @@ class CheckoutBootstap {
this.gateway.hosted_fields.wrapper,
actionHandler.configuration(),
);
this.messages.render();
}
switchBetweenPayPalandOrderButton() {
@ -63,6 +62,7 @@ class CheckoutBootstap {
if (currentPaymentMethod === 'ppcp-gateway') {
this.renderer.showButtons(this.gateway.button.wrapper);
this.renderer.showButtons(this.gateway.messages.wrapper);
this.messages.render();
this.renderer.hideButtons(this.gateway.hosted_fields.wrapper);
}
if (currentPaymentMethod === 'ppcp-credit-card-gateway') {