Variation Swatches for WooCommerce - Version 2.1.7

Version Description

  • Fix PHP warning
  • Removed unused param from hook
  • Fix the spacing issue in the Safari browser
  • Added the option to limit the number of swatches on the single product in Pro
  • Separate variables to get swatch name and desc
  • Added support to change the variation image by hovering in Pro
Download this release

Release Info

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

Code changes from version 2.1.6 to 2.1.7

assets/css/frontend.css CHANGED
@@ -101,6 +101,7 @@
101
  .woocommerce.single-product form.cart.variations_form .tawcvs-swatches .swatch-show-more.swatch-label {
102
  font-size: 14px;
103
  min-width: max-content;
 
104
  }
105
  .woocommerce div.product form.cart.variations_form .tawcvs-swatches .swatch.swatch-image,
106
  .woocommerce div.product form.cart.variations_form .tawcvs-swatches .swatch-show-more.swatch-image,
101
  .woocommerce.single-product form.cart.variations_form .tawcvs-swatches .swatch-show-more.swatch-label {
102
  font-size: 14px;
103
  min-width: max-content;
104
+ width: auto;
105
  }
106
  .woocommerce div.product form.cart.variations_form .tawcvs-swatches .swatch.swatch-image,
107
  .woocommerce div.product form.cart.variations_form .tawcvs-swatches .swatch-show-more.swatch-image,
assets/css/frontend.css.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"sourceRoot":"","sources":["frontend.scss"],"names":[],"mappings":"AAAA;EACE;EACA;;;AAQI;AAAA;AAAA;EACE;;AAGF;AAAA;AAAA;EACE;;AAIJ;AAAA;AAAA;EACE;EACA;EACA;;AAEA;AAAA;AAAA;AAAA;AAAA;AAAA;EAEE;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;;AAEA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;EAEE;;AAGF;AAAA;AAAA;AAAA;AAAA;AAAA;EACE;;AAIE;AAAA;AAAA;AAAA;AAAA;AAAA;EACE;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA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EACA;EACA;EACA;EACA;EACA;EACA;;AAIJ;AAAA;AAAA;EACE;EACA;;AAGF;AAAA;AAAA;EACE;;AAGF;AAAA;AAAA;EACE;EACA;EACA;;AAIA;AAAA;AAAA;EACE;EACA;;AAEA;AAAA;AAAA;EACE;;AAGF;AAAA;AAAA;EACE;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;;AAeA;AAAA;AAAA;EACE;;AAKF;AAAA;AAAA;EACE;;AAON;AAAA;AAAA;EACE;;;AAOV;EACE;;AAEA;EACE;;;AAIJ;EACE;;AAEA;EACE;;;AAKF;EACE;;;AAIJ;EACE;;AAEA;EACE;;;AAIJ;EACE;;;AAGF;AAAA;AAAA;AAIE;EACE;;AAGF;EACE;IACE;;;AAIJ;EACE;;AAKA;EAME;;AALA;EACE;EACA;;;AAQR;EACE;;AAEA;EACE;;;AAIJ;EACE;;;AAEF;EACE;EACA","file":"frontend.css"}
1
+ {"version":3,"sourceRoot":"","sources":["frontend.scss"],"names":[],"mappings":"AAAA;EACE;EACA;;;AAQI;AAAA;AAAA;EACE;;AAGF;AAAA;AAAA;EACE;;AAIJ;AAAA;AAAA;EACE;EACA;EACA;;AAEA;AAAA;AAAA;AAAA;AAAA;AAAA;EAEE;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;;AAEA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;EAEE;;AAGF;AAAA;AAAA;AAAA;AAAA;AAAA;EACE;;AAIE;AAAA;AAAA;AAAA;AAAA;AAAA;EACE;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;;AAKN;AAAA;AAAA;AAAA;AAAA;AAAA;EACE;;AAGF;AAAA;AAAA;AAAA;AAAA;AAAA;EACE;EACA;EACA;;AAGF;AAAA;AAAA;AAAA;AAAA;AAAA;EACE;;AAEA;AAAA;AAAA;AAAA;AAA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ACE;;AAGF;AAAA;AAAA;EACE;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;;AAeA;AAAA;AAAA;EACE;;AAKF;AAAA;AAAA;EACE;;AAON;AAAA;AAAA;EACE;;;AAOV;EACE;;AAEA;EACE;;;AAIJ;EACE;;AAEA;EACE;;;AAKF;EACE;;;AAIJ;EACE;;AAEA;EACE;;;AAIJ;EACE;;;AAGF;AAAA;AAAA;AAIE;EACE;;AAGF;EACE;IACE;;;AAIJ;EACE;;AAKA;EAME;;AALA;EACE;EACA;;;AAQR;EACE;;AAEA;EACE;;;AAIJ;EACE;;;AAEF;EACE;EACA","file":"frontend.css"}
assets/css/frontend.scss CHANGED
@@ -77,6 +77,7 @@
77
  &.swatch-label {
78
  font-size: 14px;
79
  min-width: max-content;
 
80
  }
81
 
82
  &.swatch-image {
77
  &.swatch-label {
78
  font-size: 14px;
79
  min-width: max-content;
80
+ width: auto;
81
  }
82
 
83
  &.swatch-image {
includes/class-admin.php CHANGED
@@ -210,7 +210,9 @@ class TA_WC_Variation_Swatches_Admin {
210
  * @param $post_id
211
  */
212
  public function save_custom_product_data( $post_id ) {
213
- update_post_meta( $post_id, 'variation_swatches_disabled', esc_attr( $_POST['variation_swatches_disabled'] ) );
 
 
214
  }
215
 
216
  /**
210
  * @param $post_id
211
  */
212
  public function save_custom_product_data( $post_id ) {
213
+ if ( isset( $_POST['variation_swatches_disabled'] ) ) {
214
+ update_post_meta( $post_id, 'variation_swatches_disabled', esc_attr( $_POST['variation_swatches_disabled'] ) );
215
+ }
216
  }
217
 
218
  /**
includes/class-frontend.php CHANGED
@@ -62,7 +62,7 @@ class TA_WC_Variation_Swatches_Frontend {
62
  add_filter( 'woocommerce_loop_add_to_cart_link', array(
63
  $this,
64
  'display_variations_on_shop_page_before_add_to_cart_btn'
65
- ), 10, 3 );
66
  }
67
  add_action( 'wp_head', array( $this, 'apply_custom_design_styles' ) );
68
 
@@ -272,8 +272,9 @@ class TA_WC_Variation_Swatches_Frontend {
272
  $selected = sanitize_title( $args['selected'] ) == $term->slug ? 'selected' : '';
273
  $name = esc_html( apply_filters( 'woocommerce_variation_option_name', $term->name ) );
274
 
275
- $tooltip = $this->get_tooltip_html( '', $term, $name, $args );
276
- $tooltip = apply_filters( 'tawcvs_tooltip_html', $tooltip, $term, $name, $args );
 
277
 
278
  $swatchShape = isset( $this->generalSettings['swatch-shape'] ) ? $this->generalSettings['swatch-shape'] : 'circle';
279
 
@@ -375,11 +376,10 @@ class TA_WC_Variation_Swatches_Frontend {
375
  *
376
  * @param $html
377
  * @param $product
378
- * @param $args
379
  *
380
  * @return mixed|void
381
  */
382
- public function display_variations_on_shop_page_before_add_to_cart_btn( $html, $product, $args ) {
383
  global $product;
384
 
385
  if ( $product instanceof WC_Product_Variable ) {
62
  add_filter( 'woocommerce_loop_add_to_cart_link', array(
63
  $this,
64
  'display_variations_on_shop_page_before_add_to_cart_btn'
65
+ ), 10, 2 );
66
  }
67
  add_action( 'wp_head', array( $this, 'apply_custom_design_styles' ) );
68
 
272
  $selected = sanitize_title( $args['selected'] ) == $term->slug ? 'selected' : '';
273
  $name = esc_html( apply_filters( 'woocommerce_variation_option_name', $term->name ) );
274
 
275
+ $tooltip_text = esc_html( apply_filters( 'woocommerce_variation_option_description_text', ! empty( $term->description ) ? $term->description : $term->name ) );
276
+ $tooltip = $this->get_tooltip_html( '', $term, $tooltip_text, $args );
277
+ $tooltip = apply_filters( 'tawcvs_tooltip_html', $tooltip, $term, $tooltip_text, $args );
278
 
279
  $swatchShape = isset( $this->generalSettings['swatch-shape'] ) ? $this->generalSettings['swatch-shape'] : 'circle';
280
 
376
  *
377
  * @param $html
378
  * @param $product
 
379
  *
380
  * @return mixed|void
381
  */
382
+ public function display_variations_on_shop_page_before_add_to_cart_btn( $html, $product ) {
383
  global $product;
384
 
385
  if ( $product instanceof WC_Product_Variable ) {
includes/class-setting-fields-manager.php CHANGED
@@ -395,6 +395,46 @@ if ( ! class_exists( 'VSWC_Setting_Fields_Manager' ) ) {
395
  'desc' => __( 'Select option', 'wcvs' ),
396
  'priority' => 8
397
  ),
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
398
  ),
399
  'design' => array(
400
  'productDesign' => array(
395
  'desc' => __( 'Select option', 'wcvs' ),
396
  'priority' => 8
397
  ),
398
+ array(
399
+ 'title' => __( 'Enable Attribute Name', 'woosuite-variation-swatches-pro' ),
400
+ 'fields' => array(
401
+ array(
402
+ 'id' => 'wcvs-enable-attribute-name',
403
+ 'type' => 'checkbox',
404
+ 'name' => 'enable-attribute-name',
405
+ )
406
+ ),
407
+ 'is_pro_feature' => true,
408
+ 'desc' => __( 'It will show the attribute name when choosing a desired attribute value', 'woosuite-variation-swatches-pro' ),
409
+ 'priority' => 9
410
+ ),
411
+ array(
412
+ 'title' => __( 'Enable Attribute Description', 'woosuite-variation-swatches-pro' ),
413
+ 'fields' => array(
414
+ array(
415
+ 'id' => 'wcvs-enable-attribute-desc',
416
+ 'type' => 'checkbox',
417
+ 'name' => 'enable-attribute-desc',
418
+ )
419
+ ),
420
+ 'is_pro_feature' => true,
421
+ 'desc' => __( 'It will show the attribute description under the attribute block', 'woosuite-variation-swatches-pro' ),
422
+ 'priority' => 10
423
+ ),
424
+ array(
425
+ 'title' => __( 'Swatch limit on Singe product', 'wcvs' ),
426
+ 'fields' => array(
427
+ array(
428
+ 'id' => 'wcvs-swatch-limit-single-page',
429
+ 'type' => 'number',
430
+ 'name' => 'swatch-limit-single-page',
431
+ 'default_value' => '0'
432
+ )
433
+ ),
434
+ 'is_pro_feature' => true,
435
+ 'desc' => __( 'Set a max amount of swatches to show.<br>0 means show all swatches', 'wcvs' ),
436
+ 'priority' => 11
437
+ ),
438
  ),
439
  'design' => array(
440
  'productDesign' => array(
includes/class-setting-fields-renderer.php CHANGED
@@ -12,14 +12,16 @@ if ( ! class_exists( 'VSWC_Setting_Fields_Renderer' ) ) {
12
  public function __construct() {
13
  add_action( 'woosuite_variation_swatches_settings_fields_html', array( $this, 'render_settings_page' ) );
14
 
15
- //Hook for the template parts
16
- add_action( 'woosuite_child_plugin_header', array( $this, 'render_settings_page_header' ) );
17
- add_action( 'woosuite_child_plugin_sidebar', array( $this, 'render_settings_page_sidebar' ) );
18
- add_action( 'woosuite_child_plugin_footer', array( $this, 'render_settings_page_footer' ) );
19
- add_action( 'woosuite_child_plugin_video_tutorials', array(
20
- $this,
21
- 'render_settings_page_video_tutorials'
22
- ) );
 
 
23
 
24
 
25
  $this->settings_sections = VSWC_Setting_Fields_Manager::get_settings_sections();
12
  public function __construct() {
13
  add_action( 'woosuite_variation_swatches_settings_fields_html', array( $this, 'render_settings_page' ) );
14
 
15
+ if ( TA_WC_Variation_Swatches::is_in_plugin_settings_page() ) {
16
+ //Hook for the template parts
17
+ add_action( 'woosuite_child_plugin_header', array( $this, 'render_settings_page_header' ) );
18
+ add_action( 'woosuite_child_plugin_sidebar', array( $this, 'render_settings_page_sidebar' ) );
19
+ add_action( 'woosuite_child_plugin_footer', array( $this, 'render_settings_page_footer' ) );
20
+ add_action( 'woosuite_child_plugin_video_tutorials', array(
21
+ $this,
22
+ 'render_settings_page_video_tutorials'
23
+ ) );
24
+ }
25
 
26
 
27
  $this->settings_sections = VSWC_Setting_Fields_Manager::get_settings_sections();
readme.txt CHANGED
@@ -2,10 +2,10 @@
2
  Contributors: variationswatches, themealien, zgani, mehbubrashid, minhnguyen25
3
  Tags: variation swatches, woocommerce swatches, variation swatches for woocommerce, woocommerce attributes, woocommerce
4
  Requires at least: 4.5
5
- Tested up to: 6.0
6
- Stable tag: 2.1.6
7
  WC requires at least: 3.2.0
8
- WC tested up to: 6.6.1
9
  License: GPLv2 or later
10
  License URI: https://www.gnu.org/licenses/gpl-2.0.html
11
 
@@ -103,6 +103,14 @@ Yes, it will work with any theme, but may require some styling to make it match
103
  7. Add new attribute color when edit a product
104
 
105
  == Changelog ==
 
 
 
 
 
 
 
 
106
  = 2.1.6 =
107
  * Update: WooCommerce and WordPress Compatibility
108
  * Minor bugs fix and improvements
2
  Contributors: variationswatches, themealien, zgani, mehbubrashid, minhnguyen25
3
  Tags: variation swatches, woocommerce swatches, variation swatches for woocommerce, woocommerce attributes, woocommerce
4
  Requires at least: 4.5
5
+ Tested up to: 6.0.3
6
+ Stable tag: 2.1.7
7
  WC requires at least: 3.2.0
8
+ WC tested up to: 7.0.0
9
  License: GPLv2 or later
10
  License URI: https://www.gnu.org/licenses/gpl-2.0.html
11
 
103
  7. Add new attribute color when edit a product
104
 
105
  == Changelog ==
106
+ = 2.1.7 =
107
+ * Fix PHP warning
108
+ * Removed unused param from hook
109
+ * Fix the spacing issue in the Safari browser
110
+ * Added the option to limit the number of swatches on the single product in Pro
111
+ * Separate variables to get swatch name and desc
112
+ * Added support to change the variation image by hovering in Pro
113
+
114
  = 2.1.6 =
115
  * Update: WooCommerce and WordPress Compatibility
116
  * Minor bugs fix and improvements
templates/admin/welcome-popup.php CHANGED
@@ -6,7 +6,7 @@
6
  </div>
7
  <div class="popup-content">
8
  <div class="popup-inner-content">
9
- <p><strong>Variation Swatches 2.1.6 is here! 🥳🥳</strong></p>
10
  <p>This version fixes small styling issues but more importantly extends the support of <a href="https://woosuite.com/lp/variations-swatches-upgrade/?ref=update-message">our Pro version</a>.</p>
11
  <p>A lot of our best features come from your feedback, so let us know what you would like to see next.</p>
12
  <p><a href="https://woosuite.com/news/variation-swatches-updates/" target="_blank" rel="noopener noreferrer nofollow"> Click here to learn more. </a></p>
6
  </div>
7
  <div class="popup-content">
8
  <div class="popup-inner-content">
9
+ <p><strong>Variation Swatches 2.1.7 is here! 🥳🥳</strong></p>
10
  <p>This version fixes small styling issues but more importantly extends the support of <a href="https://woosuite.com/lp/variations-swatches-upgrade/?ref=update-message">our Pro version</a>.</p>
11
  <p>A lot of our best features come from your feedback, so let us know what you would like to see next.</p>
12
  <p><a href="https://woosuite.com/news/variation-swatches-updates/" target="_blank" rel="noopener noreferrer nofollow"> Click here to learn more. </a></p>
variation-swatches-for-woocommerce.php CHANGED
@@ -3,15 +3,15 @@
3
  * Plugin Name: Variation Swatches for WooCommerce
4
  * Plugin URI: https://woosuite.com/plugins/woocommerce-variation-swatches/
5
  * Description: Creates variation swatches for WooCommerce, converts your variation dropdown into color, label, or photo swatches with ease, The original Variation Swatches for WooCommerce.
6
- * Version: 2.1.6
7
  * Author: Woosuite
8
  * Author URI: https://woosuite.com/
9
  * Requires at least: 4.5
10
- * Tested up to: 6.0
11
  * Text Domain: wcvs
12
  * Domain Path: /languages
13
  * WC requires at least: 3.0.0
14
- * WC tested up to: 6.6.1
15
  *
16
  * License: GPLv2 or later
17
  * License URI: https://www.gnu.org/licenses/gpl-2.0.html
@@ -27,7 +27,7 @@ if ( ! defined( 'TAWC_VS_PLUGIN_FILE' ) ) {
27
  }
28
 
29
  if ( ! defined( 'WCVS_PLUGIN_VERSION' ) ) {
30
- define( 'WCVS_PLUGIN_VERSION', '2.1.6' );
31
  }
32
 
33
  if ( ! defined( 'WCVS_PLUGIN_URL' ) ) {
3
  * Plugin Name: Variation Swatches for WooCommerce
4
  * Plugin URI: https://woosuite.com/plugins/woocommerce-variation-swatches/
5
  * Description: Creates variation swatches for WooCommerce, converts your variation dropdown into color, label, or photo swatches with ease, The original Variation Swatches for WooCommerce.
6
+ * Version: 2.1.7
7
  * Author: Woosuite
8
  * Author URI: https://woosuite.com/
9
  * Requires at least: 4.5
10
+ * Tested up to: 6.0.3
11
  * Text Domain: wcvs
12
  * Domain Path: /languages
13
  * WC requires at least: 3.0.0
14
+ * WC tested up to: 7.0.0
15
  *
16
  * License: GPLv2 or later
17
  * License URI: https://www.gnu.org/licenses/gpl-2.0.html
27
  }
28
 
29
  if ( ! defined( 'WCVS_PLUGIN_VERSION' ) ) {
30
+ define( 'WCVS_PLUGIN_VERSION', '2.1.7' );
31
  }
32
 
33
  if ( ! defined( 'WCVS_PLUGIN_URL' ) ) {