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 Checkout appearance section to display WooPay checkout preview UI #7511

Merged
merged 24 commits into from
Oct 27, 2023

Conversation

lovo-h
Copy link
Contributor

@lovo-h lovo-h commented Oct 18, 2023

Fixes #6995

Changes proposed in this Pull Request

This PR updates WooCommerce > Settings > Payments > WooPayments > WooPay > Checkout appearance so that the WooPay checkout preview resembles the WooPay checkout page.

Testing instructions

Test: Store name and logo

  • As a merchant, navigate to WooCommerce > Settings > Payments > WooPayments > WooPay > Checkout appearance.
  • Click the Upload custom logo button and upload one of the accepted image file types (e.g. HEIC, WEBP, SVG, PNG, or JPG).
  • Ensure the preview now has the custom logo displayed.
  • Delete the logo by clicking the trash icon.
  • Ensure the preview now has the store's name displayed.
goOpZZ.mp4

Test: Checkout privacy policy

  • As a merchant, navigate to WooCommerce > Settings > Payments > WooPayments > WooPay > Checkout appearance.
  • Add some text to the Policies and custom text field.
  • Ensure the text changes are displayed in the preview. Also, ensure spacing is adjusted accordingly.
bWtB3g.mp4

Screen Caps

Mobile
image

image

Desktop

image

image


  • 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

@lovo-h lovo-h added category: projects For any issues which are part of any project, including bugs, enhancements, etc. component: WooPay WooPay related issues needs demo PR should provide screenshot or gif of changes to be reviewed by product and design labels Oct 18, 2023
@lovo-h lovo-h self-assigned this Oct 18, 2023
@botwoo
Copy link
Collaborator

botwoo commented Oct 18, 2023

Test the build

Option 1. Jetpack Beta

  • Install and activate Jetpack Beta.
  • Use this build by searching for PR number 7511 or branch name update/6995-woopay-checkout-appearance-preview-ui 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: 5fdd6bc
  • Build time: 2023-10-27 20:00:30 UTC

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

@github-actions
Copy link
Contributor

github-actions bot commented Oct 18, 2023

Size Change: -1.16 kB (0%)

Total Size: 1.44 MB

Filename Size Change
release/woocommerce-payments/dist/settings-rtl.css 9.99 kB +473 B (+5%) 🔍
release/woocommerce-payments/dist/settings.css 10 kB +473 B (+5%) 🔍
release/woocommerce-payments/dist/settings.js 232 kB -2.1 kB (-1%)
ℹ️ 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/index.js 284 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.1 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/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

@lovo-h lovo-h requested review from a team and cesarcosta99 and removed request for a team October 19, 2023 01:20
@lovo-h lovo-h marked this pull request as ready for review October 19, 2023 01:21
@lovo-h lovo-h added the priority: high The issue/PR is high priority—it affects lots of customers substantially, but not critically. label Oct 19, 2023
It seems like this comma was accidentally merged. This commit removes
it since it appears to be unintentional.
@pierorocca
Copy link
Contributor

pierorocca commented Oct 19, 2023

@lovo-h thanks for your work on this enhancement. Super excited about this. It'll be a good improvement for merchants evaluating or setting up WooPay. @nikkivias would appreciate your eyes on this before it's pushed to production.

Desktop: Looks good. It's a bit hard to tell from the video, is the preview policy text legible in your opinion? Thoughts on the button loading component? Is that a standard loading component @nikkivias ?

Regarding the logo, the image formats I believe I provided the copy for that. Do we in fact support all of those image formats? Double checking.

Mobile: Is it your phone font setting that makes the input text appear to be oversized? The preview also looks super tiny. Is it possible to increase the width of the preview to be same width at the section below it?

@pierorocca
Copy link
Contributor

@nikkivias would you recommend that the preview on desktop also make use of the extra available width?

Copy link
Contributor

@cesarcosta99 cesarcosta99 left a comment

Choose a reason for hiding this comment

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

Changes look good and tests well 😎 I left a few nitpick comments but the only blocker here is the image formats we accept for the logo.

  • The preview of the WooPay checkout looks accurate ✅
  • Both the logo and custom text are correctly applied at the WooPay checkout ✅
  • Removing the logo reverts to the store name at the WooPay checkout ✅

Another suggestion, if that's not a big deal, would be to stretch the preview to the content area in the mobile view, as follows:

Screenshot 2023-10-19 at 19 00 44

@lovo-h
Copy link
Contributor Author

lovo-h commented Oct 19, 2023

Desktop: Looks good. It's a bit hard to tell from the video, is the preview policy text legible in your opinion?

@pierorocca, here's a better view of the desktop version:

image

The text is barely legible but does indicate the general shape of the text and how it would appear on the checkout page.

We may be able to increase the text size to make it more legible by reducing the horizontal white space. But in order to do this, I will need an updated Figma design; since I am using the SVG as my source. Here is what the Figma design currently looks like:

image

Source: nngbiDUWyJa7fYcpiE9Jdu-fi-5649_4058.

Regarding the logo, the image formats I believe I provided the copy for that. Do we in fact support all of those image formats? Double checking.

Good question. Currently, we only support PNG and JPG. Did we want to rephrase the text, or do we want to place effort in supporting the other image formats?

Mobile: Is it your phone font setting that makes the input text appear to be oversized?

Actually, in this case, I was using Chrome's Dev Tools to preview how it would look on a mobile device. I agree though, the input text does look oversized. Here's how it appears on my mobile device (iPhone):

image

It looks about the same 🤔

The preview also looks super tiny. Is it possible to increase the width of the preview to be same width at the section below it?

I agree, that would be a good solution. At the moment, I am importing the design layout as an SVG, from the Figma designs. So, in order to update the preview on mobile, I will need new Figma designs (tailored for mobile).

Also, for the Desktop version, if we are able to update the Figma designs so that we use more of the empty space, we may be able to make the text more legible.

Once the designs have been updated, I can import and use the new SVGs. @nikkivias, are we able to make these changes on Figma?

@pierorocca
Copy link
Contributor

Sorry for the brevity as I'm on mobile on meet-up. Let's adjust the copy to match existing capability and we can decide to support additional formats as a new enhancement issue.

@pierorocca
Copy link
Contributor

The text is barely legible but does indicate the general shape of the text and how it would appear on the checkout page.

A key objective of the preview is to allow the merchant to view the wording of the policy text. I've left a comment on the Figma file outlining the problem with legibility, especially on mobile.

@pierorocca pierorocca added status: blocked The issue is blocked from progressing, waiting for another piece of work to be done. needs design The issue requires design input/work from a designer. labels Oct 20, 2023
@pierorocca
Copy link
Contributor

The mobile input font size, what do you believe is causing it to be so huge relative to the size on desktop?

@pierorocca
Copy link
Contributor

That looks terrific @nikkivias.

Here's the other preview I was referring to. The Express Payments checkout button has settings associated with it and we display a preview of the button appearance below. Note because I'm on a work profile on Chrome, GPay doesn't render but it would if I was signed in on my personal Chrome account.

image

@nikkivias
Copy link

That button setting is looking a little too tall and could use some reworking too

@bborman22
Copy link
Contributor

I'm loving the direction this is taking! One thing to keep in mind as we review this PR is that we'll need it merged tomorrow to make it into 6.7. @lovo-h I don't have a solid grasp on the scope of any given request on this issue, but we'll want to keep that deadline in mind and may need to make some trade offs to be sure we hit that.

@pierorocca
Copy link
Contributor

@nikkivias there's an open enhancement issue resulting from a recent user flow review. Welcome your feedback on the proposed design. #6470

@lovo-h
Copy link
Contributor Author

lovo-h commented Oct 26, 2023

@pierorocca, @nikkivias, here is how the latest changes appear:

When resizing the window

dKZJT1.mp4

When updating the Policies and custom text & the Checkout logo

qTLy4s.mp4

@pierorocca
Copy link
Contributor

Looks fantastic. Thanks all for the iterative collaboration. It's amazing to see how small adjustments have such huge impact on the final result. LGTM.

@nikkivias
Copy link

nikkivias commented Oct 26, 2023

That was amazingly quick! Looking good! I would just note to add that bit of shadow and border radius I added to the actual preview.

@lovo-h
Copy link
Contributor Author

lovo-h commented Oct 26, 2023

That was amazingly quick! Looking good! I would just note to add that bit of shadow and border radius I added to the actual preview.

Great catch @nikkivias. The shadow and the border-radius have been added:

image

Copy link
Contributor

@cesarcosta99 cesarcosta99 left a comment

Choose a reason for hiding this comment

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

  • Everything is working as in the first review ✅
  • The checkout preview is responsive ✅

I've found two issues that we might want to consider addressing still in this PR.

  1. In any viewport, the height of the preview is bigger than the container when the custom text is empty, making the box-shadow overflow the section.

Oct-27-2023 13-21-59

  1. Should we account for line breaks here? The line breaks present in the textarea are not reflected at the WooPay checkout or the preview. This is slightly unrelated to the goal of this PR, so I think it'd be ok to address in a different PR. cc @pierorocca
image

@pierorocca
Copy link
Contributor

In any viewport, the height of the preview is bigger than the container when the custom text is empty, making the box-shadow overflow the section.

Nice catch! All of us missed that in the demos. That definitely should be resolved prior to merge.

Should we account for line breaks here? The line breaks present in the textarea are not reflected at the WooPay checkout or the preview. This is slightly unrelated to the goal of this PR, so I think it'd be ok to address in a different PR. cc

This can wait until we either support markdown or add rich text capable editor. The key thing is that we can surface the store policies. Longer term I'd like to see 1:1 alignment with the checkout policy block + some minimal custom rich text via an easy to use wysiwyg editor.

@lovo-h
Copy link
Contributor Author

lovo-h commented Oct 27, 2023

  1. In any viewport, the height of the preview is bigger than the container when the custom text is empty, making the box-shadow overflow the section.

@cesarcosta99, great catch! Fixed in 4692f5b.

@lovo-h lovo-h requested a review from cesarcosta99 October 27, 2023 17:56
@lovo-h
Copy link
Contributor Author

lovo-h commented Oct 27, 2023

Here's a demo with the fix applied:

cdHeYc.mp4

Copy link
Contributor

@cesarcosta99 cesarcosta99 left a comment

Choose a reason for hiding this comment

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

The shadow of the checkout preview is looking good now 🚀

@lovo-h lovo-h added this pull request to the merge queue Oct 27, 2023
Merged via the queue into develop with commit 4343355 Oct 27, 2023
28 checks passed
@lovo-h lovo-h deleted the update/6995-woopay-checkout-appearance-preview-ui branch October 27, 2023 20:31
@pierorocca
Copy link
Contributor

@lovo-h it appears that the shortcode links don't render in the preview. Instead [privacy_policy_link] and [terms_of_service_link] render. We missed that as it wasn't a part of any of the previews. Thanks @csmcneill for catching this pre-release.

Can you replicate this on your site?

@pierorocca
Copy link
Contributor

Also this is out of scope of this issue, Chris also makes a good point that on core the shortcode links are [privacy_policy] and [terms]. Would it make sense to keep consistent?

@lovo-h
Copy link
Contributor Author

lovo-h commented Nov 1, 2023

@lovo-h it appears that the shortcode links don't render in the preview. Instead [privacy_policy_link] and [terms_of_service_link] render. We missed that as it wasn't a part of any of the previews. Thanks @csmcneill for catching this pre-release.

Can you replicate this on your site?

@pierorocca, I was able to replicate this on my site. A fix has been created in #7601.

Also this is out of scope of this issue, Chris also makes a good point that on core the shortcode links are [privacy_policy] and [terms]. Would it make sense to keep consistent?

I went ahead and made these shortcodes consistent in the Policies and custom text input box (for the WooPay checkout preview). But we may still need to create a separate issue for making them consistent in the Appearance > Customize > WooCommerce > Checkout > Privacy policy / Terms and conditions input boxes.

@pierorocca
Copy link
Contributor

Thanks @lovo-h for the quick fix. Will that make 6.7.0 or are we past that window?

I went ahead and made these shortcodes consistent in the Policies and custom text input box (for the WooPay checkout preview). But we may still need to create a separate issue for making them consistent in the Appearance > Customize > WooCommerce > Checkout > Privacy policy / Terms and conditions input boxes.

Based on the demo in #7601 am I understanding correctly that for now we'll still use the _link version and we'll open a new issue to align between core and WooPay?

@lovo-h
Copy link
Contributor Author

lovo-h commented Nov 1, 2023

Piero, we discussed this over Slack but to reiterate here:

Thanks @lovo-h for the quick fix. Will that make 6.7.0 or are we past that window?

It looks like WooPayments 6.7.0 has already been released. So, this will have to be included in the next release: WooPayments 6.8.0 (Nov 22).

Based on the demo in #7601 am I understanding correctly that for now we'll still use the _link version and we'll open a new issue to align between core and WooPay?

Initially, that was the plan but since the changes were small enough, I went ahead and added it to #7601 in
827f47e.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
category: projects For any issues which are part of any project, including bugs, enhancements, etc. component: WooPay WooPay related issues needs demo PR should provide screenshot or gif of changes to be reviewed by product and design priority: high The issue/PR is high priority—it affects lots of customers substantially, but not critically.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

WooPay checkout appearance preview UI refactor
6 participants