YITH WooCommerce Ajax Product Filter - Version 3.0.8

Version Description

  • Released: Aug 11, 2016 =

  • Added: Support to WordPress 4.6RC2

  • Tweak: Removed deprecated arg to get_terms function

  • Fixed: Empty filter doesn't hide after ajax call

  • Fixed: Max execution time issue and 500 internal server error issue

Download this release

Release Info

Developer yithemes
Plugin Icon 128x128 YITH WooCommerce Ajax Product Filter
Version 3.0.8
Comparing to
See all releases

Code changes from version 3.0.7 to 3.0.8

README.txt CHANGED
@@ -4,7 +4,7 @@ Contributors: yithemes
4
  Tags: woocommerce ajax product filter download, woocommerce, widget, ajax, ajax filtered nav, ajax navigation, ajax filtered navigation, woocommerce layered navigation, woocommerce layered nav, product filter, product filters, ajax product filter, woocommerce ajax product filter, woocommerce filters, sidebar filter, sidebar ajax filter, ajax price filter, price filter, product sorting, woocommerce filter, taxonomy filter, attribute filter, attributes filter, woocommerce product sort, ajax sort, woocommerce ajax product filter, advanced product filters, ajax product filters, filters, woocommerce ajax product filters, woocommerce product filters, woocommerce product filters, category filter, attribute filters, woocommerce products filter, woocommerce price filter, yit, yith, yithemes
5
  Requires at least: 4.0
6
  Tested up to: 4.5.3
7
- Stable tag: 3.0.7
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
@@ -159,6 +159,13 @@ If you want to see a demonstration version of the premium plugin, you can see it
159
 
160
  == Changelog ==
161
 
 
 
 
 
 
 
 
162
  = 3.0.7 - Released: Jul 29, 2016 =
163
 
164
  * Added: yith_wcan_get_list_html_terms hook
4
  Tags: woocommerce ajax product filter download, woocommerce, widget, ajax, ajax filtered nav, ajax navigation, ajax filtered navigation, woocommerce layered navigation, woocommerce layered nav, product filter, product filters, ajax product filter, woocommerce ajax product filter, woocommerce filters, sidebar filter, sidebar ajax filter, ajax price filter, price filter, product sorting, woocommerce filter, taxonomy filter, attribute filter, attributes filter, woocommerce product sort, ajax sort, woocommerce ajax product filter, advanced product filters, ajax product filters, filters, woocommerce ajax product filters, woocommerce product filters, woocommerce product filters, category filter, attribute filters, woocommerce products filter, woocommerce price filter, yit, yith, yithemes
5
  Requires at least: 4.0
6
  Tested up to: 4.5.3
7
+ Stable tag: 3.0.8
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
159
 
160
  == Changelog ==
161
 
162
+ = 3.0.8 - Released: Aug 11, 2016 =
163
+
164
+ * Added: Support to WordPress 4.6RC2
165
+ * Tweak: Removed deprecated arg to get_terms function
166
+ * Fixed: Empty filter doesn't hide after ajax call
167
+ * Fixed: Max execution time issue and 500 internal server error issue
168
+
169
  = 3.0.7 - Released: Jul 29, 2016 =
170
 
171
  * Added: yith_wcan_get_list_html_terms hook
assets/js/yith-wcan-frontend.js CHANGED
@@ -212,13 +212,17 @@ jQuery(function ($) {
212
  }
213
 
214
 
215
- var widget_reload = function (t) {
216
- var id = t.attr('id');
217
- t.html($(response).find('#' + id).html());
218
 
219
- if (t.text() == '') {
 
 
 
220
  t.hide();
221
- } else {
 
 
 
222
  t.show();
223
  }
224
  };
212
  }
213
 
214
 
215
+ var widget_reload = function(t) {
 
 
216
 
217
+ var id = t.attr('id'),
218
+ widget_in_response = $(response).find('#' + id);
219
+
220
+ if( widget_in_response.length == 0 ){
221
  t.hide();
222
+ }
223
+
224
+ else {
225
+ t.html(widget_in_response.html());
226
  t.show();
227
  }
228
  };
assets/js/yith-wcan-frontend.min.js CHANGED
@@ -8,7 +8,7 @@ jQuery(function(a){function u(a,p){return a.replace(new RegExp("[?&]"+p+"=[^&#]*
8
  "&")+a.param({min_price:l,max_price:g})}"select"==e.data("type")&&(e.parents("div.yith-woo-ajax-navigation").find("a.yit-wcan-select-open").removeClass("active"),e.parent().find("div.yith-wcan-select-wrapper").css("z-index","-1").animate({visibility:"hidden",opacity:0},300));a(yith_wcan.container).not(".ywcps-products").html("").addClass("yith-wcan-loading");a(document).trigger("yith-wcan-ajax-loading");"undefined"!=typeof yith_wcan_frontend&&a(yith_wcan.container).not(".ywcps-products").css("backgroundImage",
9
  "url("+yith_wcan_frontend.loader_url+")");1==yith_wcan.is_mobile&&a(window).scrollTop(a(yith_wcan.scroll_top).offset().top);a(yith_wcan.pagination).hide();a(yith_wcan.result_count).hide();0!=r&&(r.abort(),r=!1);r=a.ajax({url:b,success:function(c){r=!1;a(yith_wcan.container).not(".ywcps-products").removeClass("yith-wcan-loading");0<a(c).find(yith_wcan.container).not(".ywcps-products").length?a(".yit-wcan-container").html(a(c).find(yith_wcan.container).not(".ywcps-products")):a(".yit-wcan-container").html(a(c).find(".woocommerce-info"));
10
  0<a(c).find(yith_wcan.pagination).length?(0==a(yith_wcan.pagination).length&&a.jseldom(yith_wcan.pagination).insertAfter(a(yith_wcan.container).not(".ywcps-products")),a(yith_wcan.pagination).html(a(c).find(yith_wcan.pagination).html()).show()):a(yith_wcan.pagination).empty();a("div.quantity:not(.buttons_added), td.quantity:not(.buttons_added)").addClass("buttons_added").append('<input type="button" value="+" class="plus" />').prepend('<input type="button" value="-" class="minus" />');0<a(c).find(yith_wcan.result_count).length&&
11
- a(yith_wcan.result_count).html(a(c).find(yith_wcan.result_count).html()).show();a(".yith-woo-ajax-navigation").add(".yith-wcan-sort-by").add(".yith-wcan-stock-on-sale").add(".yith-wcan-list-price-filter").each(function(){var b=a(this),d=b.attr("id");b.html(a(c).find("#"+d).html());""==b.text()?b.hide():b.show()});if(1==yith_wcan.avada.is_enabled){var d=a(yith_wcan.avada.sort_count);d.html(a(c).find(yith_wcan.avada.sort_count).html());""==e.text()?d.hide():d.show()}1!=yith_wcan.change_browser_url||
12
  navigator.userAgent.match(/msie/i)||window.history.pushState({pageTitle:c.pageTitle},"",b);a(document).trigger("ready");a(document).trigger("yith-wcan-ajax-filtered");a(window).trigger("scroll");if(n){if("undefined"!=typeof a.fn.slider){var d=parseInt(a(yith_wcan.wc_price_slider.min_price).data("min")),f=parseInt(a(yith_wcan.wc_price_slider.max_price).data("max"));a(yith_wcan.wc_price_slider.wrapper).slider("values",[d,f]);a(document.body).trigger("price_slider_slide",[d,f])}a(document).trigger("yith-wcan-ajax-reset-filtered")}x()}})};
13
  a(yith_wcan.container).not(".ywcps-products").wrap('<div class="yit-wcan-container"></div>');a(document).on("yith-wcan-wrapped",function(){x()});a(document).trigger("yith-wcan-wrapped");a(document).on("click",".yith-wcan a",function(k){a(this).yith_wcan_ajax_filters(k,this)});var t=function(){a("div.yith-wcan-select-wrapper").css("z-index","-1").animate({visibility:"hidden",opacity:0},0);a("a.yit-wcan-select-open").removeClass("active")};a(document).on("click","a.yit-wcan-select-open.active",function(k){k.preventDefault();
14
  a(this).parent().find("div.yith-wcan-select-wrapper").css("z-index","-1").animate({visibility:"hidden",opacity:0},300);a(this).parent().find("a.yit-wcan-select-open").removeClass("active")});a(document).on("click","a.yit-wcan-select-open:not(.active)",function(k){k.preventDefault();a(this).parent().find("div.yith-wcan-select-wrapper").css("z-index","1").animate({visibility:"visible",opacity:1},300);a(this).parent().find("a.yit-wcan-select-open").addClass("active")});a(document).on("ready yith-wcan-ajax-filtered",
8
  "&")+a.param({min_price:l,max_price:g})}"select"==e.data("type")&&(e.parents("div.yith-woo-ajax-navigation").find("a.yit-wcan-select-open").removeClass("active"),e.parent().find("div.yith-wcan-select-wrapper").css("z-index","-1").animate({visibility:"hidden",opacity:0},300));a(yith_wcan.container).not(".ywcps-products").html("").addClass("yith-wcan-loading");a(document).trigger("yith-wcan-ajax-loading");"undefined"!=typeof yith_wcan_frontend&&a(yith_wcan.container).not(".ywcps-products").css("backgroundImage",
9
  "url("+yith_wcan_frontend.loader_url+")");1==yith_wcan.is_mobile&&a(window).scrollTop(a(yith_wcan.scroll_top).offset().top);a(yith_wcan.pagination).hide();a(yith_wcan.result_count).hide();0!=r&&(r.abort(),r=!1);r=a.ajax({url:b,success:function(c){r=!1;a(yith_wcan.container).not(".ywcps-products").removeClass("yith-wcan-loading");0<a(c).find(yith_wcan.container).not(".ywcps-products").length?a(".yit-wcan-container").html(a(c).find(yith_wcan.container).not(".ywcps-products")):a(".yit-wcan-container").html(a(c).find(".woocommerce-info"));
10
  0<a(c).find(yith_wcan.pagination).length?(0==a(yith_wcan.pagination).length&&a.jseldom(yith_wcan.pagination).insertAfter(a(yith_wcan.container).not(".ywcps-products")),a(yith_wcan.pagination).html(a(c).find(yith_wcan.pagination).html()).show()):a(yith_wcan.pagination).empty();a("div.quantity:not(.buttons_added), td.quantity:not(.buttons_added)").addClass("buttons_added").append('<input type="button" value="+" class="plus" />').prepend('<input type="button" value="-" class="minus" />');0<a(c).find(yith_wcan.result_count).length&&
11
+ a(yith_wcan.result_count).html(a(c).find(yith_wcan.result_count).html()).show();a(".yith-woo-ajax-navigation").add(".yith-wcan-sort-by").add(".yith-wcan-stock-on-sale").add(".yith-wcan-list-price-filter").each(function(){var b=a(this),d=b.attr("id"),d=a(c).find("#"+d);0==d.length?b.hide():(b.html(d.html()),b.show())});if(1==yith_wcan.avada.is_enabled){var d=a(yith_wcan.avada.sort_count);d.html(a(c).find(yith_wcan.avada.sort_count).html());""==e.text()?d.hide():d.show()}1!=yith_wcan.change_browser_url||
12
  navigator.userAgent.match(/msie/i)||window.history.pushState({pageTitle:c.pageTitle},"",b);a(document).trigger("ready");a(document).trigger("yith-wcan-ajax-filtered");a(window).trigger("scroll");if(n){if("undefined"!=typeof a.fn.slider){var d=parseInt(a(yith_wcan.wc_price_slider.min_price).data("min")),f=parseInt(a(yith_wcan.wc_price_slider.max_price).data("max"));a(yith_wcan.wc_price_slider.wrapper).slider("values",[d,f]);a(document.body).trigger("price_slider_slide",[d,f])}a(document).trigger("yith-wcan-ajax-reset-filtered")}x()}})};
13
  a(yith_wcan.container).not(".ywcps-products").wrap('<div class="yit-wcan-container"></div>');a(document).on("yith-wcan-wrapped",function(){x()});a(document).trigger("yith-wcan-wrapped");a(document).on("click",".yith-wcan a",function(k){a(this).yith_wcan_ajax_filters(k,this)});var t=function(){a("div.yith-wcan-select-wrapper").css("z-index","-1").animate({visibility:"hidden",opacity:0},0);a("a.yit-wcan-select-open").removeClass("active")};a(document).on("click","a.yit-wcan-select-open.active",function(k){k.preventDefault();
14
  a(this).parent().find("div.yith-wcan-select-wrapper").css("z-index","-1").animate({visibility:"hidden",opacity:0},300);a(this).parent().find("a.yit-wcan-select-open").removeClass("active")});a(document).on("click","a.yit-wcan-select-open:not(.active)",function(k){k.preventDefault();a(this).parent().find("div.yith-wcan-select-wrapper").css("z-index","1").animate({visibility:"visible",opacity:1},300);a(this).parent().find("a.yit-wcan-select-open").addClass("active")});a(document).on("ready yith-wcan-ajax-filtered",
includes/class.yith-wcan-frontend.php CHANGED
@@ -242,8 +242,6 @@ if ( ! class_exists( 'YITH_WCAN_Frontend' ) ) {
242
  public function woocommerce_layered_nav_init() {
243
  $is_ajax_navigation_active = is_active_widget( false, false, 'yith-woo-ajax-navigation', true );
244
 
245
-
246
-
247
  if ( ! YITH_WCAN()->is_wc_older_2_6 && $is_ajax_navigation_active && ! is_admin() ) {
248
 
249
  $_chosen_attributes = YITH_WCAN()->get_layered_nav_chosen_attributes();
@@ -332,6 +330,8 @@ if ( ! class_exists( 'YITH_WCAN_Frontend' ) ) {
332
  'post_type' => 'product',
333
  'numberposts' => -1,
334
  'post_status' => 'publish',
 
 
335
  'fields' => 'ids',
336
  'no_found_rows' => true,
337
  'tax_query' => array(
@@ -403,6 +403,8 @@ if ( ! class_exists( 'YITH_WCAN_Frontend' ) ) {
403
  'post_type' => 'product',
404
  'numberposts' => -1,
405
  'post_status' => 'publish',
 
 
406
  'fields' => 'ids',
407
  'no_found_rows' => true,
408
  'tax_query' => array()
242
  public function woocommerce_layered_nav_init() {
243
  $is_ajax_navigation_active = is_active_widget( false, false, 'yith-woo-ajax-navigation', true );
244
 
 
 
245
  if ( ! YITH_WCAN()->is_wc_older_2_6 && $is_ajax_navigation_active && ! is_admin() ) {
246
 
247
  $_chosen_attributes = YITH_WCAN()->get_layered_nav_chosen_attributes();
330
  'post_type' => 'product',
331
  'numberposts' => -1,
332
  'post_status' => 'publish',
333
+ 'meta_key' => '_visibility',
334
+ 'meta_value' => 'visible',
335
  'fields' => 'ids',
336
  'no_found_rows' => true,
337
  'tax_query' => array(
403
  'post_type' => 'product',
404
  'numberposts' => -1,
405
  'post_status' => 'publish',
406
+ 'meta_key' => '_visibility',
407
+ 'meta_value' => 'visible',
408
  'fields' => 'ids',
409
  'no_found_rows' => true,
410
  'tax_query' => array()
includes/functions.yith-wcan.php CHANGED
@@ -46,7 +46,7 @@ function yith_wcan_dropdown_attributes( $selected, $echo = true ) {
46
  function yith_wcan_attributes_table( $type, $attribute, $id, $name, $values = array(), $echo = true ) {
47
  $return = '';
48
 
49
- $terms = get_terms( 'pa_' . $attribute, array( 'hide_empty' => '0' ) );
50
 
51
  if ( 'list' == $type ) {
52
  $return = '<input type="hidden" name="' . $name . '[colors]" value="" /><input type="hidden" name="' . $name . '[labels]" value="" />';
@@ -252,11 +252,11 @@ if ( ! function_exists( 'yit_get_terms' ) ) {
252
  switch ( $case ) {
253
 
254
  case 'all':
255
- $terms = get_terms( $taxonomy, array( 'hide_empty' => true, 'exclude' => $exclude ) );
256
  break;
257
 
258
  case 'hierarchical':
259
- $terms = get_terms( $taxonomy, array( 'hide_empty' => true, 'exclude' => $exclude ) );
260
  if( ! in_array( $instance['type'], apply_filters( 'yith_wcan_display_type_list', array( 'list' ) ) ) ) {
261
  $terms = yit_reorder_terms_by_parent( $terms, $taxonomy );
262
  $reordered = true;
@@ -264,16 +264,16 @@ if ( ! function_exists( 'yit_get_terms' ) ) {
264
  break;
265
 
266
  case 'parent' :
267
- $terms = get_terms( $taxonomy, array( 'hide_empty' => true, 'parent' => false, 'exclude' => $exclude ) );
268
  break;
269
 
270
  default:
271
- $args = array( 'hide_empty' => true, 'exclude' => $exclude, 'include' => $include );
272
  if ( 'parent' == $instance['display'] ) {
273
  $args['parent'] = false;
274
  }
275
 
276
- $terms = get_terms( $taxonomy, $args );
277
 
278
  if ( 'hierarchical' == $instance['display'] ) {
279
  if( ! in_array( $instance['type'], apply_filters( 'yith_wcan_display_type_list', array( 'list' ) ) ) ) {
@@ -336,12 +336,12 @@ if ( ! function_exists( 'yit_term_has_child' ) ) {
336
  */
337
  function yit_term_has_child( $term, $taxonomy ) {
338
  $count = 0;
339
- $child_terms = get_terms( $taxonomy, array( 'child_of' => $term->term_id ) );
340
 
341
  if( ! is_wp_error( $child_terms ) ){
342
  foreach ( $child_terms as $child_term ) {
343
  $_products_in_term = get_objects_in_term( $child_term->term_id, $taxonomy );
344
- $count += sizeof( array_intersect( $_products_in_term, YITH_WCAN()->frontend->filtered_product_ids ) );
345
  }
346
  }
347
 
@@ -600,11 +600,11 @@ if( ! function_exists( 'yit_reorder_hierachical_categories' ) ) {
600
  */
601
  function yit_reorder_hierachical_categories( $parent_term_id, $taxonomy = 'product_cat' ) {
602
  $childs = get_terms(
603
- $taxonomy,
604
  array(
605
- 'parent' => $parent_term_id,
606
- 'hierarchical' => true,
607
- 'hide_empty' => false
 
608
  )
609
  );
610
 
46
  function yith_wcan_attributes_table( $type, $attribute, $id, $name, $values = array(), $echo = true ) {
47
  $return = '';
48
 
49
+ $terms = get_terms( array( 'taxonomy' => 'pa_' . $attribute, 'hide_empty' => '0' ) );
50
 
51
  if ( 'list' == $type ) {
52
  $return = '<input type="hidden" name="' . $name . '[colors]" value="" /><input type="hidden" name="' . $name . '[labels]" value="" />';
252
  switch ( $case ) {
253
 
254
  case 'all':
255
+ $terms = get_terms( array( 'taxonomy' => $taxonomy, 'hide_empty' => true, 'exclude' => $exclude ) );
256
  break;
257
 
258
  case 'hierarchical':
259
+ $terms = get_terms( array( 'taxonomy' => $taxonomy, 'hide_empty' => true, 'exclude' => $exclude ) );
260
  if( ! in_array( $instance['type'], apply_filters( 'yith_wcan_display_type_list', array( 'list' ) ) ) ) {
261
  $terms = yit_reorder_terms_by_parent( $terms, $taxonomy );
262
  $reordered = true;
264
  break;
265
 
266
  case 'parent' :
267
+ $terms = get_terms( array( 'taxonomy' => $taxonomy, 'hide_empty' => true, 'parent' => false, 'exclude' => $exclude ) );
268
  break;
269
 
270
  default:
271
+ $args = array( 'taxonomy' => $taxonomy, 'hide_empty' => true, 'exclude' => $exclude, 'include' => $include );
272
  if ( 'parent' == $instance['display'] ) {
273
  $args['parent'] = false;
274
  }
275
 
276
+ $terms = get_terms( $args );
277
 
278
  if ( 'hierarchical' == $instance['display'] ) {
279
  if( ! in_array( $instance['type'], apply_filters( 'yith_wcan_display_type_list', array( 'list' ) ) ) ) {
336
  */
337
  function yit_term_has_child( $term, $taxonomy ) {
338
  $count = 0;
339
+ $child_terms = get_terms( array( 'taxonomy' => $taxonomy, 'child_of' => $term->term_id ) );
340
 
341
  if( ! is_wp_error( $child_terms ) ){
342
  foreach ( $child_terms as $child_term ) {
343
  $_products_in_term = get_objects_in_term( $child_term->term_id, $taxonomy );
344
+ $count += sizeof( array_intersect( $_products_in_term, YITH_WCAN()->frontend->layered_nav_product_ids ) );
345
  }
346
  }
347
 
600
  */
601
  function yit_reorder_hierachical_categories( $parent_term_id, $taxonomy = 'product_cat' ) {
602
  $childs = get_terms(
 
603
  array(
604
+ 'taxonomy' => $taxonomy,
605
+ 'parent' => $parent_term_id,
606
+ 'hierarchical' => true,
607
+ 'hide_empty' => false
608
  )
609
  );
610
 
init.php CHANGED
@@ -3,7 +3,7 @@
3
  * Plugin Name: YITH WooCommerce Ajax Product Filter
4
  * Plugin URI: http://yithemes.com/
5
  * Description: YITH WooCommerce Ajax Product Filter offers the perfect way to filter all the products of your shop.
6
- * Version: 3.0.7
7
  * Author: YITHEMES
8
  * Author URI: http://yithemes.com/
9
  * Text Domain: yith-woocommerce-ajax-navigation
@@ -64,7 +64,7 @@ load_plugin_textdomain( 'yith-woocommerce-ajax-navigation', false, dirname( plug
64
  ! defined( 'YITH_WCAN' ) && define( 'YITH_WCAN', true );
65
  ! defined( 'YITH_WCAN_URL' ) && define( 'YITH_WCAN_URL', plugin_dir_url( __FILE__ ) );
66
  ! defined( 'YITH_WCAN_DIR' ) && define( 'YITH_WCAN_DIR', plugin_dir_path( __FILE__ ) );
67
- ! defined( 'YITH_WCAN_VERSION' ) && define( 'YITH_WCAN_VERSION', '3.0.7' );
68
  ! defined( 'YITH_WCAN_FREE_INIT') && define( 'YITH_WCAN_FREE_INIT', plugin_basename( __FILE__ ) );
69
  ! defined( 'YITH_WCAN_FILE' ) && define( 'YITH_WCAN_FILE', __FILE__ );
70
 
3
  * Plugin Name: YITH WooCommerce Ajax Product Filter
4
  * Plugin URI: http://yithemes.com/
5
  * Description: YITH WooCommerce Ajax Product Filter offers the perfect way to filter all the products of your shop.
6
+ * Version: 3.0.8
7
  * Author: YITHEMES
8
  * Author URI: http://yithemes.com/
9
  * Text Domain: yith-woocommerce-ajax-navigation
64
  ! defined( 'YITH_WCAN' ) && define( 'YITH_WCAN', true );
65
  ! defined( 'YITH_WCAN_URL' ) && define( 'YITH_WCAN_URL', plugin_dir_url( __FILE__ ) );
66
  ! defined( 'YITH_WCAN_DIR' ) && define( 'YITH_WCAN_DIR', plugin_dir_path( __FILE__ ) );
67
+ ! defined( 'YITH_WCAN_VERSION' ) && define( 'YITH_WCAN_VERSION', '3.0.8' );
68
  ! defined( 'YITH_WCAN_FREE_INIT') && define( 'YITH_WCAN_FREE_INIT', plugin_basename( __FILE__ ) );
69
  ! defined( 'YITH_WCAN_FILE' ) && define( 'YITH_WCAN_FILE', __FILE__ );
70
 
plugin-fw/init.php CHANGED
@@ -1,7 +1,7 @@
1
  <?php
2
  /**
3
  * Framework Name: YIT Plugin Framework
4
- * Version: 2.9.35
5
  * Author: Yithemes
6
  * Text Domain: yith-plugin-fw
7
  * Domain Path: /languages/
1
  <?php
2
  /**
3
  * Framework Name: YIT Plugin Framework
4
+ * Version: 2.9.36
5
  * Author: Yithemes
6
  * Text Domain: yith-plugin-fw
7
  * Domain Path: /languages/
plugin-fw/lib/yit-plugin-panel-wc.php CHANGED
@@ -369,7 +369,7 @@ if ( ! class_exists( 'YIT_Plugin_Panel_WooCommerce' ) ) {
369
  wp_enqueue_script( 'woocommerce_settings', $woocommerce->plugin_url() . '/assets/js/admin/settings.min.js', $woocommerce_settings_deps, $woocommerce_version, true );
370
 
371
  wp_register_script( 'colorbox', YIT_CORE_PLUGIN_URL . '/assets/js/jquery.colorbox.js', array( 'jquery' ), '1.6.3', true );
372
- wp_register_script( 'yit-plugin-panel', YIT_CORE_PLUGIN_URL . '/assets/js/yit-plugin-panel.min.js', array( 'jquery', 'jquery-chosen' ), $this->version, true );
373
  wp_localize_script( 'woocommerce_settings', 'woocommerce_settings_params', array(
374
  'i18n_nav_warning' => __( 'The changes you have made will be lost if you leave this page.', 'yith-plugin-fw' )
375
  ) );
369
  wp_enqueue_script( 'woocommerce_settings', $woocommerce->plugin_url() . '/assets/js/admin/settings.min.js', $woocommerce_settings_deps, $woocommerce_version, true );
370
 
371
  wp_register_script( 'colorbox', YIT_CORE_PLUGIN_URL . '/assets/js/jquery.colorbox.js', array( 'jquery' ), '1.6.3', true );
372
+ wp_register_script( 'yit-plugin-panel', YIT_CORE_PLUGIN_URL . '/assets/js/yit-plugin-panel.min.js', array( 'jquery', 'jquery-chosen','wp-color-picker' ), $this->version, true );
373
  wp_localize_script( 'woocommerce_settings', 'woocommerce_settings_params', array(
374
  'i18n_nav_warning' => __( 'The changes you have made will be lost if you leave this page.', 'yith-plugin-fw' )
375
  ) );
widgets/class.yith-wcan-navigation-widget.php CHANGED
@@ -111,8 +111,8 @@ if ( ! class_exists( 'YITH_WCAN_Navigation_Widget' ) ) {
111
 
112
  if ( in_array( $display_type, apply_filters( 'yith_wcan_display_type_list', array( 'list' ) ) ) ) {
113
  $ancestors = get_terms(
114
- $taxonomy,
115
  array(
 
116
  'parent' => 0,
117
  'hierarchical' => true,
118
  'hide_empty' => false,
@@ -824,7 +824,7 @@ if ( ! class_exists( 'YITH_WCAN_Navigation_Widget' ) ) {
824
  $attribute = $_POST['attribute'];
825
  $return = array( 'message' => '', 'content' => $_POST );
826
 
827
- $terms = get_terms( 'pa_' . $attribute, array( 'hide_empty' => '0' ) );
828
 
829
  $settings = $this->get_settings();
830
  $widget_settings = $settings[ $this->number ];
@@ -937,7 +937,7 @@ if ( ! class_exists( 'YITH_WCAN_Navigation_Widget' ) ) {
937
  if ($name !== $taxonomy) {
938
 
939
  // Exclude query arg for current term archive
940
- while ($in_array_function($term->slug, $data['terms'])) {
941
  $key = array_search($current_term, $data);
942
  unset($data['terms'][$key]);
943
  }
111
 
112
  if ( in_array( $display_type, apply_filters( 'yith_wcan_display_type_list', array( 'list' ) ) ) ) {
113
  $ancestors = get_terms(
 
114
  array(
115
+ 'taxonomy' => $taxonomy,
116
  'parent' => 0,
117
  'hierarchical' => true,
118
  'hide_empty' => false,
824
  $attribute = $_POST['attribute'];
825
  $return = array( 'message' => '', 'content' => $_POST );
826
 
827
+ $terms = get_terms( array( 'taxonomy' => 'pa_' . $attribute, 'hide_empty' => '0' ) );
828
 
829
  $settings = $this->get_settings();
830
  $widget_settings = $settings[ $this->number ];
937
  if ($name !== $taxonomy) {
938
 
939
  // Exclude query arg for current term archive
940
+ if ($in_array_function($term->slug, $data['terms'])) {
941
  $key = array_search($current_term, $data);
942
  unset($data['terms'][$key]);
943
  }