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

Recommend WooPayments when there is no available payment gateway #766

Merged
merged 5 commits into from
Jan 21, 2025

Conversation

alefesouza
Copy link
Member

Fixes woocommerce/woocommerce-subscriptions#4023

Description

Recommend WooPayments instead of Stripe when there is no available recurring payment gateway.

Screenshot 2025-01-15 at 4 04 06 PM

How to test this PR

  1. Access WooCommerce > Settings > Payments.
  2. Disable all payment methods.
  3. Reload the page.
  4. Scroll down, the No payment gateways capable of processing automatic subscription payments... message should recommend WooPayments instead of Stripe.

Product impact

  • Added changelog entry (or does not apply)
  • Will this PR affect WooCommerce Subscriptions? yes/no/tbc, add issue ref
  • Will this PR affect WooCommerce Payments? yes/no/tbc, add issue ref
  • Added deprecated functions, hooks or classes to the spreadsheet

@alefesouza alefesouza requested a review from mattallan January 15, 2025 19:09
Copy link
Contributor

@mattallan mattallan left a comment

Choose a reason for hiding this comment

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

Thanks @alefesouza, I've a few minor comments :)

changelog.txt Outdated
@@ -1,6 +1,7 @@
*** WooCommerce Subscriptions Core Changelog ***

= 8.0.0 - xxxx-xx-xx =
* Fix - Recommend WooPayments when there is no available payment gateway
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
* Fix - Recommend WooPayments when there is no available payment gateway
* Fix - Recommend WooPayments when there is no available payment gateway.

Small nit 😅

Copy link
Member Author

Choose a reason for hiding this comment

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

Thanks, fixed on 7695d93.

@@ -1893,7 +1893,7 @@ public static function add_recurring_payment_gateway_information( $settings ) {

if ( ! $payment_gateways_handler::one_gateway_supports( 'subscriptions' ) ) {
// translators: $1-2: opening and closing tags of a link that takes to Woo marketplace / Stripe product page
$available_gateways_description = sprintf( __( 'No payment gateways capable of processing automatic subscription payments are enabled. If you would like to process automatic payments, we recommend the %1$sfree Stripe extension%2$s.', 'woocommerce-subscriptions' ), '<strong><a href="https://www.woocommerce.com/products/stripe/">', '</a></strong>' );
$available_gateways_description = sprintf( __( 'No %1$spayment gateways capable of processing automatic subscription payments%2$s are enabled. If you would like to process automatic payments, we recommend %3$sWooPayments%4$s.', 'woocommerce-subscriptions' ), '<a href="hhttps://woocommerce.com/document/subscriptions/payment-gateways/">', '</a>', '<strong><a href="https://woocommerce.com/payments/">', '</a></strong>' );
Copy link
Contributor

Choose a reason for hiding this comment

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

I noticed this change was suggested on the issue, but I'm thinking this additional link (payment gateways capable of processing automatic subscription payments) is necessary.

IMO this section feels pretty crowded with links and since this href is already used further down, I think we can remove it. Thoughts?

image

Copy link
Member Author

Choose a reason for hiding this comment

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

Makes sense, removed on b44e0b9.

@alefesouza alefesouza requested a review from mattallan January 18, 2025 00:02
Copy link
Contributor

@mattallan mattallan left a comment

Choose a reason for hiding this comment

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

Thanks @alefesouza ! I've just left a suggestion to remove the extra </a> that was left over.

Approving this to be merged once that small issue is fixed :)

@alefesouza alefesouza merged commit 5569c09 into trunk Jan 21, 2025
7 checks passed
@alefesouza alefesouza deleted the fix/recommend-woopayments branch January 21, 2025 02:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants