Version Description
- Updated: YITH WooCommerce Ajax Navigation to 3.0.6 version
Download this release
Release Info
Developer | yithemes |
Plugin | YITH Essential Kit for WooCommerce #1 |
Version | 1.3.2 |
Comparing to | |
See all releases |
Code changes from version 1.3.1 to 1.3.2
- README.txt +6 -2
- init.php +1 -1
- modules/yith-woocommerce-ajax-navigation/includes/class.yith-wcan-frontend.php +8 -2
- modules/yith-woocommerce-ajax-navigation/includes/functions.yith-wcan.php +31 -4
- modules/yith-woocommerce-ajax-navigation/init.php +2 -2
- modules/yith-woocommerce-ajax-navigation/widgets/class.yith-wcan-navigation-widget.php +27 -26
- modules/yith-woocommerce-ajax-navigation/widgets/class.yith-wcan-reset-navigation-widget.php +1 -1
README.txt
CHANGED
@@ -4,7 +4,7 @@ Contributors: yithemes
|
|
4 |
Tags: woocommerce,yith woocommerce colors and labels variations,yith woocommerce zoom magnifier,yith woocommerce wishlist,yith woocommerce ajax product filter,yith woocommerce ajax search,yith woocommerce catalog mode,yith woocommerce advanced reviews, yith woocommerce badges management,yith woocommerce cart messages,yith woocommerce review reminder,yith woocommerce quick view,yith woocommerce mailchimp,yith woocommerce stripe,yith woocommerce request a quote,yith woocommerce tab manager,yith woocommerce multi vendor
|
5 |
Requires at least: 3.5.1
|
6 |
Tested up to: 4.5.2
|
7 |
-
Stable tag: 1.3.
|
8 |
License: GPLv2 or later
|
9 |
License URI: http://www.gnu.org/licenses/gpl-2.0.html
|
10 |
|
@@ -155,6 +155,10 @@ YITH Essential Kit for WooCommerce #1 will add a new submenu called "YITH Essent
|
|
155 |
|
156 |
== Changelog ==
|
157 |
|
|
|
|
|
|
|
|
|
158 |
= 1.3.1 =
|
159 |
|
160 |
* Updated: All YITH plugins to latest version
|
@@ -332,4 +336,4 @@ YITH Essential Kit for WooCommerce #1 will add a new submenu called "YITH Essent
|
|
332 |
|
333 |
== Upgrade Notice ==
|
334 |
|
335 |
-
Last Stable Tag 1.3.
|
4 |
Tags: woocommerce,yith woocommerce colors and labels variations,yith woocommerce zoom magnifier,yith woocommerce wishlist,yith woocommerce ajax product filter,yith woocommerce ajax search,yith woocommerce catalog mode,yith woocommerce advanced reviews, yith woocommerce badges management,yith woocommerce cart messages,yith woocommerce review reminder,yith woocommerce quick view,yith woocommerce mailchimp,yith woocommerce stripe,yith woocommerce request a quote,yith woocommerce tab manager,yith woocommerce multi vendor
|
5 |
Requires at least: 3.5.1
|
6 |
Tested up to: 4.5.2
|
7 |
+
Stable tag: 1.3.2
|
8 |
License: GPLv2 or later
|
9 |
License URI: http://www.gnu.org/licenses/gpl-2.0.html
|
10 |
|
155 |
|
156 |
== Changelog ==
|
157 |
|
158 |
+
= 1.3.2 =
|
159 |
+
|
160 |
+
* Updated: YITH WooCommerce Ajax Navigation to 3.0.6 version
|
161 |
+
|
162 |
= 1.3.1 =
|
163 |
|
164 |
* Updated: All YITH plugins to latest version
|
336 |
|
337 |
== Upgrade Notice ==
|
338 |
|
339 |
+
Last Stable Tag 1.3.2
|
init.php
CHANGED
@@ -7,7 +7,7 @@ Text Domain: yith-essential-kit-for-woocommerce-1
|
|
7 |
Domain Path: /languages/
|
8 |
Author: YIThemes
|
9 |
Author URI: http://yithemes.com/
|
10 |
-
Version: 1.3.
|
11 |
*/
|
12 |
|
13 |
if ( ! defined( 'ABSPATH' ) ) {
|
7 |
Domain Path: /languages/
|
8 |
Author: YIThemes
|
9 |
Author URI: http://yithemes.com/
|
10 |
+
Version: 1.3.2
|
11 |
*/
|
12 |
|
13 |
if ( ! defined( 'ABSPATH' ) ) {
|
modules/yith-woocommerce-ajax-navigation/includes/class.yith-wcan-frontend.php
CHANGED
@@ -133,8 +133,14 @@ if ( ! class_exists( 'YITH_WCAN_Frontend' ) ) {
|
|
133 |
// Get main query
|
134 |
$current_wp_query = $this->select_query_object( $query );
|
135 |
|
136 |
-
|
137 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
138 |
|
139 |
// Ensure filters are set
|
140 |
$unfiltered_args = array_merge(
|
133 |
// Get main query
|
134 |
$current_wp_query = $this->select_query_object( $query );
|
135 |
|
136 |
+
if( is_array( $current_wp_query ) ){
|
137 |
+
// Get WP Query for current page (without 'paged')
|
138 |
+
unset( $current_wp_query['paged'] );
|
139 |
+
}
|
140 |
+
|
141 |
+
else {
|
142 |
+
$current_wp_query = array();
|
143 |
+
}
|
144 |
|
145 |
// Ensure filters are set
|
146 |
$unfiltered_args = array_merge(
|
modules/yith-woocommerce-ajax-navigation/includes/functions.yith-wcan.php
CHANGED
@@ -472,7 +472,7 @@ if ( ! function_exists( 'yit_get_woocommerce_layered_nav_link' ) ) {
|
|
472 |
*/
|
473 |
function yit_get_woocommerce_layered_nav_link() {
|
474 |
$return = false;
|
475 |
-
if ( defined( 'SHOP_IS_ON_FRONT' ) || ( is_shop() && ! is_product_category()
|
476 |
$taxonomy = get_query_var( 'taxonomy' );
|
477 |
$brands_taxonomy = yit_get_brands_taxonomy();
|
478 |
$return = get_post_type_archive_link( 'product' );
|
@@ -496,12 +496,13 @@ if ( ! function_exists( 'yit_get_woocommerce_layered_nav_link' ) ) {
|
|
496 |
}
|
497 |
|
498 |
else {
|
499 |
-
$
|
|
|
500 |
}
|
501 |
-
|
502 |
return apply_filters( 'yith_wcan_untrailingslashit', true ) && is_string( $return ) ? untrailingslashit( $return ) : $return;
|
503 |
}
|
504 |
-
|
505 |
return $return;
|
506 |
}
|
507 |
}
|
@@ -673,4 +674,30 @@ if( ! function_exists( 'yit_plus_character_hack' ) ) {
|
|
673 |
function yit_plus_character_hack($link) {
|
674 |
return $link = str_replace('+', '%2B', $link);
|
675 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
676 |
}
|
472 |
*/
|
473 |
function yit_get_woocommerce_layered_nav_link() {
|
474 |
$return = false;
|
475 |
+
if ( defined( 'SHOP_IS_ON_FRONT' ) || ( is_shop() && ! is_product_category() ) ) {
|
476 |
$taxonomy = get_query_var( 'taxonomy' );
|
477 |
$brands_taxonomy = yit_get_brands_taxonomy();
|
478 |
$return = get_post_type_archive_link( 'product' );
|
496 |
}
|
497 |
|
498 |
else {
|
499 |
+
$term = get_query_var( 'term' );
|
500 |
+
$return = get_term_link( yith_wcan_is_product_attribute() && is_numeric( $term ) ? intval( $term ) : $term, $taxonomy );
|
501 |
}
|
502 |
+
|
503 |
return apply_filters( 'yith_wcan_untrailingslashit', true ) && is_string( $return ) ? untrailingslashit( $return ) : $return;
|
504 |
}
|
505 |
+
|
506 |
return $return;
|
507 |
}
|
508 |
}
|
674 |
function yit_plus_character_hack($link) {
|
675 |
return $link = str_replace('+', '%2B', $link);
|
676 |
}
|
677 |
+
}
|
678 |
+
|
679 |
+
if( ! function_exists( 'yit_in_array_ignore_case' ) ) {
|
680 |
+
/**
|
681 |
+
* Case insensitive version of in array function
|
682 |
+
*
|
683 |
+
* @return bool
|
684 |
+
*
|
685 |
+
* @since 2.8.6
|
686 |
+
* @author Andrea Grillo <andrea.grillo@yithemes.com>
|
687 |
+
*/
|
688 |
+
function yit_in_array_ignore_case( $needle, $haystack ) {
|
689 |
+
return in_array(strtolower($needle), array_map('strtolower', $haystack));
|
690 |
+
}
|
691 |
+
}
|
692 |
+
|
693 |
+
if( !function_exists( 'yith_wcan_is_product_attribute' ) ) {
|
694 |
+
/**
|
695 |
+
* Return true when on an attribute archive page
|
696 |
+
*
|
697 |
+
* @param string $attribute
|
698 |
+
* @return bool
|
699 |
+
*/
|
700 |
+
function yith_wcan_is_product_attribute( $attribute = '' ) {
|
701 |
+
return preg_match( '/pa_' . $attribute . '.*/', get_query_var( 'taxonomy' ) );
|
702 |
+
}
|
703 |
}
|
modules/yith-woocommerce-ajax-navigation/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 |
* 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.
|
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.6
|
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.6' );
|
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 |
|
modules/yith-woocommerce-ajax-navigation/widgets/class.yith-wcan-navigation-widget.php
CHANGED
@@ -67,6 +67,7 @@ if ( ! class_exists( 'YITH_WCAN_Navigation_Widget' ) ) {
|
|
67 |
$is_parent_class = 'yit-wcan-parent-terms';
|
68 |
$is_chosen_class = 'chosen';
|
69 |
$terms_type_list = ( isset( $instance['display'] ) ) ? $instance['display'] : 'all';
|
|
|
70 |
|
71 |
$instance['attribute'] = empty( $instance['attribute'] ) ? '' : $instance['attribute'];
|
72 |
$instance['extra_class'] = empty( $instance['extra_class'] ) ? '' : $instance['extra_class'];
|
@@ -159,12 +160,12 @@ if ( ! class_exists( 'YITH_WCAN_Navigation_Widget' ) ) {
|
|
159 |
set_transient( $transient_name, $_products_in_term );
|
160 |
//}
|
161 |
|
162 |
-
$option_is_set = ( isset( $_chosen_attributes[$taxonomy] ) &&
|
163 |
|
164 |
// If this is an AND query, only show options with count > 0
|
165 |
if ( $query_type == 'and' ) {
|
166 |
|
167 |
-
$count = sizeof( array_intersect( $_products_in_term, YITH_WCAN()->frontend->
|
168 |
|
169 |
// skip the term for the current archive
|
170 |
if ( $current_term == $term->$filter_term_field ) {
|
@@ -206,7 +207,7 @@ if ( ! class_exists( 'YITH_WCAN_Navigation_Widget' ) ) {
|
|
206 |
|
207 |
$current_filter = array_map( 'esc_attr', $current_filter );
|
208 |
|
209 |
-
if ( !
|
210 |
$current_filter[] = $term->$filter_term_field;
|
211 |
}
|
212 |
|
@@ -218,7 +219,7 @@ if ( ! class_exists( 'YITH_WCAN_Navigation_Widget' ) ) {
|
|
218 |
if ( $name !== $taxonomy ) {
|
219 |
|
220 |
// Exclude query arg for current term archive term
|
221 |
-
while (
|
222 |
$key = array_search( $current_term, $data );
|
223 |
unset( $data['terms'][$key] );
|
224 |
}
|
@@ -268,7 +269,7 @@ if ( ! class_exists( 'YITH_WCAN_Navigation_Widget' ) ) {
|
|
268 |
}
|
269 |
|
270 |
// Current Filter = this widget
|
271 |
-
if ( isset( $_chosen_attributes[$taxonomy] ) && is_array( $_chosen_attributes[$taxonomy]['terms'] ) &&
|
272 |
|
273 |
$class = ( $terms_type_list == 'hierarchical' && yit_term_is_child( $term ) ) ? "class='{$is_chosen_class} {$is_child_class}'" : "class='{$is_chosen_class}'";
|
274 |
|
@@ -297,7 +298,7 @@ if ( ! class_exists( 'YITH_WCAN_Navigation_Widget' ) ) {
|
|
297 |
}
|
298 |
|
299 |
// Query type Arg
|
300 |
-
if ( $query_type == 'or' && ! ( sizeof( $current_filter ) == 1 && isset( $_chosen_attributes[$taxonomy]['terms'] ) && is_array( $_chosen_attributes[$taxonomy]['terms'] ) &&
|
301 |
$link = add_query_arg( 'query_type_' . sanitize_title( $instance['attribute'] ), 'or', $link );
|
302 |
}
|
303 |
|
@@ -335,12 +336,12 @@ if ( ! class_exists( 'YITH_WCAN_Navigation_Widget' ) ) {
|
|
335 |
set_transient( $transient_name, $_products_in_term );
|
336 |
//}
|
337 |
|
338 |
-
$option_is_set = ( isset( $_chosen_attributes[$taxonomy] ) &&
|
339 |
|
340 |
// If this is an AND query, only show options with count > 0
|
341 |
if ( $query_type == 'and' ) {
|
342 |
|
343 |
-
$count = sizeof( array_intersect( $_products_in_term, YITH_WCAN()->frontend->
|
344 |
|
345 |
// skip the term for the current archive
|
346 |
if ( $current_term == $term->$filter_term_field ) {
|
@@ -382,7 +383,7 @@ if ( ! class_exists( 'YITH_WCAN_Navigation_Widget' ) ) {
|
|
382 |
|
383 |
$current_filter = array_map( 'esc_attr', $current_filter );
|
384 |
|
385 |
-
if ( !
|
386 |
$current_filter[] = $term->$filter_term_field;
|
387 |
}
|
388 |
|
@@ -394,7 +395,7 @@ if ( ! class_exists( 'YITH_WCAN_Navigation_Widget' ) ) {
|
|
394 |
if ( $name !== $taxonomy ) {
|
395 |
|
396 |
// Exclude query arg for current term archive term
|
397 |
-
while (
|
398 |
$key = array_search( $current_term, $data );
|
399 |
unset( $data['terms'][$key] );
|
400 |
}
|
@@ -444,7 +445,7 @@ if ( ! class_exists( 'YITH_WCAN_Navigation_Widget' ) ) {
|
|
444 |
}
|
445 |
|
446 |
// Current Filter = this widget
|
447 |
-
if ( isset( $_chosen_attributes[$taxonomy] ) && is_array( $_chosen_attributes[$taxonomy]['terms'] ) &&
|
448 |
|
449 |
$class = ( $terms_type_list == 'hierarchical' && yit_term_is_child( $term ) ) ? "class='{$is_chosen_class} {$is_child_class}'" : "class='{$is_chosen_class}'";
|
450 |
|
@@ -470,7 +471,7 @@ if ( ! class_exists( 'YITH_WCAN_Navigation_Widget' ) ) {
|
|
470 |
}
|
471 |
|
472 |
// Query type Arg
|
473 |
-
if ( $query_type == 'or' && ! ( sizeof( $current_filter ) == 1 && isset( $_chosen_attributes[$taxonomy]['terms'] ) &&
|
474 |
$link = add_query_arg( 'query_type_' . sanitize_title( $instance['attribute'] ), 'or', $link );
|
475 |
}
|
476 |
|
@@ -509,12 +510,12 @@ if ( ! class_exists( 'YITH_WCAN_Navigation_Widget' ) ) {
|
|
509 |
set_transient( $transient_name, $_products_in_term );
|
510 |
//}
|
511 |
|
512 |
-
$option_is_set = ( isset( $_chosen_attributes[$taxonomy] ) &&
|
513 |
|
514 |
// If this is an AND query, only show options with count > 0
|
515 |
if ( $query_type == 'and' ) {
|
516 |
|
517 |
-
$count = sizeof( array_intersect( $_products_in_term, YITH_WCAN()->frontend->
|
518 |
|
519 |
// skip the term for the current archive
|
520 |
if ( $current_term == $term->$filter_term_field ) {
|
@@ -556,7 +557,7 @@ if ( ! class_exists( 'YITH_WCAN_Navigation_Widget' ) ) {
|
|
556 |
|
557 |
$current_filter = array_map( 'esc_attr', $current_filter );
|
558 |
|
559 |
-
if ( !
|
560 |
$current_filter[] = $term->$filter_term_field;
|
561 |
}
|
562 |
|
@@ -568,7 +569,7 @@ if ( ! class_exists( 'YITH_WCAN_Navigation_Widget' ) ) {
|
|
568 |
if ( $name !== $taxonomy ) {
|
569 |
|
570 |
// Exclude query arg for current term archive term
|
571 |
-
while (
|
572 |
$key = array_search( $current_term, $data );
|
573 |
unset( $data['terms'][$key] );
|
574 |
}
|
@@ -618,7 +619,7 @@ if ( ! class_exists( 'YITH_WCAN_Navigation_Widget' ) ) {
|
|
618 |
}
|
619 |
|
620 |
// Current Filter = this widget
|
621 |
-
if ( isset( $_chosen_attributes[$taxonomy] ) && is_array( $_chosen_attributes[$taxonomy]['terms'] ) &&
|
622 |
|
623 |
$class = ( $terms_type_list == 'hierarchical' && yit_term_is_child( $term ) ) ? "class='{$is_chosen_class} {$is_child_class}'" : "class='{$is_chosen_class}'";
|
624 |
|
@@ -647,7 +648,7 @@ if ( ! class_exists( 'YITH_WCAN_Navigation_Widget' ) ) {
|
|
647 |
}
|
648 |
|
649 |
// Query type Arg
|
650 |
-
if ( $query_type == 'or' && ! ( sizeof( $current_filter ) == 1 && isset( $_chosen_attributes[$taxonomy]['terms'] ) && is_array( $_chosen_attributes[$taxonomy]['terms'] ) &&
|
651 |
$link = add_query_arg( 'query_type_' . sanitize_title( $instance['attribute'] ), 'or', $link );
|
652 |
}
|
653 |
|
@@ -678,7 +679,6 @@ if ( ! class_exists( 'YITH_WCAN_Navigation_Widget' ) ) {
|
|
678 |
|
679 |
if ( ! $this->found ) {
|
680 |
ob_end_clean();
|
681 |
-
echo substr( $before_widget, 0, strlen( $before_widget ) - 1 ) . ' style="display:none">' . $after_widget;
|
682 |
}
|
683 |
else {
|
684 |
echo ob_get_clean();
|
@@ -859,6 +859,7 @@ if ( ! class_exists( 'YITH_WCAN_Navigation_Widget' ) ) {
|
|
859 |
|
860 |
public function get_list_html( $terms, $taxonomy, $query_type, $display_type, $instance, $terms_type_list, $current_term, $args, $is_child_class, $is_parent_class, $is_chosen_class, $level = 0, $filter_term_field = 'slug' ){
|
861 |
$_chosen_attributes = YITH_WCAN()->get_layered_nav_chosen_attributes();
|
|
|
862 |
foreach ( $terms as $parent_id => $term_ids ) {
|
863 |
$term = get_term_by( 'id', $parent_id, $taxonomy );
|
864 |
|
@@ -869,11 +870,11 @@ if ( ! class_exists( 'YITH_WCAN_Navigation_Widget' ) ) {
|
|
869 |
if( 'tags' == $instance['type'] ) {
|
870 |
$term_id = yit_wcan_localize_terms( $term->term_id, $taxonomy );
|
871 |
if ( 'exclude' == $instance['tags_list_query'] ){
|
872 |
-
$echo = !
|
873 |
}
|
874 |
|
875 |
elseif ( 'include' == $instance['tags_list_query'] ){
|
876 |
-
$echo =
|
877 |
}
|
878 |
}
|
879 |
|
@@ -895,7 +896,7 @@ if ( ! class_exists( 'YITH_WCAN_Navigation_Widget' ) ) {
|
|
895 |
set_transient($transient_name, $_products_in_term);
|
896 |
//}
|
897 |
|
898 |
-
$option_is_set = (isset($_chosen_attributes[$taxonomy]) &&
|
899 |
|
900 |
$term_param = apply_filters('yith_wcan_term_param_uri', $term->$filter_term_field, $display_type, $term);
|
901 |
|
@@ -923,7 +924,7 @@ if ( ! class_exists( 'YITH_WCAN_Navigation_Widget' ) ) {
|
|
923 |
|
924 |
$current_filter = array_map('esc_attr', $current_filter);
|
925 |
|
926 |
-
if (!
|
927 |
$current_filter[] = $term_param;
|
928 |
}
|
929 |
|
@@ -935,7 +936,7 @@ if ( ! class_exists( 'YITH_WCAN_Navigation_Widget' ) ) {
|
|
935 |
if ($name !== $taxonomy) {
|
936 |
|
937 |
// Exclude query arg for current term archive
|
938 |
-
while (
|
939 |
$key = array_search($current_term, $data);
|
940 |
unset($data['terms'][$key]);
|
941 |
}
|
@@ -985,7 +986,7 @@ if ( ! class_exists( 'YITH_WCAN_Navigation_Widget' ) ) {
|
|
985 |
);
|
986 |
}
|
987 |
|
988 |
-
$check_for_current_widget = isset($_chosen_attributes[$taxonomy]) && is_array($_chosen_attributes[$taxonomy]['terms']) &&
|
989 |
$class = '';
|
990 |
|
991 |
// Current Filter = this widget
|
@@ -1041,7 +1042,7 @@ if ( ! class_exists( 'YITH_WCAN_Navigation_Widget' ) ) {
|
|
1041 |
$is_attribute = apply_filters('yith_wcan_is_attribute_check', true);
|
1042 |
|
1043 |
// Query type Arg
|
1044 |
-
if ($is_attribute && $query_type == 'or' && !(sizeof($current_filter) == 1 && isset($_chosen_attributes[$taxonomy]['terms']) && is_array($_chosen_attributes[$taxonomy]['terms']) &&
|
1045 |
$link = add_query_arg('query_type_' . sanitize_title($instance['attribute']), 'or', $link);
|
1046 |
}
|
1047 |
|
67 |
$is_parent_class = 'yit-wcan-parent-terms';
|
68 |
$is_chosen_class = 'chosen';
|
69 |
$terms_type_list = ( isset( $instance['display'] ) ) ? $instance['display'] : 'all';
|
70 |
+
$in_array_function = apply_filters( 'yith_wcan_in_array_ignor_case', false ) ? 'yit_in_array_ignore_case' : 'in_array';
|
71 |
|
72 |
$instance['attribute'] = empty( $instance['attribute'] ) ? '' : $instance['attribute'];
|
73 |
$instance['extra_class'] = empty( $instance['extra_class'] ) ? '' : $instance['extra_class'];
|
160 |
set_transient( $transient_name, $_products_in_term );
|
161 |
//}
|
162 |
|
163 |
+
$option_is_set = ( isset( $_chosen_attributes[$taxonomy] ) && $in_array_function( $term->$filter_term_field, $_chosen_attributes[$taxonomy]['terms'] ) );
|
164 |
|
165 |
// If this is an AND query, only show options with count > 0
|
166 |
if ( $query_type == 'and' ) {
|
167 |
|
168 |
+
$count = sizeof( array_intersect( $_products_in_term, YITH_WCAN()->frontend->layered_nav_product_ids ) );
|
169 |
|
170 |
// skip the term for the current archive
|
171 |
if ( $current_term == $term->$filter_term_field ) {
|
207 |
|
208 |
$current_filter = array_map( 'esc_attr', $current_filter );
|
209 |
|
210 |
+
if ( ! $in_array_function( $term->$filter_term_field, $current_filter ) ) {
|
211 |
$current_filter[] = $term->$filter_term_field;
|
212 |
}
|
213 |
|
219 |
if ( $name !== $taxonomy ) {
|
220 |
|
221 |
// Exclude query arg for current term archive term
|
222 |
+
while ( $in_array_function( $current_term, $data['terms'] ) ) {
|
223 |
$key = array_search( $current_term, $data );
|
224 |
unset( $data['terms'][$key] );
|
225 |
}
|
269 |
}
|
270 |
|
271 |
// Current Filter = this widget
|
272 |
+
if ( isset( $_chosen_attributes[$taxonomy] ) && is_array( $_chosen_attributes[$taxonomy]['terms'] ) && $in_array_function( $term->$filter_term_field, $_chosen_attributes[$taxonomy]['terms'] ) ) {
|
273 |
|
274 |
$class = ( $terms_type_list == 'hierarchical' && yit_term_is_child( $term ) ) ? "class='{$is_chosen_class} {$is_child_class}'" : "class='{$is_chosen_class}'";
|
275 |
|
298 |
}
|
299 |
|
300 |
// Query type Arg
|
301 |
+
if ( $query_type == 'or' && ! ( sizeof( $current_filter ) == 1 && isset( $_chosen_attributes[$taxonomy]['terms'] ) && is_array( $_chosen_attributes[$taxonomy]['terms'] ) && $in_array_function( $term->$filter_term_field, $_chosen_attributes[$taxonomy]['terms'] ) ) ) {
|
302 |
$link = add_query_arg( 'query_type_' . sanitize_title( $instance['attribute'] ), 'or', $link );
|
303 |
}
|
304 |
|
336 |
set_transient( $transient_name, $_products_in_term );
|
337 |
//}
|
338 |
|
339 |
+
$option_is_set = ( isset( $_chosen_attributes[$taxonomy] ) && $in_array_function( $term->$filter_term_field, $_chosen_attributes[$taxonomy]['terms'] ) );
|
340 |
|
341 |
// If this is an AND query, only show options with count > 0
|
342 |
if ( $query_type == 'and' ) {
|
343 |
|
344 |
+
$count = sizeof( array_intersect( $_products_in_term, YITH_WCAN()->frontend->layered_nav_product_ids ) );
|
345 |
|
346 |
// skip the term for the current archive
|
347 |
if ( $current_term == $term->$filter_term_field ) {
|
383 |
|
384 |
$current_filter = array_map( 'esc_attr', $current_filter );
|
385 |
|
386 |
+
if ( ! $in_array_function( $term->$filter_term_field, $current_filter ) ) {
|
387 |
$current_filter[] = $term->$filter_term_field;
|
388 |
}
|
389 |
|
395 |
if ( $name !== $taxonomy ) {
|
396 |
|
397 |
// Exclude query arg for current term archive term
|
398 |
+
while ( $in_array_function( $current_term, $data['terms'] ) ) {
|
399 |
$key = array_search( $current_term, $data );
|
400 |
unset( $data['terms'][$key] );
|
401 |
}
|
445 |
}
|
446 |
|
447 |
// Current Filter = this widget
|
448 |
+
if ( isset( $_chosen_attributes[$taxonomy] ) && is_array( $_chosen_attributes[$taxonomy]['terms'] ) && $in_array_function( $term->$filter_term_field, $_chosen_attributes[$taxonomy]['terms'] ) ) {
|
449 |
|
450 |
$class = ( $terms_type_list == 'hierarchical' && yit_term_is_child( $term ) ) ? "class='{$is_chosen_class} {$is_child_class}'" : "class='{$is_chosen_class}'";
|
451 |
|
471 |
}
|
472 |
|
473 |
// Query type Arg
|
474 |
+
if ( $query_type == 'or' && ! ( sizeof( $current_filter ) == 1 && isset( $_chosen_attributes[$taxonomy]['terms'] ) && $in_array_function( $_chosen_attributes[$taxonomy]['terms'] ) && $in_array_function( $term->$filter_term_field, $_chosen_attributes[$taxonomy]['terms'] ) ) ) {
|
475 |
$link = add_query_arg( 'query_type_' . sanitize_title( $instance['attribute'] ), 'or', $link );
|
476 |
}
|
477 |
|
510 |
set_transient( $transient_name, $_products_in_term );
|
511 |
//}
|
512 |
|
513 |
+
$option_is_set = ( isset( $_chosen_attributes[$taxonomy] ) && $in_array_function( $term->$filter_term_field, $_chosen_attributes[$taxonomy]['terms'] ) );
|
514 |
|
515 |
// If this is an AND query, only show options with count > 0
|
516 |
if ( $query_type == 'and' ) {
|
517 |
|
518 |
+
$count = sizeof( array_intersect( $_products_in_term, YITH_WCAN()->frontend->layered_nav_product_ids ) );
|
519 |
|
520 |
// skip the term for the current archive
|
521 |
if ( $current_term == $term->$filter_term_field ) {
|
557 |
|
558 |
$current_filter = array_map( 'esc_attr', $current_filter );
|
559 |
|
560 |
+
if ( ! $in_array_function( $term->$filter_term_field, $current_filter ) ) {
|
561 |
$current_filter[] = $term->$filter_term_field;
|
562 |
}
|
563 |
|
569 |
if ( $name !== $taxonomy ) {
|
570 |
|
571 |
// Exclude query arg for current term archive term
|
572 |
+
while ( $in_array_function( $current_term, $data['terms'] ) ) {
|
573 |
$key = array_search( $current_term, $data );
|
574 |
unset( $data['terms'][$key] );
|
575 |
}
|
619 |
}
|
620 |
|
621 |
// Current Filter = this widget
|
622 |
+
if ( isset( $_chosen_attributes[$taxonomy] ) && is_array( $_chosen_attributes[$taxonomy]['terms'] ) && $in_array_function( $term->$filter_term_field, $_chosen_attributes[$taxonomy]['terms'] ) ) {
|
623 |
|
624 |
$class = ( $terms_type_list == 'hierarchical' && yit_term_is_child( $term ) ) ? "class='{$is_chosen_class} {$is_child_class}'" : "class='{$is_chosen_class}'";
|
625 |
|
648 |
}
|
649 |
|
650 |
// Query type Arg
|
651 |
+
if ( $query_type == 'or' && ! ( sizeof( $current_filter ) == 1 && isset( $_chosen_attributes[$taxonomy]['terms'] ) && is_array( $_chosen_attributes[$taxonomy]['terms'] ) && $in_array_function( $term->$filter_term_field, $_chosen_attributes[$taxonomy]['terms'] ) ) ) {
|
652 |
$link = add_query_arg( 'query_type_' . sanitize_title( $instance['attribute'] ), 'or', $link );
|
653 |
}
|
654 |
|
679 |
|
680 |
if ( ! $this->found ) {
|
681 |
ob_end_clean();
|
|
|
682 |
}
|
683 |
else {
|
684 |
echo ob_get_clean();
|
859 |
|
860 |
public function get_list_html( $terms, $taxonomy, $query_type, $display_type, $instance, $terms_type_list, $current_term, $args, $is_child_class, $is_parent_class, $is_chosen_class, $level = 0, $filter_term_field = 'slug' ){
|
861 |
$_chosen_attributes = YITH_WCAN()->get_layered_nav_chosen_attributes();
|
862 |
+
$in_array_function = apply_filters( 'yith_wcan_in_array_ignor_case', false ) ? 'yit_in_array_ignore_case' : 'in_array';
|
863 |
foreach ( $terms as $parent_id => $term_ids ) {
|
864 |
$term = get_term_by( 'id', $parent_id, $taxonomy );
|
865 |
|
870 |
if( 'tags' == $instance['type'] ) {
|
871 |
$term_id = yit_wcan_localize_terms( $term->term_id, $taxonomy );
|
872 |
if ( 'exclude' == $instance['tags_list_query'] ){
|
873 |
+
$echo = ! $in_array_function( $term_id, $exclude );
|
874 |
}
|
875 |
|
876 |
elseif ( 'include' == $instance['tags_list_query'] ){
|
877 |
+
$echo = $in_array_function( $term_id, $include );
|
878 |
}
|
879 |
}
|
880 |
|
896 |
set_transient($transient_name, $_products_in_term);
|
897 |
//}
|
898 |
|
899 |
+
$option_is_set = (isset($_chosen_attributes[$taxonomy]) && $in_array_function($term->term_id, $_chosen_attributes[$taxonomy]['terms']));
|
900 |
|
901 |
$term_param = apply_filters('yith_wcan_term_param_uri', $term->$filter_term_field, $display_type, $term);
|
902 |
|
924 |
|
925 |
$current_filter = array_map('esc_attr', $current_filter);
|
926 |
|
927 |
+
if ( ! $in_array_function( $term_param, $current_filter ) ) {
|
928 |
$current_filter[] = $term_param;
|
929 |
}
|
930 |
|
936 |
if ($name !== $taxonomy) {
|
937 |
|
938 |
// Exclude query arg for current term archive
|
939 |
+
while ($in_array_function($term->slug, $data['terms'])) {
|
940 |
$key = array_search($current_term, $data);
|
941 |
unset($data['terms'][$key]);
|
942 |
}
|
986 |
);
|
987 |
}
|
988 |
|
989 |
+
$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']);
|
990 |
$class = '';
|
991 |
|
992 |
// Current Filter = this widget
|
1042 |
$is_attribute = apply_filters('yith_wcan_is_attribute_check', true);
|
1043 |
|
1044 |
// Query type Arg
|
1045 |
+
if ($is_attribute && $query_type == 'or' && !(sizeof($current_filter) == 1 && isset($_chosen_attributes[$taxonomy]['terms']) && is_array($_chosen_attributes[$taxonomy]['terms']) && $in_array_function($term->$filter_term_field, $_chosen_attributes[$taxonomy]['terms']))) {
|
1046 |
$link = add_query_arg('query_type_' . sanitize_title($instance['attribute']), 'or', $link);
|
1047 |
}
|
1048 |
|
modules/yith-woocommerce-ajax-navigation/widgets/class.yith-wcan-reset-navigation-widget.php
CHANGED
@@ -81,7 +81,7 @@ if ( ! class_exists( 'YITH_WCAN_Reset_Navigation_Widget' ) ) {
|
|
81 |
}
|
82 |
else {
|
83 |
ob_end_clean();
|
84 |
-
|
85 |
}
|
86 |
}
|
87 |
|
81 |
}
|
82 |
else {
|
83 |
ob_end_clean();
|
84 |
+
printf( '%s%s', str_replace( '>', ' style="display:none">', $before_widget ), $after_widget );
|
85 |
}
|
86 |
}
|
87 |
|