Hide woocommerce-message in couple seconds

Issue

I tried to use this code to hide woocommerce-message but it doesn’t work.

  setTimeout(function() {
    $('.woocommerce-message').fadeOut('fast');
}, 5000); // <-- time in mseconds

Do you any another solutions ? I tried to put this code into header.php and my template has space for Custom Header JavaScript Code but nothing works.

Solution

This worked for me.

    setTimeout(function() {
        $('.woocommerce-message').fadeOut('fast') 
    }, 5000);

If you’re using wordpress, try

    setTimeout(function() {
        jQuery('.woocommerce-message').fadeOut('fast') 
    }, 5000);

This link may help you as well: jQuery | on click fade out and / or automatically fade out

Answered By – John Regalado

Answer Checked By – Jay B. (AngularFixing Admin)

Leave a Reply

Your email address will not be published.