• Resolved edminluis

    (@edminluis)


    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)
  • Plugin Author XplodedThemes

    (@xplodedthemes)

    Hi Eddy,

    Sorry for the delay!

    We don’t use the hook however on the single product page, when adding a product to cart via ajax. The plugin will detect if there is any error messages within the ajax response based on the notice css class. If there is, it will output the notice at the top of the page.

    Can you provide the url where the issue is occuring? or maybe a video screencast?

    Thanks

    Thread Starter edminluis

    (@edminluis)

    Hi XplodedThemes!

    Thank you for your response, I will upload a video screencast as soon as possible so that you can see what I exactly mean.

    Kind Regards,

    Eddy

    Thread Starter edminluis

    (@edminluis)

    Hi,

    As promissed, see url below:
    See here

    It occurs when the minimum amount of 15€ is not met, I display a custom notice.
    When turning off your plug-in it works normally, but with your plugin active, it is displayed shortly 1-2 sec and then it disappears.

    As a workaround, I add another filter add_action( 'woocommerce_before_cart', 'wc_minimum_order_amount' ); , but then it will show it, disappear and show it again. I turned it off for now.

    Video: Video example issue

    • This reply was modified 5 years, 11 months ago by edminluis.
Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Plugin conflict with custom notice’ is closed to new replies.