Simplify message wrapper rendering and add shop, home locations

This commit is contained in:
Alex P 2023-10-16 21:41:17 +03:00
parent 0062f20c7a
commit 7da5d8d68a
No known key found for this signature in database
GPG key ID: 54487A734A204D71
6 changed files with 328 additions and 45 deletions

View file

@ -156,8 +156,15 @@ class CheckoutBootstap {
}
shouldShowMessages() {
return getCurrentPaymentMethod() === PaymentMethods.PAYPAL
&& !PayPalCommerceGateway.is_free_trial_cart;
// hide when another method selected only if messages are near buttons
const messagesWrapper = document.querySelector(this.gateway.messages.wrapper);
if (getCurrentPaymentMethod() !== PaymentMethods.PAYPAL &&
messagesWrapper && jQuery(messagesWrapper).closest('.ppc-button-wrapper').length
) {
return false;
}
return !PayPalCommerceGateway.is_free_trial_cart;
}
disableCreditCardFields() {