Skip to content

Commit 1e71526

Browse files
Fix gateway name on non payments pages (#4265)
* Update payment method title display logic in settings page Update conditions to include 'checkout' tab for displaying enabled payment methods count in both WC_Gateway_Stripe and WC_Stripe_UPE_Payment_Gateway classes. This makes sure that correct gateway name is shown on non-payments settings pages. * Add changelog entries --------- Co-authored-by: daledupreez <[email protected]>
1 parent 86b3f9b commit 1e71526

File tree

4 files changed

+4
-2
lines changed

4 files changed

+4
-2
lines changed

changelog.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919
* Dev - Improve SPE e2e tests to reduce flakiness
2020
* Fix - Prevents fatal errors for cases where we fail to load product details
2121
* Fix - Address an edge case with webhook URL comparisons
22+
* Fix - Show correct gateway name in non payments settings pages.
2223

2324
= 9.4.1 - 2025-04-17 =
2425
* Dev - Forces rollback of version 9.4.0.

includes/class-wc-gateway-stripe.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -145,7 +145,7 @@ public function __construct() {
145145
*/
146146
public function get_title() {
147147
// Change the title on the payment methods settings page to include the number of enabled payment methods.
148-
if ( ! WC_Stripe_Feature_Flags::is_upe_checkout_enabled() && isset( $_GET['page'] ) && 'wc-settings' === $_GET['page'] ) {
148+
if ( ! WC_Stripe_Feature_Flags::is_upe_checkout_enabled() && isset( $_GET['page'] ) && 'wc-settings' === $_GET['page'] && isset( $_GET['tab'] ) && 'checkout' === $_GET['tab'] ) {
149149
$enabled_payment_methods_count = count( WC_Stripe_Helper::get_legacy_enabled_payment_method_ids() );
150150
$this->title = $enabled_payment_methods_count ?
151151
/* translators: $1. Count of enabled payment methods. */

includes/payment-methods/class-wc-stripe-upe-payment-gateway.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -248,7 +248,7 @@ public function __construct() {
248248
$this->statement_descriptor = ! empty( $main_settings['statement_descriptor'] ) ? $main_settings['statement_descriptor'] : '';
249249

250250
// When feature flags are enabled, title shows the count of enabled payment methods in settings page only.
251-
if ( WC_Stripe_Feature_Flags::is_upe_checkout_enabled() && WC_Stripe_Feature_Flags::is_upe_preview_enabled() && isset( $_GET['page'] ) && 'wc-settings' === $_GET['page'] ) {
251+
if ( WC_Stripe_Feature_Flags::is_upe_checkout_enabled() && WC_Stripe_Feature_Flags::is_upe_preview_enabled() && isset( $_GET['page'] ) && 'wc-settings' === $_GET['page'] && isset( $_GET['tab'] ) && 'checkout' === $_GET['tab'] ) {
252252
$enabled_payment_methods_count = count( $enabled_payment_methods );
253253
$this->title = $enabled_payment_methods_count ?
254254
/* translators: $1. Count of enabled payment methods. */

readme.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -129,5 +129,6 @@ If you get stuck, you can ask for help in the [Plugin Forum](https://wordpress.o
129129
* Dev - Improve SPE e2e tests to reduce flakiness
130130
* Fix - Prevents fatal errors for cases where we fail to load product details
131131
* Fix - Address an edge case with webhook URL comparisons
132+
* Fix - Show correct gateway name in non payments settings pages.
132133

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

0 commit comments

Comments
 (0)