Remove all notices on fail

This commit is contained in:
Mike Jolley 2016-06-23 13:47:24 +01:00
parent 7513f40a9d
commit f6a42e55ac
1 changed files with 3 additions and 0 deletions

View File

@ -300,6 +300,9 @@ jQuery( function( $ ) {
var $form = $( 'form.checkout' );
// Remove notices from all sources
$( '.woocommerce-error, .woocommerce-message' ).remove();
// Add new errors returned by this event
if ( data.messages ) {
$form.prepend( '<div class="woocommerce-NoticeGroup-updateOrderReview">' + data.messages + '</div>' );