Variation Swatches for WooCommerce - Version 1.0.9

Version Description

  • Fix - Sometimes can't select attributes.
Download this release

Release Info

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

Code changes from version 1.0.8 to 1.0.9

assets/js/frontend.js CHANGED
@@ -47,27 +47,29 @@
47
  $form.find( '.swatch.disabled' ).removeClass( 'disabled' );
48
  } )
49
  .on( 'woocommerce_update_variation_values', function() {
50
- $form.find( 'tbody tr' ).each( function() {
51
- var $variationRow = $( this ),
52
- options = $variationRow.find( 'select' ).find( 'option' ),
53
- values = [];
 
54
 
55
- options.each( function( index, option ) {
56
- if ( option.value !== '' ) {
57
- values.push( option.value );
58
- }
59
- } );
60
 
61
- $variationRow.find( '.swatch' ).each( function() {
62
- var $swatch = $( this );
63
 
64
- if ( values.indexOf( $swatch.data( 'value' ) ) > -1 ) {
65
- $swatch.removeClass( 'disabled' );
66
- } else {
67
- $swatch.addClass( 'disabled' );
68
- }
 
69
  } );
70
- } );
71
  } )
72
  .on( 'tawcvs_no_matching_variations', function() {
73
  window.alert( wc_add_to_cart_variation_params.i18n_no_matching_variations_text );
47
  $form.find( '.swatch.disabled' ).removeClass( 'disabled' );
48
  } )
49
  .on( 'woocommerce_update_variation_values', function() {
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
  } );
72
+ }, 100 );
73
  } )
74
  .on( 'tawcvs_no_matching_variations', function() {
75
  window.alert( wc_add_to_cart_variation_params.i18n_no_matching_variations_text );
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.8
7
  WC requires at least: 3.2.0
8
  WC tested up to: 4.1.0
9
  License: GPLv2 or later
@@ -77,6 +77,9 @@ Yes, it will work with any theme, but may require some styling to make it match
77
 
78
  == Changelog ==
79
 
 
 
 
80
  = 1.0.8 =
81
  * Enhancement - Disable invalid swatches base on select ones.
82
  * Fix - Can't deactivate plugin without WooCommerce installed.
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
 
78
  == Changelog ==
79
 
80
+ = 1.0.9 =
81
+ * Fix - Sometimes can't select attributes.
82
+
83
  = 1.0.8 =
84
  * Enhancement - Disable invalid swatches base on select ones.
85
  * Fix - Can't deactivate plugin without WooCommerce installed.
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.8
7
  * Author: ThemeAlien
8
  * Author URI: http://themealien.com/
9
  * Requires at least: 4.5
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