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

Integrate express payments buttonAttributes API from the Checkout Block #8888

Merged
merged 23 commits into from
Sep 13, 2024

Conversation

alexflorisca
Copy link
Member

@alexflorisca alexflorisca commented May 29, 2024

Changes proposed in this Pull Request:

This PR uses the buttonAttributes API introduced in Woo Core in Add new buttonAttributes API to style express checkout buttons coherently. This will respect the new height and borderRadius controls on the express checkout block, overriding extension settings when these are available. It also uses the darkMode setting to override the button theme.

This means the woo payments specific settings are still applied if we're not in a checkout block context. But if we are, the button sizes and colours will be synced across all express payment buttons that have integrated with this API.

Testing instructions

  1. Add some items to the cart and visit the cart page (with the cart block)
  2. Ensure the express payment methods are visible there (Woo and GPay or Apple Pay)
  3. Click "Proceed to checkout"
  4. Ensure the express payment methods are visible there too
  5. In a new tab, open the checkout page in the editor.
  6. Click on the express checkout area and change the button size to "Large" and the border radius to 50px
  7. Refresh the checkout page in the front-end
  8. Notice both the height and the border radius are applied to the WooPay button, and only the height is applied to the payment request method.

  • 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

@alexflorisca alexflorisca added component: checkout Issues related to Checkout category: engineering For product engineering, architecture work, tech debt and so on. component: payment request button Apple Pay, Google Pay, etc type: spike focus: integration & extensibility APIs focus: woopay labels May 29, 2024
@botwoo
Copy link
Collaborator

botwoo commented May 29, 2024

Test the build

Option 1. Jetpack Beta

  • Install and activate Jetpack Beta.
  • Use this build by searching for PR number 8888 or branch name try/poc-express-checkout-button-styles 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: 49eaf8c
  • Build time: 2024-09-10 14:29:53 UTC

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

Copy link
Contributor

github-actions bot commented May 29, 2024

Size Change: +487 B (0%)

Total Size: 1.33 MB

Filename Size Change
release/woocommerce-payments/dist/blocks-checkout.js 66.3 kB +203 B (0%)
release/woocommerce-payments/dist/express-checkout.js 14.2 kB +35 B (0%)
release/woocommerce-payments/dist/index.js 302 kB +16 B (0%)
release/woocommerce-payments/dist/multi-currency-switcher-block.js 60.5 kB +14 B (0%)
release/woocommerce-payments/dist/multi-currency.js 55.5 kB +8 B (0%)
release/woocommerce-payments/dist/order.js 42.7 kB +8 B (0%)
release/woocommerce-payments/dist/payment-gateways.js 39.3 kB +12 B (0%)
release/woocommerce-payments/dist/settings.js 224 kB +120 B (0%)
release/woocommerce-payments/dist/woopay-express-button.js 24.1 kB +71 B (0%)
ℹ️ View Unchanged
Filename Size
release/woocommerce-payments/assets/css/admin.css 1.08 kB
release/woocommerce-payments/assets/css/admin.rtl.css 1.08 kB
release/woocommerce-payments/assets/css/success.css 173 B
release/woocommerce-payments/assets/css/success.rtl.css 173 B
release/woocommerce-payments/dist/blocks-checkout-rtl.css 2.52 kB
release/woocommerce-payments/dist/blocks-checkout.css 2.52 kB
release/woocommerce-payments/dist/cart-block.js 16.3 kB
release/woocommerce-payments/dist/cart.js 5.73 kB
release/woocommerce-payments/dist/checkout-rtl.css 927 B
release/woocommerce-payments/dist/checkout.css 927 B
release/woocommerce-payments/dist/checkout.js 32.5 kB
release/woocommerce-payments/dist/express-checkout-rtl.css 240 B
release/woocommerce-payments/dist/express-checkout.css 240 B
release/woocommerce-payments/dist/frontend-tracks.js 858 B
release/woocommerce-payments/dist/index-rtl.css 39.2 kB
release/woocommerce-payments/dist/index.css 39.2 kB
release/woocommerce-payments/dist/multi-currency-analytics.js 1.08 kB
release/woocommerce-payments/dist/multi-currency-rtl.css 3.41 kB
release/woocommerce-payments/dist/multi-currency.css 3.41 kB
release/woocommerce-payments/dist/order-rtl.css 730 B
release/woocommerce-payments/dist/order.css 730 B
release/woocommerce-payments/dist/payment-gateways-rtl.css 1.35 kB
release/woocommerce-payments/dist/payment-gateways.css 1.35 kB
release/woocommerce-payments/dist/payment-request-rtl.css 240 B
release/woocommerce-payments/dist/payment-request.css 240 B
release/woocommerce-payments/dist/payment-request.js 13.7 kB
release/woocommerce-payments/dist/plugins-page-rtl.css 386 B
release/woocommerce-payments/dist/plugins-page.css 386 B
release/woocommerce-payments/dist/plugins-page.js 20.1 kB
release/woocommerce-payments/dist/product-details-rtl.css 433 B
release/woocommerce-payments/dist/product-details.css 436 B
release/woocommerce-payments/dist/product-details.js 11.5 kB
release/woocommerce-payments/dist/settings-rtl.css 11.6 kB
release/woocommerce-payments/dist/settings.css 11.5 kB
release/woocommerce-payments/dist/subscription-edit-page.js 703 B
release/woocommerce-payments/dist/subscription-product-onboarding-modal-rtl.css 524 B
release/woocommerce-payments/dist/subscription-product-onboarding-modal.css 524 B
release/woocommerce-payments/dist/subscription-product-onboarding-modal.js 20.2 kB
release/woocommerce-payments/dist/subscription-product-onboarding-toast.js 730 B
release/woocommerce-payments/dist/subscriptions-empty-state-rtl.css 120 B
release/woocommerce-payments/dist/subscriptions-empty-state.css 120 B
release/woocommerce-payments/dist/subscriptions-empty-state.js 19.3 kB
release/woocommerce-payments/dist/tokenized-payment-request-rtl.css 240 B
release/woocommerce-payments/dist/tokenized-payment-request.css 240 B
release/woocommerce-payments/dist/tokenized-payment-request.js 14.5 kB
release/woocommerce-payments/dist/tos-rtl.css 235 B
release/woocommerce-payments/dist/tos.css 235 B
release/woocommerce-payments/dist/tos.js 21.8 kB
release/woocommerce-payments/dist/woopay-direct-checkout.js 6.14 kB
release/woocommerce-payments/dist/woopay-rtl.css 4.54 kB
release/woocommerce-payments/dist/woopay.css 4.51 kB
release/woocommerce-payments/dist/woopay.js 71.3 kB
release/woocommerce-payments/includes/subscriptions/assets/css/plugin-page.css 625 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.46 kB
release/woocommerce-payments/vendor/automattic/jetpack-assets/build/jetpack-script-data.js 735 B
release/woocommerce-payments/vendor/automattic/jetpack-assets/build/react-jsx-runtime.js 553 B
release/woocommerce-payments/vendor/automattic/jetpack-assets/src/js/i18n-loader.js 1.02 kB
release/woocommerce-payments/vendor/automattic/jetpack-assets/src/js/script-data.js 69 B
release/woocommerce-payments/vendor/automattic/jetpack-connection/babel.config.js 163 B
release/woocommerce-payments/vendor/automattic/jetpack-connection/dist/identity-crisis.css 2.45 kB
release/woocommerce-payments/vendor/automattic/jetpack-connection/dist/identity-crisis.js 14.2 kB
release/woocommerce-payments/vendor/automattic/jetpack-connection/dist/identity-crisis.rtl.css 2.45 kB
release/woocommerce-payments/vendor/automattic/jetpack-connection/dist/jetpack-sso-admin-create-user.css 198 B
release/woocommerce-payments/vendor/automattic/jetpack-connection/dist/jetpack-sso-admin-create-user.js 280 B
release/woocommerce-payments/vendor/automattic/jetpack-connection/dist/jetpack-sso-admin-create-user.rtl.css 198 B
release/woocommerce-payments/vendor/automattic/jetpack-connection/dist/jetpack-sso-login.css 625 B
release/woocommerce-payments/vendor/automattic/jetpack-connection/dist/jetpack-sso-login.js 333 B
release/woocommerce-payments/vendor/automattic/jetpack-connection/dist/jetpack-sso-login.rtl.css 626 B
release/woocommerce-payments/vendor/automattic/jetpack-connection/dist/jetpack-sso-users.js 417 B
release/woocommerce-payments/vendor/automattic/jetpack-connection/dist/tracks-ajax.js 521 B
release/woocommerce-payments/vendor/automattic/jetpack-connection/dist/tracks-callables.js 584 B
release/woocommerce-payments/vendor/automattic/jetpack-connection/src/sso/jetpack-sso-admin-create-user.css 215 B
release/woocommerce-payments/vendor/automattic/jetpack-connection/src/sso/jetpack-sso-admin-create-user.js 521 B
release/woocommerce-payments/vendor/automattic/jetpack-connection/src/sso/jetpack-sso-login.css 721 B
release/woocommerce-payments/vendor/automattic/jetpack-connection/src/sso/jetpack-sso-login.js 412 B
release/woocommerce-payments/vendor/automattic/jetpack-connection/src/sso/jetpack-sso-users.js 621 B
release/woocommerce-payments/vendor/woocommerce/subscriptions-core/assets/css/about.css 1.04 kB
release/woocommerce-payments/vendor/woocommerce/subscriptions-core/assets/css/admin-empty-state.css 294 B
release/woocommerce-payments/vendor/woocommerce/subscriptions-core/assets/css/admin-order-statuses.css 408 B
release/woocommerce-payments/vendor/woocommerce/subscriptions-core/assets/css/admin.css 3.59 kB
release/woocommerce-payments/vendor/woocommerce/subscriptions-core/assets/css/checkout.css 301 B
release/woocommerce-payments/vendor/woocommerce/subscriptions-core/assets/css/modal.css 746 B
release/woocommerce-payments/vendor/woocommerce/subscriptions-core/assets/css/view-subscription.css 574 B
release/woocommerce-payments/vendor/woocommerce/subscriptions-core/assets/css/wcs-upgrade.css 414 B
release/woocommerce-payments/vendor/woocommerce/subscriptions-core/assets/js/admin/admin-pointers.js 543 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.78 kB
release/woocommerce-payments/vendor/woocommerce/subscriptions-core/assets/js/admin/jstz.min.js 3.84 kB
release/woocommerce-payments/vendor/woocommerce/subscriptions-core/assets/js/admin/meta-boxes-coupon.js 545 B
release/woocommerce-payments/vendor/woocommerce/subscriptions-core/assets/js/admin/meta-boxes-subscription.js 2.52 kB
release/woocommerce-payments/vendor/woocommerce/subscriptions-core/assets/js/admin/moment.js 22.2 kB
release/woocommerce-payments/vendor/woocommerce/subscriptions-core/assets/js/admin/moment.min.js 11.7 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 507 B
release/woocommerce-payments/vendor/woocommerce/subscriptions-core/assets/js/frontend/payment-methods.js 358 B
release/woocommerce-payments/vendor/woocommerce/subscriptions-core/assets/js/frontend/single-product.js 428 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 782 B
release/woocommerce-payments/vendor/woocommerce/subscriptions-core/assets/js/modal.js 1.09 kB
release/woocommerce-payments/vendor/woocommerce/subscriptions-core/assets/js/wcs-upgrade.js 1.26 kB
release/woocommerce-payments/vendor/woocommerce/subscriptions-core/build/index.css 391 B
release/woocommerce-payments/vendor/woocommerce/subscriptions-core/build/index.js 3.04 kB

compressed-size-action

@alexflorisca alexflorisca force-pushed the try/poc-express-checkout-button-styles branch from 066ccc5 to ca158f0 Compare August 12, 2024 13:07
@alexflorisca alexflorisca marked this pull request as ready for review August 12, 2024 14:16
@alexflorisca alexflorisca changed the title POC: Receive button properties from the Checkout Block Integrate express payments buttonAttributes API from the Checkout Block Aug 12, 2024
@haszari
Copy link
Contributor

haszari commented Aug 16, 2024

@alexflorisca is there an issue for this change? This PR looks like it slipped through the cracks. We use issues and focus area labels to assign things to teams (and get stuff merged ⇒ shipped).

@c-shultz it looks like this is front end / checkout related, could someone in shopper experience group take charge of this, e.g. review and go from there? FYI @vbelolapotkov – do we have a process for catching external contributor PRs like this one (from other teams in Woo, or external)?

@alexflorisca alexflorisca requested review from a team and removed request for a team August 19, 2024 11:46
Copy link
Contributor

@reykjalin reykjalin left a comment

Choose a reason for hiding this comment

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

This isn't testing very well for me. The Google Pay and Apple Pay ECE buttons don't render for me at all in this PR even though they do on develop. I'm honestly not sure why that is. There are no relevant errors in the browser console that I can see, and nothing obviously wrong in the code. And yet they don't render for me. I tried to track the issue down but couldn't figure it out.

Then there is the preview in the Cart Block while adjusting the button radius. That's something that needs to be fixed before we even consider releasing this in WC Core IMO:

Screen.Recording.2024-08-23.at.5.12.27.PM.mov

The border radius previews are incredibly wonky and don't provide an accurate representation of what the buttons will look like. Not mention that all three of them are different.

@pierorocca
Copy link
Contributor

Top level issue created. #9328
Good catch @haszari.

@pierorocca
Copy link
Contributor

PS Github needs a broader, funnier set of emojis.

⬜⬜⬜⬜⬜⬜⬜⬜🟧🟧🟧🟧🟧🟧🟧🟧⬜⬜⬜⬜⬜⬜⬜⬜
⬜⬜⬜⬜⬜⬜🟧🟧🟧🟧🟧🟧🟧🟧🟧🟧🟧🟧⬜⬜⬜⬜⬜⬜
⬜⬜⬜⬜⬜🟧🟧🟨🟨🟨🟨🟨🟨🟨🟨🟨🟨🟧🟧⬜⬜⬜⬜⬜
⬜⬜⬜⬜🟧🟧🟧🟨🟨🟨🟨🟨🟨🟨🟨🟨🟨🟧🟧🟧⬜⬜⬜⬜
⬜⬜⬜⬜🟧🟧🟨🟨🟨🟨🟨🟨🟨🟨🟨🟨🟨🟨🟧🟧⬜⬜⬜⬜
⬜⬜⬜🟧🟧🟨🟨🟨🟨🟨🟨🟨🟨🟨🟨🟨🟨🟨🟨🟧🟧⬜⬜⬜
⬜⬜🟧🟧🟨🟨🟨⬛⬛🟨🟨🟨🟨🟨🟨⬛⬛🟨🟨🟨🟧🟧⬜⬜
⬜⬜🟧🟨🟨⬛⬛🟨🟨🟨🟨🟨🟨🟨🟨🟨🟨⬛⬛🟨🟨🟧⬜⬜
⬜🟧🟧🟨⬛🟨🟨🟨🟨🟨🟨🟨🟨🟨🟨🟨🟨🟨🟨⬛🟨🟧🟧⬜
⬜🟧🟧🟨🟨🟨⬛⬛🟨🟨🟨🟨🟨🟨🟨🟨⬛⬛🟨🟨🟨🟧🟧⬜
⬜🟧🟧🟨🟨⬛⬛⬛⬛🟨🟨🟨🟨🟨🟨⬛⬛⬛⬛🟨🟨🟧🟧⬜
⬜🟧🟧🟨⬛⬛⬛⬛⬛⬛🟨🟨🟨🟨⬛⬛⬛⬛⬛⬛🟨🟧🟧⬜
⬜🟧🟧🟨⬛🟦🟦🟨🟨⬛🟨🟨🟨🟨⬛🟨🟨🟦🟦⬛🟨🟧🟧⬜
⬜🟧🟧🟦🟦🟦🟦🟨🟨🟨🟨🟨🟨🟨🟨🟨🟨🟦🟦🟦🟦🟧🟧⬜
⬜🟧🟦🟦⬜🟦🟦🟨🟨🟨🟨🟨🟨🟨🟨🟨🟨🟦🟦⬜🟦🟦🟧⬜
⬜🟦🟦⬜⬜🟦🟦⬛⬛⬛⬛⬛⬛⬛⬛⬛⬛🟦🟦⬜⬜🟦🟦⬜
🟦🟦⬜🟦🟦🟦⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜🟦🟦🟦⬜🟦🟦
🟦🟦🟦🟦🟦🟦⬛⬛⬛⬛⬛⬛⬛⬛⬛⬛⬛⬛🟦🟦🟦🟦🟦🟦
🟦🟦🟦🟦🟦🟦⬛⬛⬛⬛⬛⬛⬛⬛⬛⬛⬛⬛🟦🟦🟦🟦🟦🟦
🟦🟦🟦🟦🟦🟨⬛⬛⬛⬛⬛⬛⬛⬛⬛⬛⬛⬛🟨🟦🟦🟦🟦🟦
🟦🟦🟦🟦🟧🟧🟨⬛⬛⬛⬛⬛⬛⬛⬛⬛🟨🟨🟧🟧🟦🟦🟦🟦
⬜⬜⬜⬜🟧🟧🟧🟨🟨🟨⬛⬛⬛⬛🟨🟨🟨🟧🟧🟧⬜⬜⬜⬜
⬜⬜⬜⬜⬜🟧🟧🟧🟨🟨🟨🟨🟨🟨🟨🟨🟧🟧🟧⬜⬜⬜⬜⬜
⬜⬜⬜⬜⬜⬜🟧🟧🟧🟧🟧🟧🟧🟧🟧🟧🟧🟧⬜⬜⬜⬜⬜⬜
⬜⬜⬜⬜⬜⬜⬜⬜🟧🟧🟧🟧🟧🟧🟧🟧⬜⬜⬜⬜⬜⬜⬜⬜

@alexflorisca
Copy link
Member Author

Thanks for the review @reykjalin.

The Google Pay and Apple Pay ECE buttons don't render for me at all in this PR even though they do on develop

I'm not sure what's going on there, they seem to render ok for me with this branch 🤷

Can you test against the feature/express-payment-improvements branch on Woo Core? This holds all of the improvements to the express checkout area. The border radius problem should be solved there.

The border radius previews are incredibly wonky and don't provide an accurate representation of what the buttons will look like. Not mention that all three of them are different.

Agreed. This was an interim solution while working on rendering the actual buttons in the editor. At the moment, a lot of payment methods render images here, and the border radius is applied to the containing element.

I'm starting work on woocommerce/woocommerce#42353, which will solve this issue. This shouldn't require any more changes from WooPayments (maybe deprecating a prop, but that's it). So this improvement will come next, but I don't think it should be a blocker for this PR. It would be great to get this work out there before the work in Core is released.

@reykjalin
Copy link
Contributor

Can you test against the feature/express-payment-improvements branch on Woo Core?

That's the branch I was testing against 🙂

I'm starting work on woocommerce/woocommerce#42353, which will solve this issue […] this improvement will come next, but I don't think it should be a blocker for this PR. It would be great to get this work out there before the work in Core is released.

I appreciate that point of view, but I disagree 😕 . We've struggled with maintaining quality across our extensions and I don't think we should release this in WooPayments until the feature looks and feels good across the entire experience. Until it does I'd recommend we don't release this.

I know that runs the risk of making this PR stale, but I don't want us to release anything here until all the issues have been fleshed out.


I'm going to have really low availability for all of September so I don't think I can keep testing and reviewing the PR. @bborman22 is there someone else from Fractal that could take over the reviews here in my place?

@bborman22
Copy link
Contributor

I'm going to have really low availability for all of September so I don't think I can keep testing and reviewing the PR. @bborman22 is there someone else from Fractal that could take over the reviews here in my place?

@rafaelzaleski would you be able to take over the review for this PR in @reykjalin's absence? We can catch up on this on Slack as needed.

@alexflorisca
Copy link
Member Author

I appreciate that point of view, but I disagree 😕 . We've struggled with maintaining quality across our extensions and I don't think we should release this in WooPayments until the feature looks and feels good across the entire experience. Until it does I'd recommend we don't release this.

I appreciate what you're saying here, quality is important, and I wouldn't want to ship something broken. First and foremost, I'd like to make sure that everything in this PR works with the current WC release (without the express checkout work in core). I think that's key to releasing this in Woo Payments.

Secondly, I acknowledge. the difficulty in testing something that relies on parallel ongoing work. My plan was and still is to split this work into 2 parts in Core. The first part is done now, and it was around introducing the controls and tidying up the UX. The second is rendering the actual buttons in the editor, to better reflect the shopper's experience. That's ongoing now.

So I'd love for this PR to be tested with that in mind. I can create an issue to do some more testing once the second part of the work has been done in Core.

If there any issues related to the visual appearance of the buttons, or the controls not working, then we should address those before merging this. If the only concern is that the border radius controls are mis-represented in the editor, because they are applied to ALL buttons, I'd ask that we take into account that this won't be the case very soon.

Thanks for the healthy discussion around this, appreciate your efforts here and I'd like to work on finding a good solution to move forward with this.

Copy link
Contributor

@rafaelzaleski rafaelzaleski left a comment

Choose a reason for hiding this comment

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

There’s an issue with the WooPay button’s font size, and according to step 8 of the testing instructions:

  1. Notice both the height and the border radius are applied to the WooPay button, and only the height is applied to the payment request method.

However, the border radius is also being applied to the ECE buttons. I see you added a notice in the WooPayments settings, which I think is great to avoid confusion. I just wanted to mention this to confirm that this is the expected behavior.

Other than that, everything seems to be working great!

Blockers:

  • Fix the WooPay button font-size issue (it's very noticeable in Safari).
  • Do not show the notice in settings if it's not relevant (no cart or checkout blocks).
  • Render real ECE buttons in the preview (I'm ok with addressing this in a new PR).
Screenshot 2024-09-04 at 20 20 49

Comment on lines 199 to 201
<a href={ checkoutPageUrl }>
{ __( 'Cart & Checkout blocks.' ) }
</a>
Copy link
Contributor

Choose a reason for hiding this comment

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

I think we should add a checkoutPageUrl link to the word "checkout" and a cartPageUrl link to the word "cart." Also, we shouldn't render this notice at all if both are empty.

Copy link
Member Author

Choose a reason for hiding this comment

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

I had that to start with but I chose to only link to Checkout block for 2 reasons:

  1. Both include the same express payment controls
  2. Keep it simple for the merchant and give only 1 option
  3. It gets real messy with translations having to translate Cart, and, Checkout, block separately, because of the links.
    I think this is ok, but if you feel strongly about this I'm sure we can figure something out.

@alexflorisca
Copy link
Member Author

alexflorisca commented Sep 6, 2024

Thanks for the review @rafaelzaleski. I've left a comment regarding the Cart link and I've put the data-size attribute back in on the woo pay button.

Fix the WooPay button font-size issue (it's very noticeable in Safari).

I'm not seeing the font go quite as small as your screenshot there, so I wonder if you can provide more details about this? I can see the text change when changing size, but I think that's expected behaviour right? Or maybe adding the data-size back in fixed it? If you can give this another go and let me know that'd be great.

Screen.Recording.2024-09-06.at.17.15.42.mov

Do not show the notice in settings if it's not relevant (no cart or checkout blocks).

As far as I know, there's no client side flag to check if the default cart & checkout pages are block based or not. This is something that would be useful to have though, but it needs a change in Core. I can add an issue to both Core and here to make sure this gets done, but it might stall this PR a while. I think it's a nice to have optimisation, but I think we can move forward with this PR without it. What do you think?

However, the border radius is also being applied to the ECE buttons. I see you added a notice in the WooPayments settings, which I think is great to avoid confusion. I just wanted to mention this to confirm that this is the expected behavior.

Yes, I meant the actual PRB button, not the ECE ones. Which I think are the default ones now so that's ok.

Copy link
Contributor

@rafaelzaleski rafaelzaleski left a comment

Choose a reason for hiding this comment

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

Thank you for the changes. The font size of the WooPay button is working correctly again after re-adding the data-size attribute.

As far as I know, there's no client side flag to check if the default cart & checkout pages are block based or not. This is something that would be useful to have though, but it needs a change in Core. I can add an issue to both Core and here to make sure this gets done, but it might stall this PR a while. I think it's a nice to have optimisation, but I think we can move forward with this PR without it. What do you think?

I think that's fine, but we should remove the link from this notice. On my test site, clicking it redirects to the shortcode checkout. If we can't ensure the link points to the page where the settings might be overridden, it's better not to include a link.

@alexflorisca
Copy link
Member Author

Thanks @rafaelzaleski, I've removed the link from the notice for now.

Copy link
Contributor

@rafaelzaleski rafaelzaleski left a comment

Choose a reason for hiding this comment

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

I’ve tested the PR again, and everything seems to be working well. Thank you for taking the first step in integrating with the buttonAttributes API!

✅ The WooPay font-size issue has been resolved.
✅ The height and border-radius attributes are now passed from the editor to the buttons in the cart & checkout blocks, overriding the plugin settings, while the plugin settings are still applied on the shortcode cart & checkout pages.
✅ There are no regressions if the buttonAttributes API is not available.

Issues to be addressed in another PR:

@alexflorisca
Copy link
Member Author

Thank you for approving it. Seems that it's still hung up on @reykjalin's review needing changes so it's not giving me the green light to merge. Given you took over the review, I think it's ok to merge as is?

Copy link
Contributor

@reykjalin reykjalin left a comment

Choose a reason for hiding this comment

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

Trusting Rafael's review here, approving to unblock the merge :)

@alexflorisca alexflorisca added this pull request to the merge queue Sep 13, 2024
Merged via the queue into develop with commit e8a48cb Sep 13, 2024
25 checks passed
@alexflorisca alexflorisca deleted the try/poc-express-checkout-button-styles branch September 13, 2024 12:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
category: engineering For product engineering, architecture work, tech debt and so on. component: checkout Issues related to Checkout component: payment request button Apple Pay, Google Pay, etc focus: woopay type: spike
Projects
None yet
Development

Successfully merging this pull request may close these issues.

9 participants