Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[ECE] Hide express payment buttons on switch subscription page #3610

Merged
merged 5 commits into from
Nov 20, 2024
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions changelog.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
= 9.0.0 - xxxx-xx-xx =
* Update - Improve accuracy of webhook status information displayed in settings page.
* Tweak - Standardize ECE Express payment buttons on Pay for Order page to match cart and checkout itemization behavior.
* Fix - Do not load express payment buttons on switch subscription page.

= 8.9.0 - 2024-11-14 =
* Update - Enhance webhook processing to enable retrieving orders using payment_intent metadata.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,11 @@ public function init() {
return;
}

// Don't load for switch subscription page.
if ( isset( $_GET['switch-subscription'] ) ) {
return true;
Copy link
Contributor

@wjrosa wjrosa Nov 18, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is there a particular reason for the true value here? I'm just asking because the other return statements above do not have a value (void).

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good catch. I added this check inside another function (which should return a boolean) at first and copied it over from there. It is a copy paste error on my end 🤦‍♀️

Fixed in 2a0929f

}

add_action( 'template_redirect', [ $this, 'set_session' ] );
add_action( 'template_redirect', [ $this, 'handle_express_checkout_redirect' ] );

Expand Down
5 changes: 5 additions & 0 deletions includes/payment-methods/class-wc-stripe-payment-request.php
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,11 @@ public function __construct() {
return;
}

// Don't load for switch subscription page.
if ( isset( $_GET['switch-subscription'] ) ) {
return true;
}

$this->init();
}

Expand Down
1 change: 1 addition & 0 deletions readme.txt
Original file line number Diff line number Diff line change
Expand Up @@ -113,5 +113,6 @@ If you get stuck, you can ask for help in the [Plugin Forum](https://wordpress.o
= 9.0.0 - xxxx-xx-xx =
* Update - Improve accuracy of webhook status information displayed in settings page.
* Tweak - Standardize ECE Express payment buttons on Pay for Order page to match cart and checkout itemization behavior.
* Fix - Do not load express payment buttons on switch subscription page.

[See changelog for all versions](https://raw.githubusercontent.com/woocommerce/woocommerce-gateway-stripe/trunk/changelog.txt).
Loading