mirror of
https://github.com/woocommerce/woocommerce-paypal-payments.git
synced 2025-09-05 08:59:14 +08:00
Fix in the Single Product load SingleProductBootstap when we have Messages even if buttons are not present
This commit is contained in:
parent
02de8ada7f
commit
89288603c3
2 changed files with 17 additions and 1 deletions
|
@ -148,7 +148,13 @@ const bootstrap = () => {
|
|||
miniCartBootstrap.init();
|
||||
}
|
||||
|
||||
if (context === 'product' && PayPalCommerceGateway.single_product_buttons_enabled === '1') {
|
||||
if (
|
||||
context === 'product'
|
||||
&& (
|
||||
PayPalCommerceGateway.single_product_buttons_enabled === '1'
|
||||
|| hasMessages()
|
||||
)
|
||||
) {
|
||||
const singleProductBootstrap = new SingleProductBootstap(
|
||||
PayPalCommerceGateway,
|
||||
renderer,
|
||||
|
@ -194,6 +200,12 @@ const bootstrap = () => {
|
|||
}
|
||||
|
||||
};
|
||||
|
||||
const hasMessages = () => {
|
||||
return PayPalCommerceGateway.messages.is_hidden === false
|
||||
&& document.querySelector(PayPalCommerceGateway.messages.wrapper);
|
||||
}
|
||||
|
||||
document.addEventListener(
|
||||
'DOMContentLoaded',
|
||||
() => {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue