Remove PayPal button in block pages when subscription product is invalid

This commit is contained in:
Pedro Silva 2024-01-16 16:56:37 +00:00
parent 408503af1a
commit 3b51b49de6
No known key found for this signature in database
GPG key ID: E2EE20C0669D24B3

View file

@ -476,6 +476,14 @@ if(cartHasSubscriptionProducts(config.scriptData)) {
block_enabled = false;
}
// Don't render buttons if in subscription mode and product not associated with a PayPal subscription
if(
isPayPalSubscription(config.scriptData)
&& !config.scriptData.subscription_product_allowed
) {
block_enabled = false;
}
features.push('subscriptions');
}