Disable buttons in cart and checkout pages when no subscription plan exists

This commit is contained in:
Emili Castells Guasch 2023-07-20 14:29:37 +02:00
parent c636192e98
commit c13ac3ab73
2 changed files with 12 additions and 0 deletions

View file

@ -77,6 +77,12 @@ class CartBootstrap {
&& PayPalCommerceGateway.data_client_id.paypal_subscriptions_enabled && PayPalCommerceGateway.data_client_id.paypal_subscriptions_enabled
) { ) {
this.renderer.render(actionHandler.subscriptionsConfiguration()); this.renderer.render(actionHandler.subscriptionsConfiguration());
if(!PayPalCommerceGateway.subscription_plan_id) {
this.gateway.button.is_disabled = true;
this.handleButtonStatus();
}
return; return;
} }

View file

@ -107,6 +107,12 @@ class CheckoutBootstap {
&& PayPalCommerceGateway.data_client_id.paypal_subscriptions_enabled && PayPalCommerceGateway.data_client_id.paypal_subscriptions_enabled
) { ) {
this.renderer.render(actionHandler.subscriptionsConfiguration(), {}, actionHandler.configuration()); this.renderer.render(actionHandler.subscriptionsConfiguration(), {}, actionHandler.configuration());
if(!PayPalCommerceGateway.subscription_plan_id) {
this.gateway.button.is_disabled = true;
this.handleButtonStatus();
}
return; return;
} }