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

Update Payments menu item display and linking behavior #51541

Merged
merged 26 commits into from
Sep 20, 2024

Conversation

vladolaru
Copy link
Contributor

@vladolaru vladolaru commented Sep 19, 2024

Submission Review Guidelines:

Changes proposed in this Pull Request:

We detach the Payments top-level menu item from the presence of an active WooPayments incentive:

  • When the WooPayments plugin is NOT active, regardless of an incentive being available - the left nav payments item will always show.
  • When the WooPayments plugin is active, it will take over the Payments menu item for its use.
  • If an incentive is available, clicking the nav item will take the merchant to the incentive page.
  • If an incentive is unavailable or dismissed, clicking the nav item will take the merchant to the currently active Payments task page (either the base "Get paid" task or the "Get paid with WooPayments" task).

Additionally, we remove the recommended treatment of PSP suggestions when WooPayments is recommended.

Here is a recording of the new behavior on a fresh JurassicNinja site:
Screenshot 2024-09-20 at 09 55 12

Closes #51111

How to test the changes in this Pull Request:

Using the WooCommerce Testing Instructions Guide, include your detailed testing instructions:

  1. Create a new JurassicNinja site with just WooCommerce on this PR's live branch (here is a direct JN create link)
  2. Go to the newly created site WP admin dashboard
  3. Go through the WooCommerce profiler (click on the "WooCommerce" menu item if it doesn't start automatically), click on "Skip guided setup", and choose India as your store's location
  4. Go to WooCommerce > Home and you should see a "Get paid" task and a "Payments" top-level menu item with a red dot notice:
    Screenshot 2024-09-20 at 10 01 21
  5. Click on the "Payments" top-level menu item and you should see the Payments task page (notice the /wp-admin/admin.php?page=wc-admin&task=payments URL):
    Screenshot 2024-09-20 at 10 04 06
  6. Click "Enable" for the "Cash on delivery" offline payment method in the bottom "Offline payments methods" section.
  7. Refresh the page, and the "Payments" top-level menu item should NOT have a red dot notice.
  8. Go to WooCommerce > Home and the "Get paid" task should be complete (striked out).
  9. Click on the "Payments" top-level menu item and click on "Get started" for the Stripe recommended payment provider:
    kMBCPD.png
  10. After the Stripe extension is installed, go to WooCommerce > Settings > Payments and click on "Finish setup" for Stripe:
    z9Lf0C.png
  11. Once on the Stripe extensions settings page, click on "Create or connect a test account instead" and them "Skip this form":
    MvZSvm.png
    qOj8Mh.png
  12. Once the Stripe test account is set up and you are redirected back to the Stripe extension settings page, go to WooCommerce > Home and make sure the "Get paid" task is completed (striked out)
  13. Click on the "Payments" top-level menu item and Stripe shouldn't be present:
    Screenshot 2024-09-20 at 10 16 31
  14. Go to WooCommerce > Settings > General and change your store's location country to United States (the specific state doesn't matter)
  15. Go to WooCommerce > Home and you should see a completed "Get paid with WooPayments" task (striked out) and a "Set up additional payments options" task in the "Things to do next" list:
    JXKuU2.png
  16. Click on the "Set up additional payments options" task and you should see a page with WooPayments at the top and additional payment options below (the "Payments" top-level menu item should be present and NOT have a red dot notice):
    Screenshot 2024-09-20 at 10 21 46
  17. Click on the "Payments" top-level menu item and you should remain on the same page (notice the wp-admin/admin.php?page=wc-admin&task=payments URL)
  18. Click on "Get started" for WooPayments, and after the WooPayments plugin is installed and activated, click on "Connect":
    EBiIQF.png
  19. You should be taken to the Jetpack connection screen (approve the connection) and then to the WooPayments wizard (click on Cancel):
    Screenshot 2024-12-06 at 15 52 03
  20. Go to WooCommerce > Home and click on the "Set up additional payments options" task in the "Things to do next" list. You should be taken to the task page with WooPayments featuring a "Finish setup" button:
    6oOGrA.png
  21. Click on the "Finish setup" button, and you will be taken to the WooPayments wizard. Click on Cancel and you will be taken to the WooPayments Connect page.
  22. Click on "Enable sandbox mode" in the "I'm setting up the store for someone else" bottom section. After your sandbox account is set up, you will be taken to the Payments > Overview page with a complete/enabled account
    7n5IOb.png
  23. Go to Plugins > Installed plugins and deactivate both WooPayments and WooCommerce Stripe Gateway.
  24. Go to WooCommerce > Settings > Payments and disable the "Cash on delivery" payment method
  25. Go to WooCommerce > Home and you should see "Get paid with WooPayments" task with a discount badge. At the same time, you should see a "Payments" top-level menu item with a red dot notice:
    GbYXVe.png
  26. Click on the "Payments" top-level menu item and you will see the WooPayments incentive page:
    BhQIVE.png
  27. Dismiss the incentive by clicking on the "No thanks" link and then click on "Just dismiss WooPayments" in the modal.
  28. You will be redirected to the WooCommerce > Home page with a "Get paid with WooPayments" task without a discount badge and a "Payments" top-level main menu item with a red dot notice:
    7kA93W.png
  29. Click on the "Payments" top-level main menu item and you will be taken to the task page (notice the wp-admin/admin.php?page=wc-admin&task=woocommerce-payments URL). WooPayments is present, and there is no recommended badge for the gateway in the "Other payment providers" section below:
    LMofxh.png
  30. Click on "Enable" for the "Cash on delivery" offline payment method and refresh the page. The "Payments" top-level main menu item should NOT have a red dot notice anymore.
  31. Go to WooCommerce > Home and click on the "Get paid with WooPayments" task. WooPayments will be activated and you will be redirected to the WooPayments settings page since you already have a connected account.
  32. Go to WooCommerce > Home and the "Get paid with WooPayments" task should be completed (striked out), and in the "Things to do next" task list, you should have a "Set up additional payment options" task and a "Set up real payments on your store" task.
  33. Click on the "Set up additional payment options" task, and you should see a task page with an additional payment options section and a "Activate BNPL instantly on WooPayments" section:
    HZg2k8.png

Changelog entry

  • Automatically create a changelog entry from the details below.
  • This Pull Request does not require a changelog entry. (Comment required below)
Changelog Entry Details

Significance

  • Patch
  • Minor
  • Major

Type

  • Fix - Fixes an existing bug
  • Add - Adds functionality
  • Update - Update existing functionality
  • Dev - Development related task
  • Tweak - A minor adjustment to the codebase
  • Performance - Address performance issues
  • Enhancement - Improvement to existing functionality

Message

Changelog Entry Comment

Comment

@vladolaru vladolaru self-assigned this Sep 19, 2024
@github-actions github-actions bot added the plugin: woocommerce Issues related to the WooCommerce Core plugin. label Sep 19, 2024
Copy link
Contributor

github-actions bot commented Sep 19, 2024

Test using WordPress Playground

The changes in this pull request can be previewed and tested using a WordPress Playground instance.
WordPress Playground is an experimental project that creates a full WordPress instance entirely within the browser.

Test this pull request with WordPress Playground.

Note that this URL is valid for 30 days from when this comment was last updated. You can update it by closing/reopening the PR or pushing a new commit.

Copy link
Contributor

Size Change: 0 B

Total Size: 2.38 MB

compressed-size-action

@vladolaru vladolaru marked this pull request as ready for review September 20, 2024 07:54
@github-actions github-actions bot added this to the 9.5.0 milestone Sep 20, 2024
@github-actions github-actions bot added the needs: analysis Indicates if the PR requires a PR testing scrub session. label Sep 20, 2024
@rodelgc rodelgc added needs: external testing Indicates if the PR requires further testing conducted by testers external to the development team. needs: internal testing Indicates if the PR requires further testing conducted by Solaris status: analysis complete Indicates if a PR has been analysed by Solaris and removed needs: analysis Indicates if the PR requires a PR testing scrub session. labels Sep 23, 2024
@naman03malhotra naman03malhotra modified the milestones: 9.5.0, 9.4.0 Sep 23, 2024
github-actions bot pushed a commit that referenced this pull request Sep 23, 2024
* Minor cleanup

* refact: Rename must_be_visible to is_incentive_visible for clarity

* refact: Rename register_payments_welcome_page to register_menu_and_page for clarity

* Don't show the incentive page if the user can't manage WC

* Introduce menu item when no incentive

* Don't recommend additional gateways when WCPay is present

* Render gateway suggestions on the WCPay task page, also

* Add changelog entry

* Remove short array syntax

* Lint fixes

* Simplify Payments task view logic

* Simplify WooPayments task view logic

* Improve WooPayments task complete logic

* WooPayments can't be connected or onboarded if it is not active

* refact: Rename private static method

* Improve logic to determine the Payments task slug by factoring in the extended task list also

* docs: Add details about our use of the Payments task logic

* Add type hint

* Do not recommend offline methods when WooPayments is supported

* On suggestion enablement redirect to the same task page

* Lint fixes

* test: Fix unit tests

* Maintain deprecated navigation logic
naman03malhotra pushed a commit that referenced this pull request Sep 23, 2024
* Update Payments menu item display and linking behavior (#51541)

* Minor cleanup

* refact: Rename must_be_visible to is_incentive_visible for clarity

* refact: Rename register_payments_welcome_page to register_menu_and_page for clarity

* Don't show the incentive page if the user can't manage WC

* Introduce menu item when no incentive

* Don't recommend additional gateways when WCPay is present

* Render gateway suggestions on the WCPay task page, also

* Add changelog entry

* Remove short array syntax

* Lint fixes

* Simplify Payments task view logic

* Simplify WooPayments task view logic

* Improve WooPayments task complete logic

* WooPayments can't be connected or onboarded if it is not active

* refact: Rename private static method

* Improve logic to determine the Payments task slug by factoring in the extended task list also

* docs: Add details about our use of the Payments task logic

* Add type hint

* Do not recommend offline methods when WooPayments is supported

* On suggestion enablement redirect to the same task page

* Lint fixes

* test: Fix unit tests

* Maintain deprecated navigation logic

* Prep for cherry pick 51541

---------

Co-authored-by: Vlad Olaru <[email protected]>
Co-authored-by: WooCommerce Bot <[email protected]>
@thekendog
Copy link

It appears this was included in 9.4.1. It's broken. I now have a constant Payments menu item with an orange bubble. Clicking it shows a blank page. If I enable a payment method from the regular settings area, the orange bubble goes away on the menu item, but the page is still blank when I click it.

Why was this added? WooCommerce already has 4 menu items in the admin section. I don't really want another one to clutter things up. There probably should be a way to remove this easily, once it's fixed.

@dcx15
Copy link

dcx15 commented Nov 13, 2024

Why was this added?

I assume it is just a classic case of Automattic wanting to upsell something.

Fun.

@thekendog
Copy link

Why was this added?

I assume it is just a classic case of Automattic wanting to upsell something.

Fun.

I understand then wanting to upsell something and make money. I'm fine with that. There just needs to be a way to remove this menu item once I dismiss the task. That and it needed more thorough testing I guess.

@mrleemon
Copy link
Contributor

Same here. This "Payments" tab appears even though I don't have WooPayments enabled. Clicking it takes me to a blank page. I would like an option to remove this.

@maddisondesigns
Copy link

This PR either needs to be reversed or a fix put in place ASAP, to remove the extra Payments top-level menu item (which shows as a blank page. This PR was obviously never tested properly before being merged.

@mattthomasphoto
Copy link

mattthomasphoto commented Nov 14, 2024

Awful that you can’t dismiss this WooPayments page as I just the official Woo Stripe for payments and now there’s this extra menu for no reason but “advertising”

Using the below hides the Payments menu - however CSS to hide something that shouldn't be there in the first place!

// Hide WooCommerce Payments menu item with CSS function hide_payments_menu_css() { echo '<style> .toplevel_page_admin\\?page\\=wc-admin\\&task\\=payments { display: none !important; } </style>'; } add_action('admin_head', 'hide_payments_menu_css');

This needs sorting ASAP!

@vladolaru
Copy link
Contributor Author

@maddisondesigns, could you help me with some details on how you are testing this and getting the blank page? An SSR of the test store would also come in handy. Thank you.

@thekendog
Copy link

#39668 (comment)

@dcx15
Copy link

dcx15 commented Nov 14, 2024

This feels like such an odd change and the issue it closes doesn't mention anything about why it was needed. Is the purpose simply to signpost the WooPayments service offered by Woo?

There are more people posting about the page being blank at https://wordpress.org/support/topic/payments-menu-after-upgrading-to-9-4-1-empty-page/ too

@richboos
Copy link

richboos commented Nov 14, 2024

This really shouldn't appear as a top-level menu item in WordPress. Payment integrations aren't something that is frequently visited. Compare to other top-level entries:

  • WooCommerce - It's own thing, obviously
  • Products - products come and go, prices change, stock levels change, etc
  • Marketing - coupons get created and rotated

But Payments? Why? Who is changing out payment providers weekly?

I think we know why, which would be what @dcx15 implied - it's an advertisement decision, not a usage-based decision.

@maddisondesigns
Copy link

maddisondesigns commented Nov 15, 2024

@vladolaru All I'm doing is clicking on the Payments top-level menu item that has appeared since the most recent update. Here's a (very short) screencast showing that the page is blank after clicking on the menu item. This is on a live site, but I've also tested this on a couple of local development sites, and the exact same thing happens.

WC.Payments.Blank.Screen.-.2024-11-15.mp4

And no, there was no No thanks link to click on. The menu item just appeared after the most recent update and it's always been showing a blank screen.

@maddisondesigns
Copy link

@vladolaru As mentioned over in this issue #52812, this "fix" that has been merged, has still not actually fixed the issue! I'm still seeing a Payments menu item in my dashboard, with WooCommerce 9.4.2 Instead of seeing a blank page when I click on it though, it now just redirects me to the Payments Tab in the WC Settings.

Screencast: https://share.zight.com/P8uKZvOP

I'm seeing the same thing on multiple sites. This whole menu item needs to be completely removed from the Dashboard!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
needs: external testing Indicates if the PR requires further testing conducted by testers external to the development team. needs: internal testing Indicates if the PR requires further testing conducted by Solaris plugin: woocommerce Issues related to the WooCommerce Core plugin. status: analysis complete Indicates if a PR has been analysed by Solaris
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Enhancement]: Decouple WooPayments incentive and Payments nav item
10 participants