javascript - Make "all" woocommerce errors fade out after a certain interval
Get the solution ↓↓↓i found this to make checkout errors fade out, which works:
add_action( 'wp_footer', 'checkout_fadeout_error_message');
function checkout_fadeout_error_message() {
// Only on front-end and checkout page
if( is_checkout() && ! is_wc_endpoint_url() ) :
?>
<script>
jQuery(function($){
$(document.body).on( 'checkout_error', function(){
var wooError = $('.woocommerce-error');
setTimeout(function(){
wooError.fadeOut(160);
}, 4000);
})
});
</script>
<?php
endif;
}
However, this only works on checkout errors.
What i wan't is to make ALL woocommerce errors fade out, also the errors on cart page etc..
Is it possible to do this, and make each woocommerce error fade out with a different interval, so lets say there's 3 checkout errors, then each error fade out with a 50millisecond interval in between?
Share solution ↓
Additional Information:
Link To Answer People are also looking for solutions of the problem: sqlstate[hy000] [1698] access denied for user 'root'@'localhost'
Didn't find the answer?
Our community is visited by hundreds of web development professionals every day. Ask your question and get a quick answer for free.
Similar questions
Find the answer in similar questions on our website.
Write quick answer
Do you know the answer to this question? Write a quick response to it. With your help, we will make our community stronger.