Last active
July 18, 2023 17:01
-
-
Save nielslange/f0a80d007fcb9ca99449ce1dacdd476d to your computer and use it in GitHub Desktop.
Snackbar notices » showApplyCouponNotice
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 applied. | |
registerCheckoutFilters( 'example-extension', { | |
showApplyCouponNotice: ( 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