diff --git a/changelog.txt b/changelog.txt index ddbfa80e1..a89c583e1 100644 --- a/changelog.txt +++ b/changelog.txt @@ -5,6 +5,7 @@ * Tweak - Standardize ECE Express payment buttons on Pay for Order page to match cart and checkout itemization behavior. * Tweak - Remove duplicate notice about the new checkout experience. * Fix - Fix ECE modal not loading on pay for order page when coupon is applied. +* Fix - Do not load express payment buttons on switch subscription page. * Fix - Return 'is_live' as true in account summary response when test mode is disabled in gateway settings and charge is enabled in Stripe account. = 8.9.0 - 2024-11-14 = diff --git a/includes/payment-methods/class-wc-stripe-express-checkout-element.php b/includes/payment-methods/class-wc-stripe-express-checkout-element.php index 6eee0c0e0..c944dab05 100644 --- a/includes/payment-methods/class-wc-stripe-express-checkout-element.php +++ b/includes/payment-methods/class-wc-stripe-express-checkout-element.php @@ -85,6 +85,11 @@ public function init() { return; } + // Don't load for switch subscription page. + if ( isset( $_GET['switch-subscription'] ) ) { + return; + } + add_action( 'template_redirect', [ $this, 'set_session' ] ); add_action( 'template_redirect', [ $this, 'handle_express_checkout_redirect' ] ); diff --git a/includes/payment-methods/class-wc-stripe-payment-request.php b/includes/payment-methods/class-wc-stripe-payment-request.php index 8061b6329..8b0997f70 100644 --- a/includes/payment-methods/class-wc-stripe-payment-request.php +++ b/includes/payment-methods/class-wc-stripe-payment-request.php @@ -104,6 +104,11 @@ public function __construct() { return; } + // Don't load for switch subscription page. + if ( isset( $_GET['switch-subscription'] ) ) { + return; + } + $this->init(); } diff --git a/readme.txt b/readme.txt index 7692cfb04..fe6d0c5e5 100644 --- a/readme.txt +++ b/readme.txt @@ -115,6 +115,7 @@ If you get stuck, you can ask for help in the [Plugin Forum](https://wordpress.o * Tweak - Standardize ECE Express payment buttons on Pay for Order page to match cart and checkout itemization behavior. * Tweak - Remove duplicate notice about the new checkout experience. * Fix - Fix ECE modal not loading on pay for order page when coupon is applied. +* Fix - Do not load express payment buttons on switch subscription page. * Fix - Return 'is_live' as true in account summary response when test mode is disabled in gateway settings and charge is enabled in Stripe account. [See changelog for all versions](https://raw.githubusercontent.com/woocommerce/woocommerce-gateway-stripe/trunk/changelog.txt).