mirror of
https://github.com/woocommerce/woocommerce-paypal-payments.git
synced 2025-09-05 08:59:14 +08:00
Do not display buttons in minicart if subscription in the cart and vaulting disabled
This commit is contained in:
parent
b7a0b05e64
commit
21013adbca
3 changed files with 9 additions and 6 deletions
|
@ -22,9 +22,12 @@ class MiniCartBootstap {
|
|||
}
|
||||
|
||||
shouldRender() {
|
||||
return document.querySelector(this.gateway.button.mini_cart_wrapper) !==
|
||||
null || document.querySelector(this.gateway.hosted_fields.mini_cart_wrapper) !==
|
||||
null;
|
||||
if (!this.gateway.can_save_vault_token) {
|
||||
return;
|
||||
}
|
||||
|
||||
return document.querySelector(this.gateway.button.mini_cart_wrapper) !== null
|
||||
|| document.querySelector(this.gateway.hosted_fields.mini_cart_wrapper) !== null;
|
||||
}
|
||||
|
||||
render() {
|
||||
|
@ -40,4 +43,4 @@ class MiniCartBootstap {
|
|||
}
|
||||
}
|
||||
|
||||
export default MiniCartBootstap;
|
||||
export default MiniCartBootstap;
|
||||
|
|
|
@ -181,7 +181,7 @@ class CreditCardRenderer {
|
|||
this.errorHandler.clear();
|
||||
|
||||
if (this.formValid && this.cardValid) {
|
||||
const save_card = this.defaultConfig.save_card ? true : false;
|
||||
const save_card = this.defaultConfig.can_save_vault_token ? true : false;
|
||||
let vault = document.getElementById('ppcp-credit-card-vault') ?
|
||||
document.getElementById('ppcp-credit-card-vault').checked : save_card;
|
||||
if (this.defaultConfig.enforce_vault) {
|
||||
|
|
|
@ -686,7 +686,7 @@ class SmartButton implements SmartButtonInterface {
|
|||
),
|
||||
),
|
||||
'enforce_vault' => $this->has_subscriptions(),
|
||||
'save_card' => $this->can_save_vault_token(),
|
||||
'can_save_vault_token' => $this->can_save_vault_token(),
|
||||
'bn_codes' => $this->bn_codes(),
|
||||
'payer' => $this->payerData(),
|
||||
'button' => array(
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue