Variation Swatches for WooCommerce - Version 1.0.10

Version Description

  • Fix - The issue of numeric attributes are not selectable.
  • Fix - Display custom column content incorrectly in admin area.
Download this release

Release Info

Developer themealien
Plugin Icon 128x128 Variation Swatches for WooCommerce
Version 1.0.10
Comparing to
See all releases

Code changes from version 1.0.9 to 1.0.10

assets/css/frontend.css CHANGED
@@ -22,6 +22,7 @@
22
  line-height: 28px;
23
  text-align: center;
24
  margin-right: 15px;
 
25
  cursor: pointer;
26
  border: 2px solid transparent;
27
  position: relative;
22
  line-height: 28px;
23
  text-align: center;
24
  margin-right: 15px;
25
+ margin-bottom: 15px;
26
  cursor: pointer;
27
  border: 2px solid transparent;
28
  position: relative;
assets/js/frontend.js CHANGED
@@ -15,7 +15,7 @@
15
 
16
  var $el = $( this ),
17
  $select = $el.closest( '.value' ).find( 'select' ),
18
- value = $el.data( 'value' );
19
 
20
  if ( $el.hasClass( 'disabled' ) ) {
21
  return;
@@ -50,22 +50,28 @@
50
  setTimeout( function() {
51
  $form.find( 'tbody tr' ).each( function() {
52
  var $variationRow = $( this ),
53
- options = $variationRow.find( 'select' ).find( 'option' ),
 
54
  values = [];
55
 
56
- options.each( function( index, option ) {
57
  if ( option.value !== '' ) {
58
  values.push( option.value );
59
  }
60
  } );
61
 
62
  $variationRow.find( '.swatch' ).each( function() {
63
- var $swatch = $( this );
 
64
 
65
- if ( values.indexOf( $swatch.data( 'value' ) ) > -1 ) {
66
  $swatch.removeClass( 'disabled' );
67
  } else {
68
  $swatch.addClass( 'disabled' );
 
 
 
 
69
  }
70
  } );
71
  } );
15
 
16
  var $el = $( this ),
17
  $select = $el.closest( '.value' ).find( 'select' ),
18
+ value = $el.attr( 'data-value' );
19
 
20
  if ( $el.hasClass( 'disabled' ) ) {
21
  return;
50
  setTimeout( function() {
51
  $form.find( 'tbody tr' ).each( function() {
52
  var $variationRow = $( this ),
53
+ $options = $variationRow.find( 'select' ).find( 'option' ),
54
+ $selected = $options.filter( ':selected' ),
55
  values = [];
56
 
57
+ $options.each( function( index, option ) {
58
  if ( option.value !== '' ) {
59
  values.push( option.value );
60
  }
61
  } );
62
 
63
  $variationRow.find( '.swatch' ).each( function() {
64
+ var $swatch = $( this ),
65
+ value = $swatch.attr( 'data-value' );
66
 
67
+ if ( values.indexOf( value ) > -1 ) {
68
  $swatch.removeClass( 'disabled' );
69
  } else {
70
  $swatch.addClass( 'disabled' );
71
+
72
+ if ( $selected.length && value === $selected.val() ) {
73
+ $swatch.removeClass( 'selected' );
74
+ }
75
  }
76
  } );
77
  } );
includes/class-admin.php CHANGED
@@ -287,6 +287,10 @@ class TA_WC_Variation_Swatches_Admin {
287
  * @param $term_id
288
  */
289
  public function add_attribute_column_content( $columns, $column, $term_id ) {
 
 
 
 
290
  $attr = TA_WCVS()->get_tax_attribute( $_REQUEST['taxonomy'] );
291
  $value = get_term_meta( $term_id, $attr->attribute_type, true );
292
 
287
  * @param $term_id
288
  */
289
  public function add_attribute_column_content( $columns, $column, $term_id ) {
290
+ if ( 'thumb' !== $column ) {
291
+ return $columns;
292
+ }
293
+
294
  $attr = TA_WCVS()->get_tax_attribute( $_REQUEST['taxonomy'] );
295
  $value = get_term_meta( $term_id, $attr->attribute_type, true );
296
 
readme.txt CHANGED
@@ -3,7 +3,7 @@ Contributors: themealien, coderexco
3
  Tags: woocommerce, product attribute, product color, product size, variation swatches, variable products
4
  Requires at least: 4.5
5
  Tested up to: 5.4.1
6
- Stable tag: 1.0.9
7
  WC requires at least: 3.2.0
8
  WC tested up to: 4.1.0
9
  License: GPLv2 or later
@@ -77,6 +77,10 @@ Yes, it will work with any theme, but may require some styling to make it match
77
 
78
  == Changelog ==
79
 
 
 
 
 
80
  = 1.0.9 =
81
  * Fix - Sometimes can't select attributes.
82
 
3
  Tags: woocommerce, product attribute, product color, product size, variation swatches, variable products
4
  Requires at least: 4.5
5
  Tested up to: 5.4.1
6
+ Stable tag: 1.0.10
7
  WC requires at least: 3.2.0
8
  WC tested up to: 4.1.0
9
  License: GPLv2 or later
77
 
78
  == Changelog ==
79
 
80
+ = 1.0.10 =
81
+ * Fix - The issue of numeric attributes are not selectable.
82
+ * Fix - Display custom column content incorrectly in admin area.
83
+
84
  = 1.0.9 =
85
  * Fix - Sometimes can't select attributes.
86
 
variation-swatches-for-woocommerce.php CHANGED
@@ -3,7 +3,7 @@
3
  * Plugin Name: Variation Swatcher for WooCommerce
4
  * Plugin URI: http://themealien.com/wordpress-plugin/woocommerce-variation-swatches
5
  * Description: An extension of WooCommerce to make variable products be more beauty and friendly to users.
6
- * Version: 1.0.9
7
  * Author: ThemeAlien
8
  * Author URI: http://themealien.com/
9
  * Requires at least: 4.5
@@ -11,7 +11,7 @@
11
  * Text Domain: wcvs
12
  * Domain Path: /languages
13
  * WC requires at least: 3.0.0
14
- * WC tested up to: 4.1.0
15
  *
16
  * License: GPLv2 or later
17
  * License URI: https://www.gnu.org/licenses/gpl-2.0.html
3
  * Plugin Name: Variation Swatcher for WooCommerce
4
  * Plugin URI: http://themealien.com/wordpress-plugin/woocommerce-variation-swatches
5
  * Description: An extension of WooCommerce to make variable products be more beauty and friendly to users.
6
+ * Version: 1.0.10
7
  * Author: ThemeAlien
8
  * Author URI: http://themealien.com/
9
  * Requires at least: 4.5
11
  * Text Domain: wcvs
12
  * Domain Path: /languages
13
  * WC requires at least: 3.0.0
14
+ * WC tested up to: 4.1.1
15
  *
16
  * License: GPLv2 or later
17
  * License URI: https://www.gnu.org/licenses/gpl-2.0.html