From 48aad27c6191f4d3c299f72d7b4daf4e6999912c Mon Sep 17 00:00:00 2001 From: Brian Date: Thu, 14 Sep 2023 07:49:09 +0200 Subject: [PATCH] fix woocommerce/woocommerce-blocks#10918 (https://github.com/woocommerce/woocommerce-blocks/pull/10930) --- .../checkout-block/available-filters.md | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/plugins/woocommerce-blocks/docs/third-party-developers/extensibility/checkout-block/available-filters.md b/plugins/woocommerce-blocks/docs/third-party-developers/extensibility/checkout-block/available-filters.md index 5ffc066a7ef..c48d785990c 100644 --- a/plugins/woocommerce-blocks/docs/third-party-developers/extensibility/checkout-block/available-filters.md +++ b/plugins/woocommerce-blocks/docs/third-party-developers/extensibility/checkout-block/available-filters.md @@ -67,6 +67,21 @@ The word 'Total' that precedes the amount due, present in both the Cart _and_ Ch There are no additional arguments passed to this filter. +```ts +const { registerCheckoutFilters } = window.wc.blocksCheckout; + +// Adjust the total label. +registerCheckoutFilters( 'example-extension', { + totalLabel: ( value, extensions, args ) => { + return 'Deposit due today'; + } +} ); +``` + +| Before | After | +| ---------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------- | +| image | image | + ## Coupons The current functionality is to display the coupon codes in the Cart and Checkout sidebars. This could be undesirable if you dynamically generate a coupon code that is not user-friendly. It may, therefore, be desirable to change the way this code is displayed. To achieve this, the filter `coupons` exists. This filter could also be used to show or hide coupons. This filter must _not_ be used to alter the value/totals of a coupon. This will not carry through to the Cart totals.