mirror of
https://github.com/woocommerce/woocommerce-paypal-payments.git
synced 2025-09-01 07:02:48 +08:00
Remove PayPal button in block pages when subscription product is invalid
This commit is contained in:
parent
408503af1a
commit
3b51b49de6
1 changed files with 8 additions and 0 deletions
|
@ -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');
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue