-
Notifications
You must be signed in to change notification settings - Fork 219
Add filter for place order button label #7154
Add filter for place order button label #7154
Conversation
The release ZIP for this PR is accessible via:
|
Size Change: +96 B (0%) Total Size: 916 kB
ℹ️ View Unchanged
|
….com:woocommerce/woocommerce-blocks into add/5876-add-place-order-button-label-filter # Conflicts: # assets/js/base/context/hooks/use-checkout-submit.js
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.
Thanks Niels, it's working great! Just a comment about the label name and some docs changes 😎
docs/third-party-developers/extensibility/checkout-block/available-filters.md
Outdated
Show resolved
Hide resolved
docs/third-party-developers/extensibility/checkout-block/available-filters.md
Show resolved
Hide resolved
…able-filters.md Co-authored-by: Thomas Roberts <[email protected]>
….com:woocommerce/woocommerce-blocks into add/5876-add-place-order-button-label-filter # Conflicts: # docs/third-party-developers/extensibility/checkout-block/available-filters.md
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.
Great work @nielslange, just a minor suggestion and a question. I like the way you took the initiative to correct some of the documentation formatting errors, thanks for that!
Co-authored-by: Alex Florisca <[email protected]>
Thanks for your review. I see that @senadir already answered the question, and I've committed your suggestion. Do you want to give it another review? |
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.
Nice work, looks good 👍
* WIP add filter for place order button label * Solve TS issue * Add display priority * Refactor display priority * WIP Implement useMemo() * Try using a global cache * Add docs for placeOrderLabel filter * Update docs/third-party-developers/extensibility/checkout-block/available-filters.md Co-authored-by: Thomas Roberts <[email protected]> * Adjust docs * Rename “placeOrderLabel” to “placeOrderButtonLabel” * Update assets/js/types/type-defs/payments.ts Co-authored-by: Alex Florisca <[email protected]> Co-authored-by: Nadir Seghir <[email protected]> Co-authored-by: Thomas Roberts <[email protected]> Co-authored-by: Alex Florisca <[email protected]> Co-authored-by: Lucio Giannotta <[email protected]>
Fixes #5876
Note
Currently, the
Place Order
button either showsPlace Order
or the payment method label, e.g.Proceed to PayPal
. However, it's not possible for a merchant to change the button label. This PR aims to add a filter to thePlace Order
button so that a merchant can change the label if needed.While testing this PR with multiple payment method, I noticed that
__experimentalRegisterCheckoutFilters
was returning the same result for all payment methods. In p1663160361460549-slack-C8X6Q7XQ, I reached out to @senadir who updated the caching mechanism of packages/checkout/filter-registry/index.ts. This update is also part of this PR.Testing
Verify that label filter works
/wp-admin/edit.php?post_type=custom-css-js
and add the following JS code snippet:Pay now
.Verify that payment method label still works.
/wp-admin/admin.php?page=snippets
and add the following PHP code snippet:/wp-admin/admin.php?page=wc-settings&tab=checkout§ion=paypal
and select the optionsEnable PayPal Standard
andEnable PayPal sandbox
.PayPal
.Proceed to PayPal
.Verify that default label still works.
PayPal
, e.g.Credit Card (Stripe)
.Place Order
.Verify that i18n of the default label still works.
/wp-admin/options-general.php
and selectGerman
as theSite Language
./wp-admin/update-core.php?force-check=1
and fetch translations.PayPal
, e.g.Credit Card (Stripe)
.Kostenpflichtig bestellen
.WooCommerce Visibility
Changelog