Last active
July 18, 2023 17:06
-
-
Save nielslange/6021aef633d1029e08044afe39fd4c0a to your computer and use it in GitHub Desktop.
Order Summary Items filter » itemName
This file contains 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 item name of the order summary items. | |
registerCheckoutFilters( 'example-extension', { | |
itemName: ( 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 '🪴 ' + value + ' 🪴'; | |
} | |
} ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment