Skip to content

Commit 875a4f6

Browse files
committed
Cart tab 1.1.2
1 parent ea5465a commit 875a4f6

File tree

5 files changed

+20
-8
lines changed

5 files changed

+20
-8
lines changed

assets/js/cart-tab.js

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,15 @@
7878
});
7979

8080
setCartHeight();
81+
82+
/**
83+
* Hide cart tab when cart is empty
84+
*/
85+
jQuery( 'body' ).on( 'removed_from_cart', function() {
86+
if ( Cookies.get( 'woocommerce_items_in_cart' ) == null ) {
87+
hideCart();
88+
}
89+
});
8190
});
8291

8392
/**

assets/js/cart-tab.min.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

cart-tab.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,10 @@
22
/**
33
* Plugin Name: WooCommerce Cart Tab
44
* Plugin URI: http://jameskoster.co.uk/tag/cart-tab/
5-
* Version: 1.1.1
5+
* Version: 1.1.2
66
* Description: Displays a sitewide link to the cart which reveals the cart contents on hover.
77
* Author: jameskoster
8-
* Tested up to: 4.7.3
8+
* Tested up to: 4.9.6
99
* Author URI: http://jameskoster.co.uk
1010
* Text Domain: woocommerce-cart-tab
1111
* Domain Path: /languages/
@@ -56,7 +56,7 @@ class WooCommerce_Cart_Tab {
5656
*/
5757
public function __construct() {
5858
$this->token = 'woocommerce-cart-tab';
59-
$this->version = '1.1.1';
59+
$this->version = '1.1.2';
6060
$this->setup();
6161
register_activation_hook( __FILE__, array( $this, 'install' ) );
6262
}

includes/class-cart-tab-frontend.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ class WooCommerce_Cart_Tab_Frontend {
2525
*/
2626
public function __construct() {
2727
add_action( 'wp_enqueue_scripts', array( $this, 'setup_styles' ), 999 );
28-
28+
2929
if ( version_compare( WC_VERSION, '2.7', '<' ) ) {
3030
add_filter( 'add_to_cart_fragments', array( $this, 'woocommerce_cart_tab_add_to_cart_fragment' ) );
3131
} else {

readme.txt

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@
22
Contributors: jameskoster
33
Tags: woocommerce, ecommerce, cart
44
Requires at least: 4.4
5-
Tested up to: 4.7.3
6-
Stable tag: 1.1.1
5+
Tested up to: 4.9.6
6+
Stable tag: 1.1.2
77
License: GPLv2 or later
88
License URI: http://www.gnu.org/licenses/gpl-2.0.html
99

@@ -44,6 +44,9 @@ Thanks! Please fork the repo on <a href="https://github.com/jameskoster/woocomme
4444

4545
== Changelog ==
4646

47+
= 1.1.2 - 05/07/2018 =
48+
* Fix - Cart panel will now close automatically when the cart is emptied.
49+
4750
= 1.1.1 - 10/03/2017 =
4851
* Tweak - WooCommerce 2.7 support. Kudos @webmandesign.
4952
* Dev - Scripts and styles now versioned correctly.
@@ -92,4 +95,4 @@ Thanks! Please fork the repo on <a href="https://github.com/jameskoster/woocomme
9295
* Stripped object pass by reference
9396

9497
= 0.1 =
95-
Initial release.
98+
Initial release.

0 commit comments

Comments
 (0)