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.
if the element pops up and is inserted into the dom randomly you can use an approach like this to remove it.
This worked for me.
If you’re using wordpress, try
This link may help you as well: jQuery | on click fade out and / or automatically fade out
It show the error when we use
$(e.target)
.so ignoring the I have add tweak.
Good luck.