Hide button if there is a subscription switch in cart

This commit is contained in:
carmenmaymo 2025-04-24 08:57:20 +02:00
parent f4792b5349
commit 86bf3f30d1
No known key found for this signature in database
GPG key ID: 6023F686B0F3102E

View file

@ -643,7 +643,7 @@ document.querySelector("#payment").before(document.querySelector(".ppcp-messages
add_action(
$this->proceed_to_checkout_button_renderer_hook(),
function() use ( $enabled_on_cart ) {
if ( ! is_cart() || ! $enabled_on_cart || $this->is_free_trial_cart() || $this->is_cart_price_total_zero() ) {
if ( ! is_cart() || ! $enabled_on_cart || $this->is_free_trial_cart() || $this->is_cart_price_total_zero() || isset(reset(WC()->cart->cart_contents)['subscription_switch']) ) {
return;
}