Displaying WooCommerce notices as popup alerts
-
Hello everyone,
I’m making a WooCommerce based e-commerce and I was wandering about how to change the default behaviour of an error alert on a site page on user side (for example: product cannot be added to cart).
Within the default settings, WooCommerce use the
woocommerce_cart_redirect_after_error
that firstly redirects users on a product page and then, on that page, it displays the error alert (i’m using a multivendor plugin that calls thewp_add_notice()
).
I was able to disable this redirect by addingadd_filter( 'woocommerce_cart_redirect_after_error', '__return_false' );
: the alert notice is not displaying on the same page while the redirect is off.What i would like to do is to display the alert on the same page or, better, turn any notice in WP and WooCommerce in an alert (intended as a classic popup alert).
Thank you.
- The topic ‘Displaying WooCommerce notices as popup alerts’ is closed to new replies.