mirror of
https://github.com/woocommerce/woocommerce-paypal-payments.git
synced 2025-09-05 08:59:14 +08:00
do not enqueue script when button is disabled and we are not on checkout
This commit is contained in:
parent
234440416c
commit
c16bf2594e
1 changed files with 4 additions and 0 deletions
|
@ -203,6 +203,10 @@ class SmartButton implements SmartButtonInterface
|
|||
|
||||
public function enqueue(): bool
|
||||
{
|
||||
$buttonsEnabled = $this->settings->has('enabled') && $this->settings->get('enabled');
|
||||
if (! is_checkout() && !$buttonsEnabled) {
|
||||
return false;
|
||||
}
|
||||
if (! $this->canSaveVaultToken() && $this->hasSubscription()) {
|
||||
return false;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue