-
Notifications
You must be signed in to change notification settings - Fork 69
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
Omit Test Mode badge in the Change payment method form #9615
Omit Test Mode badge in the Change payment method form #9615
Conversation
Test the buildOption 1. Jetpack Beta
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:
Note: the build is updated when a new commit is pushed to this PR. |
Size Change: +116 B (0%) Total Size: 1.33 MB
ℹ️ View Unchanged
|
&.wc_payment_methods, | ||
&.woocommerce-PaymentMethods { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The diff is a bit messy, but these are the only new selectors that were added, to prevent these styles to be applied in the change payment method form.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I can verify that this fixes the HTML output on the Woo Subscriptions Change Payment Method page and omits the Test Mode badge there. I've tested all the changes from #9495, and everything is still working as expected without any regressions.
Fixes #9616
Related to #9495
Changes proposed in this Pull Request
In order to show the "Test mode" badge, we need to insert HTML into the payment method title when rendering the form. This isn't a problem for WooCommerce core since the contents of
get_title
are not escaped. See: https://github.com/woocommerce/woocommerce/blob/trunk/plugins/woocommerce/templates/checkout/payment-method.php#L26However; WooCommerce Subscriptions recreates the code to render the form, but the plugin does escape the HTML, causing the HTML to be rendered as text. See: https://github.com/Automattic/woocommerce-subscriptions-core/blob/trunk/templates/checkout/form-change-payment-method.php#L70C81-L70C119
Testing instructions
Before
After
npm run changelog
to add a changelog file, choosepatch
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.Post merge