Version Description
- 04/17/2014 =
- Fix - Hide the tab shadow when the cart is hidden.
Download this release
Release Info
Developer | jameskoster |
Plugin | WooCommerce Cart Tab |
Version | 0.3.1 |
Comparing to | |
See all releases |
Code changes from version 0.3.0 to 0.3.1
- assets/css/style.css +1 -1
- assets/css/style.less +3 -0
- cart-tab.php +12 -12
- readme.txt +5 -2
assets/css/style.css
CHANGED
@@ -1 +1 @@
|
|
1 |
-
.cart-tab{width:22em;position:fixed;top:5em;z-index:9999999}.cart-tab a.cart-parent{position:absolute;top:0;display:block;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;padding:1.618em;text-decoration:none}.cart-tab a.cart-parent span.contents{display:block;color:#666;font-size:.8em}.cart-tab a.cart-parent:hover{text-decoration:none}.cart-tab .widget{padding:1.618em;margin:0}.cart-tab.light{background:#fff}.cart-tab.light a.cart-parent,.cart-tab.light .widget{box-shadow:0 2px 1em 0 rgba(0,0,0,0.2);-webkit-box-shadow:0 2px 1em 0 rgba(0,0,0,0.2);-moz-box-shadow:0 2px 1em 0 rgba(0,0,0,0.2);-o-box-shadow:0 2px 1em 0 rgba(0,0,0,0.2)}.cart-tab.light a.cart-parent{background:#fff}.cart-tab.light a.cart-parent:after{content:"";display:block;width:10px;height:100%;background:#fff;position:absolute;top:0;right:-10px}.cart-tab.dark{background:#333}.cart-tab.dark a.cart-parent,.cart-tab.dark .widget{box-shadow:0 2px 1em 0 rgba(0,0,0,0.2);-webkit-box-shadow:0 2px 1em 0 rgba(0,0,0,0.2);-moz-box-shadow:0 2px 1em 0 rgba(0,0,0,0.2);-o-box-shadow:0 2px 1em 0 rgba(0,0,0,0.2)}.cart-tab.dark a.cart-parent{background:#333}.cart-tab.dark a.cart-parent:after{content:"";display:block;width:10px;height:100%;background:#333;position:absolute;top:0;right:-10px}.cart-tab.right{right:-22em;-webkit-transition:right ease .5s;-moz-transition:right ease .5s;-o-transition:right ease .5s;transition:right ease .5s}.cart-tab.right a.cart-parent{left:-8.402328em;width:8.402328em;-webkit-transition:left ease .5s;-moz-transition:left ease .5s;-o-transition:left ease .5s;transition:left ease .5s;-webkit-border-top-left-radius:3px;-webkit-border-bottom-left-radius:3px;-moz-border-radius-topleft:3px;-moz-border-radius-bottomleft:3px;border-top-left-radius:3px;border-bottom-left-radius:3px}.cart-tab.right a.cart-parent.hidden{left:0}.cart-tab.right a.cart-parent.visible{left:-8.402328em}.cart-tab.right:hover{right:0}.cart-tab.right .widget{-webkit-border-bottom-left-radius:3px;-webkit-border-bottom-right-radius:3px;-moz-border-radius-bottomleft:3px;-moz-border-radius-bottomright:3px;border-bottom-left-radius:3px;border-bottom-right-radius:3px;-webkit-border-top-right-radius:0;-webkit-border-bottom-right-radius:0;-moz-border-radius-topright:0;-moz-border-radius-bottomright:0;border-top-right-radius:0;border-bottom-right-radius:0}.cart-tab.left{left:-22em;-webkit-transition:left ease .5s;-moz-transition:left ease .5s;-o-transition:left ease .5s;transition:left ease .5s}.cart-tab.left a.cart-parent{right:-8.402328em;width:8.402328em;-webkit-transition:right ease .5s;-moz-transition:right ease .5s;-o-transition:right ease .5s;transition:right ease .5s;-webkit-border-top-right-radius:3px;-webkit-border-bottom-right-radius:3px;-moz-border-radius-topright:3px;-moz-border-radius-bottomright:3px;border-top-right-radius:3px;border-bottom-right-radius:3px}.cart-tab.left a.cart-parent.hidden{right:0}.cart-tab.left a.cart-parent.visible{right:-8.402328em}.cart-tab.left:hover{left:0}.cart-tab.left .widget{-webkit-border-bottom-left-radius:3px;-webkit-border-bottom-right-radius:3px;-moz-border-radius-bottomleft:3px;-moz-border-radius-bottomright:3px;border-bottom-left-radius:3px;border-bottom-right-radius:3px;-webkit-border-top-left-radius:0;-webkit-border-bottom-left-radius:0;-moz-border-radius-topleft:0;-moz-border-radius-bottomleft:0;border-top-left-radius:0;border-bottom-left-radius:0}.cart-tab.left.light a.cart-parent:after,.cart-tab.left.dark a.cart-parent:after{right:auto;left:-10px}.cart-tab.no-animation.right:hover{right:-22em}.cart-tab.no-animation.left:hover{left:-22em}
|
1 |
+
.cart-tab{width:22em;position:fixed;top:5em;z-index:9999999}.cart-tab a.cart-parent{position:absolute;top:0;display:block;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;padding:1.618em;text-decoration:none}.cart-tab a.cart-parent span.contents{display:block;color:#666;font-size:.8em}.cart-tab a.cart-parent:hover{text-decoration:none}.cart-tab .widget{padding:1.618em;margin:0}.cart-tab.light{background:#fff}.cart-tab.light a.cart-parent,.cart-tab.light .widget{box-shadow:0 2px 1em 0 rgba(0,0,0,0.2);-webkit-box-shadow:0 2px 1em 0 rgba(0,0,0,0.2);-moz-box-shadow:0 2px 1em 0 rgba(0,0,0,0.2);-o-box-shadow:0 2px 1em 0 rgba(0,0,0,0.2)}.cart-tab.light a.cart-parent{background:#fff}.cart-tab.light a.cart-parent:after{content:"";display:block;width:10px;height:100%;background:#fff;position:absolute;top:0;right:-10px}.cart-tab.dark{background:#333}.cart-tab.dark a.cart-parent,.cart-tab.dark .widget{box-shadow:0 2px 1em 0 rgba(0,0,0,0.2);-webkit-box-shadow:0 2px 1em 0 rgba(0,0,0,0.2);-moz-box-shadow:0 2px 1em 0 rgba(0,0,0,0.2);-o-box-shadow:0 2px 1em 0 rgba(0,0,0,0.2)}.cart-tab.dark a.cart-parent{background:#333}.cart-tab.dark a.cart-parent:after{content:"";display:block;width:10px;height:100%;background:#333;position:absolute;top:0;right:-10px}.cart-tab.right{right:-22em;-webkit-transition:right ease .5s;-moz-transition:right ease .5s;-o-transition:right ease .5s;transition:right ease .5s}.cart-tab.right a.cart-parent{left:-8.402328em;width:8.402328em;-webkit-transition:left ease .5s;-moz-transition:left ease .5s;-o-transition:left ease .5s;transition:left ease .5s;-webkit-border-top-left-radius:3px;-webkit-border-bottom-left-radius:3px;-moz-border-radius-topleft:3px;-moz-border-radius-bottomleft:3px;border-top-left-radius:3px;border-bottom-left-radius:3px}.cart-tab.right a.cart-parent.hidden{left:0}.cart-tab.right a.cart-parent.visible{left:-8.402328em}.cart-tab.right:hover{right:0}.cart-tab.right .widget{-webkit-border-bottom-left-radius:3px;-webkit-border-bottom-right-radius:3px;-moz-border-radius-bottomleft:3px;-moz-border-radius-bottomright:3px;border-bottom-left-radius:3px;border-bottom-right-radius:3px;-webkit-border-top-right-radius:0;-webkit-border-bottom-right-radius:0;-moz-border-radius-topright:0;-moz-border-radius-bottomright:0;border-top-right-radius:0;border-bottom-right-radius:0}.cart-tab.left{left:-22em;-webkit-transition:left ease .5s;-moz-transition:left ease .5s;-o-transition:left ease .5s;transition:left ease .5s}.cart-tab.left a.cart-parent{right:-8.402328em;width:8.402328em;-webkit-transition:right ease .5s;-moz-transition:right ease .5s;-o-transition:right ease .5s;transition:right ease .5s;-webkit-border-top-right-radius:3px;-webkit-border-bottom-right-radius:3px;-moz-border-radius-topright:3px;-moz-border-radius-bottomright:3px;border-top-right-radius:3px;border-bottom-right-radius:3px}.cart-tab.left a.cart-parent.hidden{right:0}.cart-tab.left a.cart-parent.visible{right:-8.402328em}.cart-tab.left:hover{left:0}.cart-tab.left .widget{-webkit-border-bottom-left-radius:3px;-webkit-border-bottom-right-radius:3px;-moz-border-radius-bottomleft:3px;-moz-border-radius-bottomright:3px;border-bottom-left-radius:3px;border-bottom-right-radius:3px;-webkit-border-top-left-radius:0;-webkit-border-bottom-left-radius:0;-moz-border-radius-topleft:0;-moz-border-radius-bottomleft:0;border-top-left-radius:0;border-bottom-left-radius:0}.cart-tab.left.light a.cart-parent:after,.cart-tab.left.dark a.cart-parent:after{right:auto;left:-10px}.cart-tab.no-animation.right:hover{right:-22em}.cart-tab.no-animation.left:hover{left:-22em}.cart-tab.hidden{display:none}
|
assets/css/style.less
CHANGED
@@ -132,6 +132,9 @@
|
|
132 |
left:-22em;
|
133 |
}
|
134 |
}
|
|
|
|
|
|
|
135 |
}
|
136 |
|
137 |
// Retina
|
132 |
left:-22em;
|
133 |
}
|
134 |
}
|
135 |
+
&.hidden {
|
136 |
+
display: none;
|
137 |
+
}
|
138 |
}
|
139 |
|
140 |
// Retina
|
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: 0.3.
|
6 |
Description: Displays a sitewide link to the cart which reveals the cart contents on hover.
|
7 |
Author: jameskoster
|
8 |
-
Tested up to:
|
9 |
Author URI: http://jameskoster.co.uk
|
10 |
Text Domain: woocommerce-cart-tab
|
11 |
Domain Path: /languages/
|
@@ -136,12 +136,20 @@ if ( in_array( 'woocommerce/woocommerce.php', apply_filters( 'active_plugins', g
|
|
136 |
$skin = get_option( 'wc_ct_skin' );
|
137 |
$position = get_option( 'wc_ct_horizontal_position' );
|
138 |
$widget = get_option( 'wc_ct_cart_widget' );
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
139 |
|
140 |
if ( ! is_cart() && ! is_checkout() ) {
|
141 |
if ( $widget == 'yes' ) {
|
142 |
-
echo '<div class="' . esc_attr( $position ) . ' cart-tab ' . esc_attr( $skin ) . '">';
|
143 |
} else {
|
144 |
-
echo '<div class="' . esc_attr( $position ) . ' cart-tab no-animation ' . esc_attr( $skin ) . '">';
|
145 |
}
|
146 |
wcct_cart_button();
|
147 |
// Display the widget if specified
|
@@ -162,14 +170,6 @@ if ( in_array( 'woocommerce/woocommerce.php', apply_filters( 'active_plugins', g
|
|
162 |
// Displays the cart total and number of items as a link
|
163 |
function wcct_cart_button() {
|
164 |
global $woocommerce;
|
165 |
-
$hide_widget = get_option( 'wc_ct_hide_empty_cart' );
|
166 |
-
if ( $woocommerce->cart->get_cart_contents_count() == 0 && $hide_widget == 'yes' ) {
|
167 |
-
// Hide empty cart
|
168 |
-
// Compatible with WP Super Cache as long as "late init" is enabled
|
169 |
-
$visibility = 'hidden';
|
170 |
-
} else {
|
171 |
-
$visibility = 'visible';
|
172 |
-
}
|
173 |
?>
|
174 |
<a href="<?php echo esc_url( $woocommerce->cart->get_cart_url() ); ?>" title="<?php _e( 'View your shopping cart', 'woocommerce-cart-tab' ); ?>" class="cart-parent <?php echo esc_attr( $visibility ); ?>">
|
175 |
<?php
|
2 |
/*
|
3 |
Plugin Name: WooCommerce Cart Tab
|
4 |
Plugin URI: http://jameskoster.co.uk/tag/cart-tab/
|
5 |
+
Version: 0.3.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.0
|
9 |
Author URI: http://jameskoster.co.uk
|
10 |
Text Domain: woocommerce-cart-tab
|
11 |
Domain Path: /languages/
|
136 |
$skin = get_option( 'wc_ct_skin' );
|
137 |
$position = get_option( 'wc_ct_horizontal_position' );
|
138 |
$widget = get_option( 'wc_ct_cart_widget' );
|
139 |
+
$hide_widget = get_option( 'wc_ct_hide_empty_cart' );
|
140 |
+
if ( $woocommerce->cart->get_cart_contents_count() == 0 && $hide_widget == 'yes' ) {
|
141 |
+
// Hide empty cart
|
142 |
+
// Compatible with WP Super Cache as long as "late init" is enabled
|
143 |
+
$visibility = 'hidden';
|
144 |
+
} else {
|
145 |
+
$visibility = 'visible';
|
146 |
+
}
|
147 |
|
148 |
if ( ! is_cart() && ! is_checkout() ) {
|
149 |
if ( $widget == 'yes' ) {
|
150 |
+
echo '<div class="' . esc_attr( $position ) . ' cart-tab ' . esc_attr( $skin ) . ' ' . esc_attr( $visibility ) . '">';
|
151 |
} else {
|
152 |
+
echo '<div class="' . esc_attr( $position ) . ' cart-tab no-animation ' . esc_attr( $skin ) . ' ' . esc_attr( $visibility ) . '">';
|
153 |
}
|
154 |
wcct_cart_button();
|
155 |
// Display the widget if specified
|
170 |
// Displays the cart total and number of items as a link
|
171 |
function wcct_cart_button() {
|
172 |
global $woocommerce;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
173 |
?>
|
174 |
<a href="<?php echo esc_url( $woocommerce->cart->get_cart_url() ); ?>" title="<?php _e( 'View your shopping cart', 'woocommerce-cart-tab' ); ?>" class="cart-parent <?php echo esc_attr( $visibility ); ?>">
|
175 |
<?php
|
readme.txt
CHANGED
@@ -2,8 +2,8 @@
|
|
2 |
Contributors: jameskoster
|
3 |
Tags: woocommerce, ecommerce, cart
|
4 |
Requires at least: 3.5
|
5 |
-
Tested up to:
|
6 |
-
Stable tag: 0.3.
|
7 |
License: GPLv2 or later
|
8 |
License URI: http://www.gnu.org/licenses/gpl-2.0.html
|
9 |
|
@@ -46,6 +46,9 @@ Thanks! Please fork the repo on <a href="https://github.com/jameskoster/woocomme
|
|
46 |
|
47 |
== Changelog ==
|
48 |
|
|
|
|
|
|
|
49 |
= 0.3.0 - 04/03/2014 =
|
50 |
* WooCommerce 2.1 compatibility.
|
51 |
|
2 |
Contributors: jameskoster
|
3 |
Tags: woocommerce, ecommerce, cart
|
4 |
Requires at least: 3.5
|
5 |
+
Tested up to: 4.0
|
6 |
+
Stable tag: 0.3.1
|
7 |
License: GPLv2 or later
|
8 |
License URI: http://www.gnu.org/licenses/gpl-2.0.html
|
9 |
|
46 |
|
47 |
== Changelog ==
|
48 |
|
49 |
+
= 0.3.1 - 04/17/2014 =
|
50 |
+
* Fix - Hide the tab shadow when the cart is hidden.
|
51 |
+
|
52 |
= 0.3.0 - 04/03/2014 =
|
53 |
* WooCommerce 2.1 compatibility.
|
54 |
|