Fix the script loading check.

This commit is contained in:
Narek Zakarian 2022-07-28 15:51:00 +04:00
parent de21866712
commit a1454dbfd7

View file

@ -1092,9 +1092,10 @@ class SmartButton implements SmartButtonInterface {
} }
if ( if (
$this->context() === 'product' $this->context() === 'product'
&& ( $this->settings->has( 'button_product_enabled' ) && (
&& $this->settings->get( 'button_product_enabled' ) ( $this->settings->has( 'button_product_enabled' ) && $this->settings->get( 'button_product_enabled' ) ) ||
|| $this->settings->has( 'message_product_enabled' ) ) ( $this->settings->has( 'message_product_enabled' ) && $this->settings->get( 'message_product_enabled' ) )
)
) { ) {
$load_buttons = true; $load_buttons = true;
} }
@ -1104,14 +1105,17 @@ class SmartButton implements SmartButtonInterface {
) { ) {
$load_buttons = true; $load_buttons = true;
} }
if ( if (
$this->context() === 'cart' $this->context() === 'cart'
&& ( $this->settings->has( 'button_cart_enabled' ) && (
&& $this->settings->get( 'button_cart_enabled' ) ( $this->settings->has( 'button_cart_enabled' ) && $this->settings->get( 'button_cart_enabled' ) ) ||
|| $this->settings->has( 'message_product_enabled' ) ) ( $this->settings->has( 'message_cart_enabled' ) && $this->settings->get( 'message_cart_enabled' ) )
)
) { ) {
$load_buttons = true; $load_buttons = true;
} }
if ( $this->context() === 'pay-now' ) { if ( $this->context() === 'pay-now' ) {
$load_buttons = true; $load_buttons = true;
} }