From 3fae170c14266f140861033b67b7b25311d6ef5f Mon Sep 17 00:00:00 2001 From: Ron Rennick Date: Tue, 15 Jan 2019 14:44:28 -0400 Subject: [PATCH 1/2] notify script plugins that the cart was emptied --- assets/js/frontend/cart.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/assets/js/frontend/cart.js b/assets/js/frontend/cart.js index db9e1d71d14..6c2f4ba1cbe 100644 --- a/assets/js/frontend/cart.js +++ b/assets/js/frontend/cart.js @@ -95,6 +95,9 @@ jQuery( function( $ ) { if ( $notices.length > 0 ) { show_notice( $notices ); } + + // Notify plugins that the cart was emptied. + $( document.body ).trigger( 'updated_cart_emptied' ); } else { // If the checkout is also displayed on this page, trigger update event. if ( $( '.woocommerce-checkout' ).length ) { From 5bba7037236b44388469baa67a467af6def8f789 Mon Sep 17 00:00:00 2001 From: Ron Rennick Date: Wed, 16 Jan 2019 10:36:35 -0400 Subject: [PATCH 2/2] update trigger name to `wc_cart_emptied` --- assets/js/frontend/cart.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/assets/js/frontend/cart.js b/assets/js/frontend/cart.js index 6c2f4ba1cbe..70de56b9827 100644 --- a/assets/js/frontend/cart.js +++ b/assets/js/frontend/cart.js @@ -97,7 +97,7 @@ jQuery( function( $ ) { } // Notify plugins that the cart was emptied. - $( document.body ).trigger( 'updated_cart_emptied' ); + $( document.body ).trigger( 'wc_cart_emptied' ); } else { // If the checkout is also displayed on this page, trigger update event. if ( $( '.woocommerce-checkout' ).length ) {