mirror of
https://github.com/woocommerce/woocommerce-paypal-payments.git
synced 2025-09-06 18:16:38 +08:00
change enable button on page functionality too meet the requirements of default behavior
This commit is contained in:
parent
f6a3746d1a
commit
3bd887aaa1
1 changed files with 11 additions and 6 deletions
|
@ -75,10 +75,12 @@ class SmartButton implements SmartButtonInterface
|
||||||
esc_html__('Pay with Card', 'woocommerce-paypal-commerce-gateway')
|
esc_html__('Pay with Card', 'woocommerce-paypal-commerce-gateway')
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
$notEnabledOnCart = $this->settings->has('button_cart_enabled') &&
|
||||||
|
!wc_string_to_bool($this->settings->get('button_cart_enabled'));
|
||||||
if (
|
if (
|
||||||
is_cart()
|
is_cart()
|
||||||
&& $this->settings->has('button_cart_enabled')
|
&& !$notEnabledOnCart
|
||||||
&& wc_string_to_bool($this->settings->get('button_cart_enabled'))
|
|
||||||
) {
|
) {
|
||||||
add_action(
|
add_action(
|
||||||
'woocommerce_proceed_to_checkout',
|
'woocommerce_proceed_to_checkout',
|
||||||
|
@ -97,10 +99,12 @@ class SmartButton implements SmartButtonInterface
|
||||||
20
|
20
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
$notEnabledOnProductPage = $this->settings->has('button_single_product_enabled') &&
|
||||||
|
!wc_string_to_bool($this->settings->get('button_single_product_enabled'));
|
||||||
if (
|
if (
|
||||||
is_product()
|
is_product()
|
||||||
&& $this->settings->has('button_single_product_enabled')
|
&& !$notEnabledOnProductPage
|
||||||
&& wc_string_to_bool($this->settings->get('button_single_product_enabled'))
|
|
||||||
) {
|
) {
|
||||||
add_action(
|
add_action(
|
||||||
'woocommerce_single_product_summary',
|
'woocommerce_single_product_summary',
|
||||||
|
@ -119,9 +123,10 @@ class SmartButton implements SmartButtonInterface
|
||||||
31
|
31
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
$notEnabledOnMiniCart = $this->settings->has('button_mini_cart_enabled') &&
|
||||||
|
!wc_string_to_bool($this->settings->get('button_mini_cart_enabled'));
|
||||||
if (
|
if (
|
||||||
$this->settings->has('button_mini_cart_enabled')
|
! $notEnabledOnMiniCart
|
||||||
&& wc_string_to_bool($this->settings->get('button_mini_cart_enabled'))
|
|
||||||
) {
|
) {
|
||||||
add_action(
|
add_action(
|
||||||
'woocommerce_widget_shopping_cart_after_buttons',
|
'woocommerce_widget_shopping_cart_after_buttons',
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue