Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Visual changes to SPE in the classic checkout #4119

Merged
merged 9 commits into from
Mar 21, 2025

Conversation

wjrosa
Copy link
Contributor

@wjrosa wjrosa commented Mar 20, 2025

Fixes #3896

Changes proposed in this Pull Request:

We are updating the Single Payment Element implementation to make all the payment methods it renders to look just like any other WooCommerce payment method to avoid any UX impact for shoppers. However, the Stripe container has some styling limitations.

This PR applies the required styles for the classic/shortcode checkout.

Preview for multiple payment methods:
Screenshot 2025-03-20 at 15 29 51

Preview when Stripe is the only available method:
Screenshot 2025-03-20 at 15 30 36

This PR also disables the saving of methods and the display of instructions when SPE is enabled on the classic checkout, both will be handled by #4049 and #4048 respectively.

Testing instructions

  • Checkout and build this branch on your test environment (tweak/visual-changes-to-spe-in-classic-checkout)
  • Connect your Stripe account
  • On your Stripe dashboard, enable multiple payment methods
  • Copy your child payment method configuration ID from here: https://dashboard.stripe.com/settings/payment_methods (labeled "Your configuration")
  • Insert the ID above on client/classic/upe/payment-processing.js:136
  • Build the frontend files (npm run build:webpack)
  • Enable the SPE feature flag (_wcstripe_feature_spe). You can do it by either hardcoding the return value of is_spe_available to true or by running npm run wp option update _wcstripe_feature_spe 'yes'
  • As a merchant, disable the legacy checkout experience in settings (wp-admin/admin.php?page=wc-settings&tab=checkout&section=stripe&panel=settings)
  • Enable the Single Payment Element feature
  • I recommend setting your store currency to EUR so you can have more methods available
  • As a shopper, add any product to your cart
  • Go to the classic/shortcode checkout page
  • Confirm you can see all the payment methods rendered just like the previews above
  • Repeat the steps above after enabling another payment method (i.e., PayPal) and verify that it looks like the other preview above

  • Covered with tests (or have a good reason not to test in description ☝️)
  • Tested on mobile (or does not apply)

Changelog entry

  • This Pull Request does not require a changelog entry. (Comment required below)
Changelog Entry Comment

Comment

Post merge

@wjrosa wjrosa self-assigned this Mar 20, 2025
@wjrosa wjrosa marked this pull request as ready for review March 20, 2025 18:11
@wjrosa wjrosa requested review from a team and malithsen and removed request for a team March 20, 2025 18:54
Copy link
Contributor

@malithsen malithsen left a comment

Choose a reason for hiding this comment

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

Nice work!
Code looks good and tests well.

What do you think about using the same radio button colors within the iframe?
This color mismatch exists in develop as well but I think it's more prominent in the SPE. All good if you want to create a new issue for it.

CleanShot 2025-03-21 at 10 00 48

@wjrosa
Copy link
Contributor Author

wjrosa commented Mar 21, 2025

Nice work! Code looks good and tests well.

What do you think about using the same radio button colors within the iframe? This color mismatch exists in develop as well but I think it's more prominent in the SPE. All good if you want to create a new issue for it.

CleanShot 2025-03-21 at 10 00 48

Thanks for the review, Malith! I really appreciate it. I will remove the radio buttons in #4115, so I think it is not worth styling them anymore (that's why I used this PR to also remove some of the styles I applied before).

@wjrosa wjrosa enabled auto-merge (squash) March 21, 2025 18:35
@wjrosa wjrosa merged commit 2684530 into develop Mar 21, 2025
38 checks passed
@wjrosa wjrosa deleted the tweak/visual-changes-to-spe-in-classic-checkout branch March 21, 2025 18:42
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

SPE: Ensure rendered methods match WC style standards
2 participants