Fix subscription validations

This commit is contained in:
Pedro Silva 2024-01-30 18:22:53 +00:00
parent 6c0e0a96dc
commit ebcc2ba3f9
No known key found for this signature in database
GPG key ID: E2EE20C0669D24B3
2 changed files with 16 additions and 2 deletions

View file

@ -477,6 +477,14 @@ if(cartHasSubscriptionProducts(config.scriptData)) {
block_enabled = false;
}
// Don't render if vaulting disabled and is in vault subscription mode
if(
! isPayPalSubscription(config.scriptData)
&& ! config.scriptData.can_save_vault_token
) {
block_enabled = false;
}
// Don't render buttons if in subscription mode and product not associated with a PayPal subscription
if(
isPayPalSubscription(config.scriptData)