mirror of
https://github.com/woocommerce/woocommerce-paypal-payments.git
synced 2025-09-05 08:59:14 +08:00
make dccIsEnabled context aware
This commit is contained in:
parent
7c5918eba3
commit
40b3e12057
1 changed files with 6 additions and 6 deletions
|
@ -484,13 +484,13 @@ class SmartButton implements SmartButtonInterface
|
|||
return false;
|
||||
}
|
||||
$keys = [
|
||||
'dcc_cart_enabled',
|
||||
'dcc_mini_cart_enabled',
|
||||
'dcc_checkout_enabled',
|
||||
'dcc_single_product_enabled',
|
||||
'dcc_cart_enabled' => 'is_cart',
|
||||
'dcc_mini_cart_enabled' => '__return_true',
|
||||
'dcc_checkout_enabled' => 'is_checkout',
|
||||
'dcc_single_product_enabled' => 'is_product',
|
||||
];
|
||||
foreach ($keys as $key) {
|
||||
if ($this->settings->has($key) && $this->settings->get($key)) {
|
||||
foreach ($keys as $key => $callback) {
|
||||
if ($this->settings->has($key) && $this->settings->get($key) && $callback()) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue