mirror of
https://github.com/woocommerce/woocommerce-paypal-payments.git
synced 2025-09-06 18:16:38 +08:00
Disable buttons in cart and checkout pages when no subscription plan exists
This commit is contained in:
parent
c636192e98
commit
c13ac3ab73
2 changed files with 12 additions and 0 deletions
|
@ -77,6 +77,12 @@ class CartBootstrap {
|
|||
&& PayPalCommerceGateway.data_client_id.paypal_subscriptions_enabled
|
||||
) {
|
||||
this.renderer.render(actionHandler.subscriptionsConfiguration());
|
||||
|
||||
if(!PayPalCommerceGateway.subscription_plan_id) {
|
||||
this.gateway.button.is_disabled = true;
|
||||
this.handleButtonStatus();
|
||||
}
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
|
@ -107,6 +107,12 @@ class CheckoutBootstap {
|
|||
&& PayPalCommerceGateway.data_client_id.paypal_subscriptions_enabled
|
||||
) {
|
||||
this.renderer.render(actionHandler.subscriptionsConfiguration(), {}, actionHandler.configuration());
|
||||
|
||||
if(!PayPalCommerceGateway.subscription_plan_id) {
|
||||
this.gateway.button.is_disabled = true;
|
||||
this.handleButtonStatus();
|
||||
}
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue