Plugin conflict with custom notice
-
Hi there,
First of all, I love your plug-in and it has been working beautifully since last year.
However, with the more recent versions (not sure when it happened), I noticed the following. When you have a custom notice / error message set in Woocommerce – Like I do – it behaves strangely; it shows the message on my cart page for a brief moment but then it disappears.
When I deactivate your plugin the custom notice is displayed properly like before.
See my code below:add_action( 'woocommerce_check_cart_items', 'wc_minimum_order_amount', 20 ); function wc_minimum_order_amount() { // Set this variable to specify a minimum order value $minimum = 15; if ( WC()->cart->subtotal < $minimum ) { if( is_checkout()||is_page('cart')||is_cart() ) { wc_clear_notices(); wc_add_notice( sprintf( 'You need to have a minimum of %s to checkout, your total is now %s.' , wc_price( $minimum ), wc_price( WC()->cart->subtotal ) ), 'error' ); } } }
My question is do you guys use the woocommerce_check_cart_items hook or now why this may cause a conflict with your plugin?
Thank you in advance.
Regards,
Eddy
Viewing 3 replies - 1 through 3 (of 3 total)
Viewing 3 replies - 1 through 3 (of 3 total)
- The topic ‘Plugin conflict with custom notice’ is closed to new replies.