mirror of
https://github.com/woocommerce/woocommerce-paypal-payments.git
synced 2025-09-10 18:26:47 +08:00
Enable buttons when cart contains only one subscription product
This commit is contained in:
parent
4d8302be45
commit
4260dce97b
3 changed files with 6 additions and 5 deletions
|
@ -87,7 +87,7 @@ class CartBootstrap {
|
||||||
) {
|
) {
|
||||||
this.renderer.render(actionHandler.subscriptionsConfiguration());
|
this.renderer.render(actionHandler.subscriptionsConfiguration());
|
||||||
|
|
||||||
if(!PayPalCommerceGateway.subscription_plan_id) {
|
if(!PayPalCommerceGateway.subscription_product_allowed) {
|
||||||
this.gateway.button.is_disabled = true;
|
this.gateway.button.is_disabled = true;
|
||||||
this.handleButtonStatus();
|
this.handleButtonStatus();
|
||||||
}
|
}
|
||||||
|
|
|
@ -107,7 +107,7 @@ class CheckoutBootstap {
|
||||||
) {
|
) {
|
||||||
this.renderer.render(actionHandler.subscriptionsConfiguration(), {}, actionHandler.configuration());
|
this.renderer.render(actionHandler.subscriptionsConfiguration(), {}, actionHandler.configuration());
|
||||||
|
|
||||||
if(!PayPalCommerceGateway.subscription_plan_id) {
|
if(!PayPalCommerceGateway.subscription_product_allowed) {
|
||||||
this.gateway.button.is_disabled = true;
|
this.gateway.button.is_disabled = true;
|
||||||
this.handleButtonStatus();
|
this.handleButtonStatus();
|
||||||
}
|
}
|
||||||
|
|
|
@ -869,6 +869,7 @@ class SmartButton implements SmartButtonInterface {
|
||||||
),
|
),
|
||||||
'subscription_plan_id' => $this->subscription_helper->paypal_subscription_id(),
|
'subscription_plan_id' => $this->subscription_helper->paypal_subscription_id(),
|
||||||
'variable_paypal_subscription_variations' => $this->subscription_helper->variable_paypal_subscription_variations(),
|
'variable_paypal_subscription_variations' => $this->subscription_helper->variable_paypal_subscription_variations(),
|
||||||
|
'subscription_product_allowed' => $this->subscription_helper->checkout_subscription_product_allowed(),
|
||||||
'enforce_vault' => $this->has_subscriptions(),
|
'enforce_vault' => $this->has_subscriptions(),
|
||||||
'can_save_vault_token' => $this->can_save_vault_token(),
|
'can_save_vault_token' => $this->can_save_vault_token(),
|
||||||
'is_free_trial_cart' => $is_free_trial_cart,
|
'is_free_trial_cart' => $is_free_trial_cart,
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue