Remove old noticed on classic checkout when applying coupon code (#43244)

* Remove old noticed on classic checkout when applying coupon code

* Remove old noticed on classic checkout when applying coupon code

* Add changefile(s) from automation for the following project(s): woocommerce

---------

Co-authored-by: github-actions <github-actions@github.com>
This commit is contained in:
Niels Lange 2024-01-04 18:31:00 +07:00 committed by GitHub
parent f528361ec2
commit 0cffd32875
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 8 additions and 4 deletions

View File

@ -0,0 +1,4 @@
Significance: minor
Type: fix
Remove old noticed on classic checkout when applying coupon code

View File

@ -407,7 +407,7 @@ jQuery( function( $ ) {
var $form = $( 'form.checkout' );
// Remove notices from all sources
$( '.woocommerce-error, .woocommerce-message' ).remove();
$( '.woocommerce-error, .woocommerce-message, .is-error, .is-success' ).remove();
// Add new errors returned by this event
if ( data.messages ) {
@ -572,7 +572,7 @@ jQuery( function( $ ) {
return false;
},
submit_error: function( error_message ) {
$( '.woocommerce-NoticeGroup-checkout, .woocommerce-error, .woocommerce-message' ).remove();
$( '.woocommerce-NoticeGroup-checkout, .woocommerce-error, .woocommerce-message, .is-error, .is-success' ).remove();
wc_checkout_form.$checkout_form.prepend( '<div class="woocommerce-NoticeGroup woocommerce-NoticeGroup-checkout">' + error_message + '</div>' ); // eslint-disable-line max-len
wc_checkout_form.$checkout_form.removeClass( 'processing' ).unblock();
wc_checkout_form.$checkout_form.find( '.input-text, select, input:checkbox' ).trigger( 'validate' ).trigger( 'blur' );
@ -626,7 +626,7 @@ jQuery( function( $ ) {
url: wc_checkout_params.wc_ajax_url.toString().replace( '%%endpoint%%', 'apply_coupon' ),
data: data,
success: function( code ) {
$( '.woocommerce-error, .woocommerce-message' ).remove();
$( '.woocommerce-error, .woocommerce-message, .is-error, .is-success' ).remove();
$form.removeClass( 'processing' ).unblock();
if ( code ) {
@ -666,7 +666,7 @@ jQuery( function( $ ) {
url: wc_checkout_params.wc_ajax_url.toString().replace( '%%endpoint%%', 'remove_coupon' ),
data: data,
success: function( code ) {
$( '.woocommerce-error, .woocommerce-message' ).remove();
$( '.woocommerce-error, .woocommerce-message, .is-error, .is-success' ).remove();
container.removeClass( 'processing' ).unblock();
if ( code ) {