Last active
July 18, 2023 17:00
-
-
Save nielslange/48dae7bdf00023c35ef8b71862d42a1e to your computer and use it in GitHub Desktop.
Snackbar notices » showRemoveCouponNotice
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; | |
// Prevent a couponCode called '10off' from creating a notice when it gets removed. | |
registerCheckoutFilters( 'example-extension', { | |
showRemoveCouponNotice: ( value, extensions, { couponCode } ) => { | |
return couponCode === '10off' ? false : value; | |
} | |
} ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment