Created
July 18, 2023 17:19
-
-
Save nielslange/37971452ef72997c1c83eb67e0d22622 to your computer and use it in GitHub Desktop.
Order Summary Items filter » subtotalPriceFormat
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const { registerCheckoutFilters } = window.wc.blocksCheckout; | |
// Adjust subtotal price format of the order summary items. | |
registerCheckoutFilters( 'example-extension', { | |
subtotalPriceFormat: ( value, extensions, args ) => { | |
// Return early since this filter is not being applied in the Summary context. | |
// We must return the original value we received here. | |
if ( args?.context !== 'summary' ) { | |
return value; | |
} | |
return '<price/> per item'; | |
} | |
} ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment