YITH WooCommerce Ajax Product Filter - Version 3.4.2

Version Description

  • Released: 05 Jun, 2017 =

  • New: Support to Basel theme

  • Fix: Unable to filter in vendor page

Download this release

Release Info

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

Code changes from version 3.4.1 to 3.4.2

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.7.5
7
- Stable tag: 3.4.1
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
@@ -159,6 +159,11 @@ If you want to see a demonstration version of the premium plugin, you can see it
159
 
160
  == Changelog ==
161
 
 
 
 
 
 
162
  = 3.4.1 Released: 18 May, 2017 =
163
 
164
  * Fix: Issue with reset button in product_cat page
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.7.5
7
+ Stable tag: 3.4.2
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
159
 
160
  == Changelog ==
161
 
162
+ = 3.4.2 - Released: 05 Jun, 2017 =
163
+
164
+ * New: Support to Basel theme
165
+ * Fix: Unable to filter in vendor page
166
+
167
  = 3.4.1 Released: 18 May, 2017 =
168
 
169
  * Fix: Issue with reset button in product_cat page
includes/class.yith-wcan-frontend.php CHANGED
@@ -121,7 +121,14 @@ if ( ! class_exists( 'YITH_WCAN_Frontend' ) ) {
121
  $filtered_posts = array();
122
  $queried_post_ids = array();
123
 
124
- if( class_exists( 'QTX_Translator' ) && defined('YIT_CORE_VERSION') && '1.0.0' == YIT_CORE_VERSION ){
 
 
 
 
 
 
 
125
  add_filter( 'yith_wcan_skip_layered_nav_query', '__return_true' );
126
  }
127
 
121
  $filtered_posts = array();
122
  $queried_post_ids = array();
123
 
124
+ $problematic_theme = array(
125
+ 'basel'
126
+ );
127
+
128
+ $is_qTranslateX_and_yit_core_1_0_0 = class_exists( 'QTX_Translator' ) && defined('YIT_CORE_VERSION') && '1.0.0' == YIT_CORE_VERSION;
129
+ $is_problematic_theme = in_array( wp_get_theme()->get_template(), $problematic_theme );
130
+
131
+ if( $is_qTranslateX_and_yit_core_1_0_0 || $is_problematic_theme ){
132
  add_filter( 'yith_wcan_skip_layered_nav_query', '__return_true' );
133
  }
134
 
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.4.1
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.4.1' );
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.4.2
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.4.2' );
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
 
widgets/class.yith-wcan-navigation-widget.php CHANGED
@@ -293,7 +293,13 @@ if ( ! class_exists( 'YITH_WCAN_Navigation_Widget' ) ) {
293
  }
294
 
295
  if( is_product_taxonomy() && ! yit_is_filtered_uri() && $term->term_id != $queried_object->term_id ){
296
- $link = add_query_arg( array( 'source_id' => $queried_object->term_id, 'source_tax' => $queried_object->taxonomy ), $link );
 
 
 
 
 
 
297
  }
298
 
299
  if ( isset( $_GET['source_id'] ) && isset( $_GET['source_tax'] ) ) {
@@ -306,10 +312,18 @@ if ( ! class_exists( 'YITH_WCAN_Navigation_Widget' ) ) {
306
  }
307
 
308
  if( $add_source_id ) {
309
- $link = add_query_arg( array( 'source_id' => $_GET['source_id'], 'source_tax' => $_GET['source_tax'] ), $link );
 
 
 
 
310
  }
311
  }
312
 
 
 
 
 
313
  // Current Filter = this widget
314
  if ( isset( $_chosen_attributes[$taxonomy] ) && is_array( $_chosen_attributes[$taxonomy]['terms'] ) && $in_array_function( $term->$filter_term_field, $_chosen_attributes[$taxonomy]['terms'] ) ) {
315
 
@@ -499,7 +513,12 @@ if ( ! class_exists( 'YITH_WCAN_Navigation_Widget' ) ) {
499
  }
500
 
501
  if( is_product_taxonomy() && ! yit_is_filtered_uri() && $term->term_id != $queried_object->term_id ){
502
- $link = add_query_arg( array( 'source_id' => $queried_object->term_id, 'source_tax' => $queried_object->taxonomy ), $link );
 
 
 
 
 
503
  }
504
 
505
  if ( isset( $_GET['source_id'] ) && isset( $_GET['source_tax'] ) ) {
@@ -512,10 +531,15 @@ if ( ! class_exists( 'YITH_WCAN_Navigation_Widget' ) ) {
512
  }
513
 
514
  if( $add_source_id ) {
515
- $link = add_query_arg( array( 'source_id' => $_GET['source_id'], 'source_tax' => $_GET['source_tax'] ), $link );
 
516
  }
517
  }
518
 
 
 
 
 
519
  // Current Filter = this widget
520
  if ( isset( $_chosen_attributes[$taxonomy] ) && is_array( $_chosen_attributes[$taxonomy]['terms'] ) && $in_array_function( $term->$filter_term_field, $_chosen_attributes[$taxonomy]['terms'] ) ) {
521
 
@@ -704,7 +728,12 @@ if ( ! class_exists( 'YITH_WCAN_Navigation_Widget' ) ) {
704
  }
705
 
706
  if( is_product_taxonomy() && ! yit_is_filtered_uri() && $term->term_id != $queried_object->term_id ){
707
- $link = add_query_arg( array( 'source_id' => $queried_object->term_id, 'source_tax' => $queried_object->taxonomy ), $link );
 
 
 
 
 
708
  }
709
 
710
  if ( isset( $_GET['source_id'] ) && isset( $_GET['source_tax'] ) ) {
@@ -717,10 +746,15 @@ if ( ! class_exists( 'YITH_WCAN_Navigation_Widget' ) ) {
717
  }
718
 
719
  if( $add_source_id ) {
720
- $link = add_query_arg( array( 'source_id' => $_GET['source_id'], 'source_tax' => $_GET['source_tax'] ), $link );
 
721
  }
722
  }
723
 
 
 
 
 
724
  // Current Filter = this widget
725
  if ( isset( $_chosen_attributes[$taxonomy] ) && is_array( $_chosen_attributes[$taxonomy]['terms'] ) && $in_array_function( $term->$filter_term_field, $_chosen_attributes[$taxonomy]['terms'] ) ) {
726
 
@@ -1098,10 +1132,15 @@ if ( ! class_exists( 'YITH_WCAN_Navigation_Widget' ) ) {
1098
  }
1099
 
1100
  if( $add_source_id ) {
1101
- $link = add_query_arg( array( 'source_id' => $_GET['source_id'], 'source_tax' => $_GET['source_tax'] ), $link );
 
1102
  }
1103
  }
1104
 
 
 
 
 
1105
  if (isset($_GET['product_cat'])) {
1106
  $categories_filter_operator = 'and' == $query_type ? '+' : ',';
1107
  $_chosen_categories = explode($categories_filter_operator, urlencode($_GET['product_cat']));
@@ -1118,7 +1157,12 @@ if ( ! class_exists( 'YITH_WCAN_Navigation_Widget' ) ) {
1118
  }
1119
 
1120
  if( is_product_taxonomy() && ! yit_is_filtered_uri() && $term->term_id != $queried_object->term_id ){
1121
- $link = add_query_arg( array( 'source_id' => $queried_object->term_id, 'source_tax' => $queried_object->taxonomy ), $link );
 
 
 
 
 
1122
  }
1123
 
1124
  $check_for_current_widget = isset($_chosen_attributes[$taxonomy]) && is_array($_chosen_attributes[$taxonomy]['terms']) && $in_array_function($term->$filter_term_field, $_chosen_attributes[$taxonomy]['terms']);
293
  }
294
 
295
  if( is_product_taxonomy() && ! yit_is_filtered_uri() && $term->term_id != $queried_object->term_id ){
296
+
297
+ $link = add_query_arg(
298
+ array(
299
+ 'source_id' => $queried_object->term_id,
300
+ 'source_tax' => $queried_object->taxonomy,
301
+ $queried_object->taxonomy => $queried_object->slug
302
+ ), $link );
303
  }
304
 
305
  if ( isset( $_GET['source_id'] ) && isset( $_GET['source_tax'] ) ) {
312
  }
313
 
314
  if( $add_source_id ) {
315
+ $args = array( 'source_id' => $_GET['source_id'], 'source_tax' => $_GET['source_tax'] );
316
+ if( isset( $_GET[ $queried_object->taxonomy ] ) ){
317
+ $args[ $queried_object->taxonomy ] = $_GET[ $queried_object->taxonomy ];
318
+ }
319
+ $link = add_query_arg( $args, $link );
320
  }
321
  }
322
 
323
+ if( isset( $_GET['yith_shop_vendor'] ) ){
324
+ $link = add_query_arg( array( 'yith_shop_vendor' => $_GET['yith_shop_vendor'] ), $link );
325
+ }
326
+
327
  // Current Filter = this widget
328
  if ( isset( $_chosen_attributes[$taxonomy] ) && is_array( $_chosen_attributes[$taxonomy]['terms'] ) && $in_array_function( $term->$filter_term_field, $_chosen_attributes[$taxonomy]['terms'] ) ) {
329
 
513
  }
514
 
515
  if( is_product_taxonomy() && ! yit_is_filtered_uri() && $term->term_id != $queried_object->term_id ){
516
+ $link = add_query_arg(
517
+ array(
518
+ 'source_id' => $queried_object->term_id,
519
+ 'source_tax' => $queried_object->taxonomy,
520
+ $queried_object->taxonomy => $queried_object->slug
521
+ ), $link );
522
  }
523
 
524
  if ( isset( $_GET['source_id'] ) && isset( $_GET['source_tax'] ) ) {
531
  }
532
 
533
  if( $add_source_id ) {
534
+ $args = array( 'source_id' => $_GET['source_id'], 'source_tax' => $_GET['source_tax'] );
535
+ $link = add_query_arg( $args, $link );
536
  }
537
  }
538
 
539
+ if( isset( $_GET['yith_shop_vendor'] ) ){
540
+ $link = add_query_arg( array( 'yith_shop_vendor' => $_GET['yith_shop_vendor'] ), $link );
541
+ }
542
+
543
  // Current Filter = this widget
544
  if ( isset( $_chosen_attributes[$taxonomy] ) && is_array( $_chosen_attributes[$taxonomy]['terms'] ) && $in_array_function( $term->$filter_term_field, $_chosen_attributes[$taxonomy]['terms'] ) ) {
545
 
728
  }
729
 
730
  if( is_product_taxonomy() && ! yit_is_filtered_uri() && $term->term_id != $queried_object->term_id ){
731
+ $link = add_query_arg(
732
+ array(
733
+ 'source_id' => $queried_object->term_id,
734
+ 'source_tax' => $queried_object->taxonomy,
735
+ $queried_object->taxonomy => $queried_object->slug
736
+ ), $link );
737
  }
738
 
739
  if ( isset( $_GET['source_id'] ) && isset( $_GET['source_tax'] ) ) {
746
  }
747
 
748
  if( $add_source_id ) {
749
+ $args = array( 'source_id' => $_GET['source_id'], 'source_tax' => $_GET['source_tax'] );
750
+ $link = add_query_arg( $args, $link );
751
  }
752
  }
753
 
754
+ if( isset( $_GET['yith_shop_vendor'] ) ){
755
+ $link = add_query_arg( array( 'yith_shop_vendor' => $_GET['yith_shop_vendor'] ), $link );
756
+ }
757
+
758
  // Current Filter = this widget
759
  if ( isset( $_chosen_attributes[$taxonomy] ) && is_array( $_chosen_attributes[$taxonomy]['terms'] ) && $in_array_function( $term->$filter_term_field, $_chosen_attributes[$taxonomy]['terms'] ) ) {
760
 
1132
  }
1133
 
1134
  if( $add_source_id ) {
1135
+ $args = array( 'source_id' => $_GET['source_id'], 'source_tax' => $_GET['source_tax'] );
1136
+ $link = add_query_arg( $args, $link );
1137
  }
1138
  }
1139
 
1140
+ if( isset( $_GET['yith_shop_vendor'] ) ){
1141
+ $link = add_query_arg( array( 'yith_shop_vendor' => $_GET['yith_shop_vendor'] ), $link );
1142
+ }
1143
+
1144
  if (isset($_GET['product_cat'])) {
1145
  $categories_filter_operator = 'and' == $query_type ? '+' : ',';
1146
  $_chosen_categories = explode($categories_filter_operator, urlencode($_GET['product_cat']));
1157
  }
1158
 
1159
  if( is_product_taxonomy() && ! yit_is_filtered_uri() && $term->term_id != $queried_object->term_id ){
1160
+ $link = add_query_arg(
1161
+ array(
1162
+ 'source_id' => $queried_object->term_id,
1163
+ 'source_tax' => $queried_object->taxonomy,
1164
+ $queried_object->taxonomy => $queried_object->slug
1165
+ ), $link );
1166
  }
1167
 
1168
  $check_for_current_widget = isset($_chosen_attributes[$taxonomy]) && is_array($_chosen_attributes[$taxonomy]['terms']) && $in_array_function($term->$filter_term_field, $_chosen_attributes[$taxonomy]['terms']);