Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
WooCommerce Notices Simplest Examples
<?php // For implementation instructions see: https://aceplugins.com/how-to-add-a-code-snippet/
/**
* Showing default WooCommerce styles
*/
function ace_default_woocommerce_notice_styles() {
if ( is_admin() ) return;
wc_add_notice( 'This is a Success notice', 'success' );
wc_add_notice( 'This is a Error notice', 'error' );
wc_add_notice( 'This is a \'Notice\' notice', 'notice' );
}
add_action( 'woocommerce_init', 'ace_default_woocommerce_notice_styles' );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.