Skip to content

Instantly share code, notes, and snippets.

@nielslange
Last active July 18, 2023 17:00
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save nielslange/48dae7bdf00023c35ef8b71862d42a1e to your computer and use it in GitHub Desktop.
Save nielslange/48dae7bdf00023c35ef8b71862d42a1e to your computer and use it in GitHub Desktop.
Snackbar notices » showRemoveCouponNotice
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