Merge pull request #2664 from krbvroc1/fix_cart_widget_hiding
Fix hide cart if empty
This commit is contained in:
commit
e2da14e491
|
@ -79,10 +79,10 @@ class WC_Widget_Cart extends WP_Widget {
|
|||
|
||||
if ( $hide_if_empty && sizeof( $woocommerce->cart->get_cart() ) == 0 ) {
|
||||
$woocommerce->add_inline_js( "
|
||||
jQuery('.hide_cart_widget_if_empty').closest('.widget').hide();
|
||||
jQuery('.hide_cart_widget_if_empty').closest('.widget_shopping_cart').hide();
|
||||
|
||||
jQuery('body').bind('adding_to_cart', function(){
|
||||
jQuery('.hide_cart_widget_if_empty').closest('.widget').fadeIn();
|
||||
jQuery('.hide_cart_widget_if_empty').closest('.widget_shopping_cart').fadeIn();
|
||||
});
|
||||
" );
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue