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

Disable activation of LPM's requiring additional currencies when MC is disabled #7211

Merged
merged 18 commits into from
Oct 31, 2023

Conversation

tpaksu
Copy link
Contributor

@tpaksu tpaksu commented Sep 14, 2023

Fixes #7154

Changes proposed in this Pull Request

This PR implements the disabled checkboxes and tooltips feature for LPM's that require additional currencies that doesn't match with the store currency to operate, when the multi currency feature is turned off. The fix both applies the LPM activation box on Payments > Settings, and the LPM onboarding page.

  • The notice displayed while MC is on and the LPM requires another currency to be enabled:
image
  • The current screen when MC is off
image
  • Suggested fix

image

  • Suggested fix on the Payments > Settings page
image

Testing instructions

  • Go to WooCommerce > Settings and change the store currency to "USD" if not selected.
  • Go to Payments > Settings > Advanced and uncheck the "Enable Multi-Currency" checkbox.
  • Save Changes.
  • Navigate to http://localhost:8082/wp-admin/admin.php?page=wc-admin&path=%2Fpayments%2Fadditional-payment-methods
  • See the onboarding page shows the LPM's which require additional currencies as disabled, with the correct tooltip.
  • Go to Payments > Settings and see the same effect on the Additional payment methods box too.
  • Change the store currency to "EUR" and see that the LPM's are enabled, but the ones requiring currencies other than EUR got disabled on both screens.

  • Run npm run changelog to add a changelog file, choose patch to leave it empty if the change is not significant. You can add multiple changelog files in one PR by running this command a few times.
  • Covered with tests (or have a good reason not to test in description ☝️)
  • Tested on mobile (or does not apply)

Post merge

@botwoo
Copy link
Collaborator

botwoo commented Sep 14, 2023

Test the build

Option 1. Jetpack Beta

  • Install and activate Jetpack Beta.
  • Use this build by searching for PR number 7211 or branch name fix/7154-onboarding-lpms-while-mc-is-disabled in your-test.site/wp-admin/admin.php?page=jetpack-beta&plugin=woocommerce-payments

Option 2. Jurassic Ninja - available for logged-in A12s

🚀 Launch a JN site with this branch 🚀

ℹ️ Install this Tampermonkey script to get more options.


Build info:

  • Latest commit: 5bbddd0
  • Build time: 2023-10-31 11:48:29 UTC

Note: the build is updated when a new commit is pushed to this PR.

@github-actions
Copy link
Contributor

github-actions bot commented Sep 14, 2023

Size Change: +335 B (0%)

Total Size: 1.44 MB

Filename Size Change
release/woocommerce-payments/dist/index.js 285 kB +156 B (0%)
release/woocommerce-payments/dist/settings.js 232 kB +179 B (0%)
ℹ️ View Unchanged
Filename Size
release/woocommerce-payments/assets/css/admin.css 1.06 kB
release/woocommerce-payments/assets/css/success.css 158 B
release/woocommerce-payments/dist/blocks-checkout-rtl.css 1.8 kB
release/woocommerce-payments/dist/blocks-checkout.css 1.8 kB
release/woocommerce-payments/dist/blocks-checkout.js 75.1 kB
release/woocommerce-payments/dist/checkout-rtl.css 441 B
release/woocommerce-payments/dist/checkout.css 442 B
release/woocommerce-payments/dist/checkout.js 28.9 kB
release/woocommerce-payments/dist/index-rtl.css 36.4 kB
release/woocommerce-payments/dist/index.css 36.4 kB
release/woocommerce-payments/dist/multi-currency-analytics.js 1.05 kB
release/woocommerce-payments/dist/multi-currency-rtl.css 3.39 kB
release/woocommerce-payments/dist/multi-currency-switcher-block.js 60.2 kB
release/woocommerce-payments/dist/multi-currency.css 3.39 kB
release/woocommerce-payments/dist/multi-currency.js 55.4 kB
release/woocommerce-payments/dist/order-rtl.css 676 B
release/woocommerce-payments/dist/order.css 679 B
release/woocommerce-payments/dist/order.js 41.1 kB
release/woocommerce-payments/dist/payment-gateways-rtl.css 1.3 kB
release/woocommerce-payments/dist/payment-gateways.css 1.3 kB
release/woocommerce-payments/dist/payment-gateways.js 39 kB
release/woocommerce-payments/dist/payment-request-rtl.css 153 B
release/woocommerce-payments/dist/payment-request.css 153 B
release/woocommerce-payments/dist/payment-request.js 13.1 kB
release/woocommerce-payments/dist/product-details.js 898 B
release/woocommerce-payments/dist/settings-rtl.css 9.99 kB
release/woocommerce-payments/dist/settings.css 10 kB
release/woocommerce-payments/dist/subscription-edit-page.js 669 B
release/woocommerce-payments/dist/subscription-product-onboarding-modal-rtl.css 519 B
release/woocommerce-payments/dist/subscription-product-onboarding-modal.css 519 B
release/woocommerce-payments/dist/subscription-product-onboarding-modal.js 20.4 kB
release/woocommerce-payments/dist/subscription-product-onboarding-toast.js 693 B
release/woocommerce-payments/dist/subscriptions-empty-state-rtl.css 117 B
release/woocommerce-payments/dist/subscriptions-empty-state.css 117 B
release/woocommerce-payments/dist/subscriptions-empty-state.js 19.5 kB
release/woocommerce-payments/dist/tos-rtl.css 230 B
release/woocommerce-payments/dist/tos.css 231 B
release/woocommerce-payments/dist/tos.js 22 kB
release/woocommerce-payments/dist/upe_checkout-rtl.css 441 B
release/woocommerce-payments/dist/upe_checkout.css 442 B
release/woocommerce-payments/dist/upe_checkout.js 34.1 kB
release/woocommerce-payments/dist/upe_split_checkout-rtl.css 441 B
release/woocommerce-payments/dist/upe_split_checkout.css 442 B
release/woocommerce-payments/dist/upe_split_checkout.js 34.7 kB
release/woocommerce-payments/dist/upe_with_deferred_intent_creation_checkout.js 37.1 kB
release/woocommerce-payments/dist/upe-blocks-checkout-rtl.css 1.8 kB
release/woocommerce-payments/dist/upe-blocks-checkout.css 1.8 kB
release/woocommerce-payments/dist/upe-blocks-checkout.js 40.9 kB
release/woocommerce-payments/dist/upe-split-blocks-checkout-rtl.css 1.8 kB
release/woocommerce-payments/dist/upe-split-blocks-checkout.css 1.8 kB
release/woocommerce-payments/dist/upe-split-blocks-checkout.js 42.5 kB
release/woocommerce-payments/dist/woopay-express-button-rtl.css 153 B
release/woocommerce-payments/dist/woopay-express-button.css 153 B
release/woocommerce-payments/dist/woopay-express-button.js 52 kB
release/woocommerce-payments/dist/woopay-rtl.css 3.91 kB
release/woocommerce-payments/dist/woopay.css 3.91 kB
release/woocommerce-payments/dist/woopay.js 71.7 kB
release/woocommerce-payments/includes/subscriptions/assets/css/plugin-page.css 622 B
release/woocommerce-payments/includes/subscriptions/assets/js/plugin-page.js 814 B
release/woocommerce-payments/vendor/automattic/jetpack-assets/build/i18n-loader.js 2.43 kB
release/woocommerce-payments/vendor/automattic/jetpack-assets/src/js/i18n-loader.js 1.01 kB
release/woocommerce-payments/vendor/automattic/jetpack-connection/dist/tracks-ajax.js 522 B
release/woocommerce-payments/vendor/automattic/jetpack-connection/dist/tracks-callables.js 581 B
release/woocommerce-payments/vendor/automattic/jetpack-identity-crisis/babel.config.js 160 B
release/woocommerce-payments/vendor/automattic/jetpack-identity-crisis/build/index.css 2.32 kB
release/woocommerce-payments/vendor/automattic/jetpack-identity-crisis/build/index.js 13.8 kB
release/woocommerce-payments/vendor/automattic/jetpack-identity-crisis/build/index.rtl.css 2.32 kB
release/woocommerce-payments/vendor/woocommerce/subscriptions-core/assets/css/about.css 1.03 kB
release/woocommerce-payments/vendor/woocommerce/subscriptions-core/assets/css/admin-empty-state.css 291 B
release/woocommerce-payments/vendor/woocommerce/subscriptions-core/assets/css/admin-order-statuses.css 403 B
release/woocommerce-payments/vendor/woocommerce/subscriptions-core/assets/css/admin.css 3.6 kB
release/woocommerce-payments/vendor/woocommerce/subscriptions-core/assets/css/checkout.css 299 B
release/woocommerce-payments/vendor/woocommerce/subscriptions-core/assets/css/modal.css 742 B
release/woocommerce-payments/vendor/woocommerce/subscriptions-core/assets/css/view-subscription.css 572 B
release/woocommerce-payments/vendor/woocommerce/subscriptions-core/assets/css/wcs-upgrade.css 411 B
release/woocommerce-payments/vendor/woocommerce/subscriptions-core/assets/js/admin/admin-pointers.js 544 B
release/woocommerce-payments/vendor/woocommerce/subscriptions-core/assets/js/admin/admin.js 9.4 kB
release/woocommerce-payments/vendor/woocommerce/subscriptions-core/assets/js/admin/jstz.js 6.8 kB
release/woocommerce-payments/vendor/woocommerce/subscriptions-core/assets/js/admin/jstz.min.js 3.83 kB
release/woocommerce-payments/vendor/woocommerce/subscriptions-core/assets/js/admin/meta-boxes-coupon.js 544 B
release/woocommerce-payments/vendor/woocommerce/subscriptions-core/assets/js/admin/meta-boxes-subscription.js 2.38 kB
release/woocommerce-payments/vendor/woocommerce/subscriptions-core/assets/js/admin/moment.js 22.1 kB
release/woocommerce-payments/vendor/woocommerce/subscriptions-core/assets/js/admin/moment.min.js 11.6 kB
release/woocommerce-payments/vendor/woocommerce/subscriptions-core/assets/js/admin/payment-method-restrictions.js 1.29 kB
release/woocommerce-payments/vendor/woocommerce/subscriptions-core/assets/js/admin/wcs-meta-boxes-order.js 502 B
release/woocommerce-payments/vendor/woocommerce/subscriptions-core/assets/js/frontend/payment-methods.js 355 B
release/woocommerce-payments/vendor/woocommerce/subscriptions-core/assets/js/frontend/single-product.js 429 B
release/woocommerce-payments/vendor/woocommerce/subscriptions-core/assets/js/frontend/view-subscription.js 1.38 kB
release/woocommerce-payments/vendor/woocommerce/subscriptions-core/assets/js/frontend/wcs-cart.js 781 B
release/woocommerce-payments/vendor/woocommerce/subscriptions-core/assets/js/modal.js 1.1 kB
release/woocommerce-payments/vendor/woocommerce/subscriptions-core/assets/js/wcs-upgrade.js 1.27 kB
release/woocommerce-payments/vendor/woocommerce/subscriptions-core/build/index.css 392 B
release/woocommerce-payments/vendor/woocommerce/subscriptions-core/build/index.js 3.05 kB

compressed-size-action

Copy link

@elizaan36 elizaan36 left a comment

Choose a reason for hiding this comment

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

@tpaksu We discussed this in Slack. I think the wording can be tweaked based on whether MC is required.

Also, the most important thing is that once merchants are in settings they have a clear indication of what to do next. We can use this design pattern that's consistent with other payment methods that need additional steps for setup. The error icon presents a tooltip on hover. Discussed in paJDYF-9Mc#comment-20802

image

@tpaksu
Copy link
Contributor Author

tpaksu commented Sep 19, 2023

@elizaan36 thanks for the info, so we'll be removing the global notice and adding warning icon with tooltips instead per LPM to fix this issue, right?

@elizaan36
Copy link

hey @tpaksu I think the notice should remain in the modal to warn merchants about the situation. However, the settings pattern (warning icon with tooltip per LPM) is important as it's persistent once they've closed out of the modal.

Based on the Slack thread, I think the language in the modal could be tweaked to something like this,

iDEAL requires the EUR currency. In order to enable the payment method you must add this currency to your store.

@tpaksu
Copy link
Contributor Author

tpaksu commented Sep 20, 2023

@elizaan36 they can't work together, as we'll be disabling selecting the LPM's with currency needs, and they won't be able to see the notice without being able to select them. And having them selected in onboarding, but not on the settings screen will be another issue. I suggest removing the notice and going with the checkbox -> warning icon replacement, and the tooltips. Or having them all checkable and showing the notice (as it is currently), without the tooltips.

IMO, UX wise, letting them select the LPM's, showing the notice, suggesting them to enable the currency via a pill on the right side of the LPM title, stating something like Needs EUR currency and showing the tooltip on that with the Learn more link, will be a better solution.

@elizaan36
Copy link

I suggest removing the notice and going with the checkbox -> warning icon replacement, and the tooltips.

This seems like the clearest pattern to indicate when a payment method requires more setup. Showing the checkbox indicates that the payment method can be enabled when in fact it can't.

Let's go with this approach for now and I'll ping @rikmantel since he's taking a look at Multi Currency setup in the near future. Rik, could you take a closer look at this setup flow - the use case is when the Multi Currency extension has been deactivated, then the merchant tries to enable payment methods with WooPayments.

@tpaksu
Copy link
Contributor Author

tpaksu commented Sep 25, 2023

@elizaan36 gotcha. Now to summarize what I understood:

  • If multi currency is enabled, we show the checkboxes, because when they select the LPM, the onboarding flow will automatically add the required currencies to the system. And when they select an LPM that requires another currency enabled, they'll see the notice.
  • If multi currency is disabled, we disable the checkboxes, and show a tooltip that the LPM requires another currency active. And they because they can't select those, the notice won't be shown in any way.

And @rikmantel, welcome to the team! Looking forward to work with you!

@elizaan36
Copy link

Sounds good to me. You could use copy similar to what I proposed for the notice for the tooltip.

iDEAL requires the EUR currency. In order to enable the payment method you must add this currency to your store.

@tpaksu tpaksu removed the request for review from a team October 2, 2023 13:27
@tpaksu
Copy link
Contributor Author

tpaksu commented Oct 5, 2023

@elizaan36 how does it look?

image

And for multiple currencies on P24:
image

@tpaksu tpaksu requested review from elizaan36 and a team October 6, 2023 11:33
@tpaksu tpaksu changed the title Fix LPM onboarding not working when MC is disabled Disable activation of LPM's requiring additional currencies when MC is disabled Oct 6, 2023
@jessepearson
Copy link
Contributor

Noting that in testing this that if Multi-Currency is enabled and a currency is not enabled, we automatically enable the currency without a note to the merchant if they are enabling the additional payment method outside of the wizard. I felt like I had come across this before, and I found where I asked about that here: p1684498606483579-slack-C01B8KNUYSW

Copy link
Contributor

@jessepearson jessepearson left a comment

Choose a reason for hiding this comment

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

LGTM! Works as described. I added a comment in the PR itself, but that's unrelated to this code, as it's an issue that's present on develop.

@tpaksu
Copy link
Contributor Author

tpaksu commented Oct 6, 2023

@jessepearson thanks for the review, I'll wait for @elizaan36's approval for merging this in. If Elizabeth approves it while I'm AFK, feel free to merge it.

Copy link

@elizaan36 elizaan36 left a comment

Choose a reason for hiding this comment

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

Copy looks good to me. @tpaksu Could you share a screenshot of the tooltip in a mobile view? There's an accessibility issue that we worked on with this component. I believe @mordeth solved for this with another payment method that required the tooltip.

@jessepearson
Copy link
Contributor

Could you share a screenshot of the tooltip in a mobile view? There's an accessibility issue that we worked on with this component.

@elizaan36 Sorry for the late reply here, this is what I am seeing through the Chome dev tools when tapping on the payment method.

Screenshot 2023-10-12 at 12 16 04 PM

@elizaan36
Copy link

thanks for sharing @jessepearson! The tooltip looks off kilter.
Is it possible to create multiple positioning options for the arrow, so it can point left/right and up/down to be aligned with the icon that triggers it?

@tpaksu
Copy link
Contributor Author

tpaksu commented Oct 17, 2023

@elizaan36 possibly possible, but not on this PR :)

@tpaksu
Copy link
Contributor Author

tpaksu commented Oct 31, 2023

@jessepearson on Chrome's developer tools, when I switch to mobile view, the arrows don't show up. Which browser did you use? It may also be something coming with the latest pushes. I merged the latest develop to this branch, and even on the desktop view, the arrows don't show anymore. Interesting.

@elizaan36 will it be OK to push it like it is now?

Settings screen

image image

LPM Onboarding

image image

@elizaan36
Copy link

Yes, this looks good! The arrow was removed in this PR when the mobile view was fixed.

@tpaksu tpaksu added this pull request to the merge queue Oct 31, 2023
Merged via the queue into develop with commit b011b37 Oct 31, 2023
25 of 28 checks passed
@tpaksu tpaksu deleted the fix/7154-onboarding-lpms-while-mc-is-disabled branch October 31, 2023 19:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Onboarding LPM's which require additional currencies while MC is disabled
4 participants