WooCommerce Cart Tab - Version 1.1.2

Version Description

  • 05/07/2018 =
  • Fix - Cart panel will now close automatically when the cart is emptied.
Download this release

Release Info

Developer jameskoster
Plugin Icon wp plugin WooCommerce Cart Tab
Version 1.1.2
Comparing to
See all releases

Code changes from version 1.1.1 to 1.1.2

assets/js/cart-tab.js CHANGED
@@ -78,6 +78,15 @@
78
  });
79
 
80
  setCartHeight();
 
 
 
 
 
 
 
 
 
81
  });
82
 
83
  /**
78
  });
79
 
80
  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
+ });
90
  });
91
 
92
  /**
assets/js/cart-tab.min.js CHANGED
@@ -1 +1 @@
1
- !function(){function a(){var a=jQuery(window).width();if(a>768){if(jQuery(".woocommerce-cart-tab-container").hasClass("woocommerce-cart-tab-container--visible"))return;jQuery(".woocommerce-cart-tab-container").addClass("woocommerce-cart-tab-container--visible"),jQuery("body").toggleClass("woocommerce-cart-tab-is-visible")}}function b(){var a=jQuery(window).height(),b=jQuery(window).width();b>768&&(jQuery("body").hasClass("admin-bar")?jQuery(".woocommerce-cart-tab-container .widget_shopping_cart").css("height",a-32):jQuery(".woocommerce-cart-tab-container .widget_shopping_cart").css("height",a))}jQuery(document).mouseup(function(a){var b=jQuery(".woocommerce-cart-tab-container");jQuery(".button.add_to_cart_button").is(a.target)||b.is(a.target)||0!==b.has(a.target).length||!b.hasClass("woocommerce-cart-tab-container--visible")||(b.removeClass("woocommerce-cart-tab-container--visible"),jQuery("body").removeClass("woocommerce-cart-tab-is-visible"))}),jQuery(document).ready(function(){jQuery("body").on("added_to_cart",function(){a()}),b()}),jQuery(window).resize(function(){b()})}();
1
+ !function(){function e(){var e=jQuery(window).height();jQuery(window).width()>768&&(jQuery("body").hasClass("admin-bar")?jQuery(".woocommerce-cart-tab-container .widget_shopping_cart").css("height",e-32):jQuery(".woocommerce-cart-tab-container .widget_shopping_cart").css("height",e))}jQuery(document).mouseup(function(e){var o=jQuery(".woocommerce-cart-tab-container");jQuery(".button.add_to_cart_button").is(e.target)||o.is(e.target)||0!==o.has(e.target).length||!o.hasClass("woocommerce-cart-tab-container--visible")||(o.removeClass("woocommerce-cart-tab-container--visible"),jQuery("body").removeClass("woocommerce-cart-tab-is-visible"))}),jQuery(document).ready(function(){jQuery("body").on("added_to_cart",function(){!function(){if(jQuery(window).width()>768){if(jQuery(".woocommerce-cart-tab-container").hasClass("woocommerce-cart-tab-container--visible"))return;jQuery(".woocommerce-cart-tab-container").addClass("woocommerce-cart-tab-container--visible"),jQuery("body").toggleClass("woocommerce-cart-tab-is-visible")}}()}),e(),jQuery("body").on("removed_from_cart",function(){null==Cookies.get("woocommerce_items_in_cart")&&(jQuery(window).width()>768&&jQuery(".woocommerce-cart-tab-container").removeClass("woocommerce-cart-tab-container--visible"),jQuery("body").toggleClass("woocommerce-cart-tab-is-visible"))})}),jQuery(window).resize(function(){e()})}();
cart-tab.php CHANGED
@@ -2,10 +2,10 @@
2
  /**
3
  * Plugin Name: WooCommerce Cart Tab
4
  * Plugin URI: http://jameskoster.co.uk/tag/cart-tab/
5
- * Version: 1.1.1
6
  * Description: Displays a sitewide link to the cart which reveals the cart contents on hover.
7
  * Author: jameskoster
8
- * Tested up to: 4.7.3
9
  * Author URI: http://jameskoster.co.uk
10
  * Text Domain: woocommerce-cart-tab
11
  * Domain Path: /languages/
@@ -56,7 +56,7 @@ if ( in_array( 'woocommerce/woocommerce.php', apply_filters( 'active_plugins', g
56
  */
57
  public function __construct() {
58
  $this->token = 'woocommerce-cart-tab';
59
- $this->version = '1.1.1';
60
  $this->setup();
61
  register_activation_hook( __FILE__, array( $this, 'install' ) );
62
  }
2
  /**
3
  * Plugin Name: WooCommerce Cart Tab
4
  * Plugin URI: http://jameskoster.co.uk/tag/cart-tab/
5
+ * Version: 1.1.2
6
  * Description: Displays a sitewide link to the cart which reveals the cart contents on hover.
7
  * Author: jameskoster
8
+ * Tested up to: 4.9.6
9
  * Author URI: http://jameskoster.co.uk
10
  * Text Domain: woocommerce-cart-tab
11
  * Domain Path: /languages/
56
  */
57
  public function __construct() {
58
  $this->token = 'woocommerce-cart-tab';
59
+ $this->version = '1.1.2';
60
  $this->setup();
61
  register_activation_hook( __FILE__, array( $this, 'install' ) );
62
  }
includes/class-cart-tab-frontend.php CHANGED
@@ -25,7 +25,7 @@ if ( ! class_exists( 'WooCommerce_Cart_Tab_Frontend' ) ) :
25
  */
26
  public function __construct() {
27
  add_action( 'wp_enqueue_scripts', array( $this, 'setup_styles' ), 999 );
28
-
29
  if ( version_compare( WC_VERSION, '2.7', '<' ) ) {
30
  add_filter( 'add_to_cart_fragments', array( $this, 'woocommerce_cart_tab_add_to_cart_fragment' ) );
31
  } else {
25
  */
26
  public function __construct() {
27
  add_action( 'wp_enqueue_scripts', array( $this, 'setup_styles' ), 999 );
28
+
29
  if ( version_compare( WC_VERSION, '2.7', '<' ) ) {
30
  add_filter( 'add_to_cart_fragments', array( $this, 'woocommerce_cart_tab_add_to_cart_fragment' ) );
31
  } else {
readme.txt CHANGED
@@ -2,8 +2,8 @@
2
  Contributors: jameskoster
3
  Tags: woocommerce, ecommerce, cart
4
  Requires at least: 4.4
5
- Tested up to: 4.7.3
6
- Stable tag: 1.1.1
7
  License: GPLv2 or later
8
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
9
 
@@ -44,6 +44,9 @@ Thanks! Please fork the repo on <a href="https://github.com/jameskoster/woocomme
44
 
45
  == Changelog ==
46
 
 
 
 
47
  = 1.1.1 - 10/03/2017 =
48
  * Tweak - WooCommerce 2.7 support. Kudos @webmandesign.
49
  * Dev - Scripts and styles now versioned correctly.
@@ -92,4 +95,4 @@ Thanks! Please fork the repo on <a href="https://github.com/jameskoster/woocomme
92
  * Stripped object pass by reference
93
 
94
  = 0.1 =
95
- Initial release.
2
  Contributors: jameskoster
3
  Tags: woocommerce, ecommerce, cart
4
  Requires at least: 4.4
5
+ Tested up to: 4.9.6
6
+ Stable tag: 1.1.2
7
  License: GPLv2 or later
8
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
9
 
44
 
45
  == Changelog ==
46
 
47
+ = 1.1.2 - 05/07/2018 =
48
+ * Fix - Cart panel will now close automatically when the cart is emptied.
49
+
50
  = 1.1.1 - 10/03/2017 =
51
  * Tweak - WooCommerce 2.7 support. Kudos @webmandesign.
52
  * Dev - Scripts and styles now versioned correctly.
95
  * Stripped object pass by reference
96
 
97
  = 0.1 =
98
+ Initial release.