Place Order Button Label: Add code snippet and screenshot (https://github.com/woocommerce/woocommerce-blocks/pull/10932)

* Place Order Button Label: Add code snippet and screenshot

* add before screenshot
This commit is contained in:
Brian 2023-09-14 06:07:25 +02:00 committed by GitHub
parent fd83e0a4cb
commit 461aa1d5d3
1 changed files with 15 additions and 0 deletions

View File

@ -120,6 +120,21 @@ The Checkout block contains a button which is labelled 'Place Order' by default,
| ----------------------- | ------------------------------------------- | ----------- |
| `placeOrderButtonLabel` | The wanted label of the Place Order button. | `string` |
```ts
const { registerCheckoutFilters } = window.wc.blocksCheckout;
// Adjust the place order button label.
registerCheckoutFilters( 'example-extension', {
placeOrderButtonLabel: ( value, extensions, args ) => {
return '💰 Pay now 💰';
}
} );
```
| Before | After |
| ---------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------- |
| <img width="761" alt="image" src="https://github.com/masteradhoc/woocommerce-blocks/assets/6242098/5703a5a6-39f4-4c29-a176-1a80412e3de9"> | <img width="761" alt="image" src="https://user-images.githubusercontent.com/3323310/267271739-3a8babc4-2848-424b-bc4a-8137eb2b2746.png"> |
## Additional Cart Checkout inner block types
The Cart and Checkout blocks are made up of inner blocks. These inner blocks areas allow certain block types to be added as children. By default, only `core/paragraph`, `core/image`, and `core/separator` are available to add.