Version Description
Released on 11 December 2019 =
Fix: Filter not working on product tag page
Update: plugin framework
Download this release
Release Info
Developer | yithemes |
Plugin | YITH WooCommerce Ajax Product Filter |
Version | 3.8.3 |
Comparing to | |
See all releases |
Code changes from version 3.8.2 to 3.8.3
- README.txt +7 -3
- includes/class.yith-wcan-admin.php +1 -1
- includes/class.yith-wcan-frontend.php +97 -95
- includes/functions.yith-wcan.php +4 -0
- init.php +2 -2
- plugin-fw/init.php +2 -2
- plugin-fw/languages/yith-plugin-fw-es_ES.mo +0 -0
- plugin-fw/languages/yith-plugin-fw-es_ES.po +3 -3
- plugin-fw/lib/yit-plugin-panel-wc.php +8 -1
- plugin-fw/lib/yit-plugin-panel.php +1 -1
- plugin-fw/yit-plugin.php +2 -1
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: 5.3
|
7 |
-
Stable tag: 3.8.
|
8 |
License: GPLv2 or later
|
9 |
License URI: http://www.gnu.org/licenses/gpl-2.0.html
|
10 |
|
@@ -159,10 +159,14 @@ If you want to see a demonstration version of the premium plugin, you can see it
|
|
159 |
|
160 |
== Changelog ==
|
161 |
|
162 |
-
= 3.8.
|
|
|
|
|
|
|
|
|
|
|
163 |
|
164 |
* Update: plugin framework
|
165 |
-
* Update: Notice handler
|
166 |
|
167 |
= 3.8.1 - Released on 04 November 2019 =
|
168 |
|
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: 5.3
|
7 |
+
Stable tag: 3.8.3
|
8 |
License: GPLv2 or later
|
9 |
License URI: http://www.gnu.org/licenses/gpl-2.0.html
|
10 |
|
159 |
|
160 |
== Changelog ==
|
161 |
|
162 |
+
= 3.8.3 - Released on 11 December 2019 =
|
163 |
+
|
164 |
+
* Fix: Filter not working on product tag page
|
165 |
+
* Update: plugin framework
|
166 |
+
|
167 |
+
= 3.8.2 - Released on 28 November 2019 =
|
168 |
|
169 |
* Update: plugin framework
|
|
|
170 |
|
171 |
= 3.8.1 - Released on 04 November 2019 =
|
172 |
|
includes/class.yith-wcan-admin.php
CHANGED
@@ -230,7 +230,7 @@ if ( ! class_exists( 'YITH_WCAN_Admin' ) ) {
|
|
230 |
* @return string The premium landing link
|
231 |
*/
|
232 |
public function get_premium_landing_uri() {
|
233 |
-
return
|
234 |
}
|
235 |
|
236 |
/**
|
230 |
* @return string The premium landing link
|
231 |
*/
|
232 |
public function get_premium_landing_uri() {
|
233 |
+
return $this->_premium_landing;
|
234 |
}
|
235 |
|
236 |
/**
|
includes/class.yith-wcan-frontend.php
CHANGED
@@ -120,101 +120,103 @@ if ( ! class_exists( 'YITH_WCAN_Frontend' ) ) {
|
|
120 |
|
121 |
else{
|
122 |
|
123 |
-
|
124 |
-
|
125 |
-
|
126 |
-
|
127 |
-
|
128 |
-
|
129 |
-
|
130 |
-
|
131 |
-
|
132 |
-
|
133 |
-
|
134 |
-
|
135 |
-
|
136 |
-
|
137 |
-
|
138 |
-
|
139 |
-
$
|
140 |
-
|
141 |
-
|
142 |
-
|
143 |
-
|
144 |
-
|
145 |
-
|
146 |
-
|
147 |
-
|
148 |
-
|
149 |
-
|
150 |
-
|
151 |
-
|
152 |
-
|
153 |
-
|
154 |
-
|
155 |
-
|
156 |
-
|
157 |
-
|
158 |
-
|
159 |
-
|
160 |
-
|
161 |
-
|
162 |
-
|
163 |
-
|
164 |
-
|
165 |
-
|
166 |
-
|
167 |
-
|
168 |
-
|
169 |
-
|
170 |
-
|
171 |
-
|
172 |
-
|
173 |
-
|
174 |
-
|
175 |
-
|
176 |
-
|
177 |
-
|
178 |
-
|
179 |
-
|
180 |
-
|
181 |
-
|
182 |
-
|
183 |
-
|
184 |
-
|
185 |
-
|
186 |
-
|
187 |
-
|
188 |
-
|
189 |
-
|
190 |
-
|
191 |
-
|
192 |
-
|
193 |
-
|
194 |
-
|
195 |
-
|
196 |
-
|
197 |
-
|
198 |
-
|
199 |
-
|
200 |
-
|
201 |
-
|
202 |
-
|
203 |
-
|
204 |
-
|
205 |
-
|
206 |
-
|
207 |
-
|
208 |
-
|
209 |
-
|
210 |
-
|
211 |
-
|
212 |
-
|
213 |
-
|
214 |
-
|
215 |
-
|
216 |
-
|
217 |
-
|
|
|
|
|
218 |
}
|
219 |
return $posts;
|
220 |
}
|
120 |
|
121 |
else{
|
122 |
|
123 |
+
if( is_shop() || is_product_taxonomy() || ! apply_filters( 'yith_wcan_is_search', is_search() ) ){
|
124 |
+
$filtered_posts = array();
|
125 |
+
$queried_post_ids = array();
|
126 |
+
|
127 |
+
$problematic_theme = array(
|
128 |
+
'basel',
|
129 |
+
'ux-shop',
|
130 |
+
'aardvark'
|
131 |
+
);
|
132 |
+
|
133 |
+
$wp_theme = wp_get_theme();
|
134 |
+
$template_name = $wp_theme->get_template();
|
135 |
+
|
136 |
+
/**
|
137 |
+
* Support for Flatsome Theme lower then 3.6.0
|
138 |
+
*/
|
139 |
+
if( 'flatsome' == $template_name && version_compare( '3.6.0', $wp_theme->Version, '<' ) ){
|
140 |
+
$problematic_theme[] = 'flatsome';
|
141 |
+
}
|
142 |
+
|
143 |
+
$is_qTranslateX_and_yit_core_1_0_0 = class_exists( 'QTX_Translator' ) && defined('YIT_CORE_VERSION') && '1.0.0' == YIT_CORE_VERSION;
|
144 |
+
$is_problematic_theme = in_array( $template_name, $problematic_theme );
|
145 |
+
|
146 |
+
if( $is_qTranslateX_and_yit_core_1_0_0 || $is_problematic_theme || class_exists( 'SiteOrigin_Panels' ) ){
|
147 |
+
add_filter( 'yith_wcan_skip_layered_nav_query', '__return_true' );
|
148 |
+
}
|
149 |
+
|
150 |
+
$query_filtered_posts = $this->layered_nav_query();
|
151 |
+
|
152 |
+
foreach ( $posts as $post ) {
|
153 |
+
|
154 |
+
if ( in_array( $post->ID, $query_filtered_posts ) ) {
|
155 |
+
$filtered_posts[] = $post;
|
156 |
+
$queried_post_ids[] = $post->ID;
|
157 |
+
}
|
158 |
+
}
|
159 |
+
|
160 |
+
$query->posts = $filtered_posts;
|
161 |
+
$query->post_count = count( $filtered_posts );
|
162 |
+
|
163 |
+
// Get main query
|
164 |
+
$current_wp_query = $this->select_query_object( $query );
|
165 |
+
|
166 |
+
if( is_array( $current_wp_query ) ){
|
167 |
+
// Get WP Query for current page (without 'paged')
|
168 |
+
unset( $current_wp_query['paged'] );
|
169 |
+
}
|
170 |
+
|
171 |
+
else {
|
172 |
+
$current_wp_query = array();
|
173 |
+
}
|
174 |
+
|
175 |
+
// Ensure filters are set
|
176 |
+
$unfiltered_args = array_merge(
|
177 |
+
$current_wp_query,
|
178 |
+
array(
|
179 |
+
'post_type' => 'product',
|
180 |
+
'numberposts' => - 1,
|
181 |
+
'post_status' => 'publish',
|
182 |
+
'meta_query' => is_object( $current_wp_query ) ? $current_wp_query->meta_query : array(),
|
183 |
+
'fields' => 'ids',
|
184 |
+
'no_found_rows' => true,
|
185 |
+
'update_post_meta_cache' => false,
|
186 |
+
'update_post_term_cache' => false,
|
187 |
+
'pagename' => '',
|
188 |
+
'wc_query' => 'get_products_in_view', //Only for WC <= 2.6.x
|
189 |
+
'suppress_filters' => true,
|
190 |
+
)
|
191 |
+
);
|
192 |
+
|
193 |
+
$hide_out_of_stock_items = apply_filters( 'yith_wcan_hide_out_of_stock_items', 'yes' == get_option( 'woocommerce_hide_out_of_stock_items' ) ? true : false );
|
194 |
+
|
195 |
+
if( $hide_out_of_stock_items ){
|
196 |
+
$unfiltered_args['meta_query'][] = array(
|
197 |
+
'key' => '_stock_status',
|
198 |
+
'value' => 'instock',
|
199 |
+
'compare' => 'AND'
|
200 |
+
);
|
201 |
+
}
|
202 |
+
|
203 |
+
$unfiltered_args = apply_filters( 'yith_wcan_unfiltered_args', $unfiltered_args );
|
204 |
+
$this->unfiltered_product_ids = apply_filters( 'yith_wcan_unfiltered_product_ids', get_posts( $unfiltered_args ), $query, $current_wp_query );
|
205 |
+
$this->filtered_product_ids = $queried_post_ids;
|
206 |
+
|
207 |
+
// Also store filtered posts ids...
|
208 |
+
if ( sizeof( $queried_post_ids ) > 0 ) {
|
209 |
+
$this->filtered_product_ids = array_intersect( $this->unfiltered_product_ids, $queried_post_ids );
|
210 |
+
} else {
|
211 |
+
$this->filtered_product_ids = $this->unfiltered_product_ids;
|
212 |
+
}
|
213 |
+
|
214 |
+
if ( sizeof( $this->layered_nav_post__in ) > 0 ) {
|
215 |
+
$this->layered_nav_product_ids = array_intersect( $this->unfiltered_product_ids, $this->layered_nav_post__in );
|
216 |
+
} else {
|
217 |
+
$this->layered_nav_product_ids = $this->unfiltered_product_ids;
|
218 |
+
}
|
219 |
+
}
|
220 |
}
|
221 |
return $posts;
|
222 |
}
|
includes/functions.yith-wcan.php
CHANGED
@@ -493,6 +493,10 @@ if ( ! function_exists( 'yit_get_filter_args' ) ) {
|
|
493 |
$filter_value['product_tag'] = urlencode( $_GET['product_tag'] );
|
494 |
}
|
495 |
|
|
|
|
|
|
|
|
|
496 |
if (isset($_GET['product_cat'])) {
|
497 |
$filter_value['product_cat'] = urlencode( $_GET['product_cat'] );
|
498 |
}
|
493 |
$filter_value['product_tag'] = urlencode( $_GET['product_tag'] );
|
494 |
}
|
495 |
|
496 |
+
elseif( is_product_tag() && $queried_object ){
|
497 |
+
$filter_value['product_tag'] = $queried_object->slug;
|
498 |
+
}
|
499 |
+
|
500 |
if (isset($_GET['product_cat'])) {
|
501 |
$filter_value['product_cat'] = urlencode( $_GET['product_cat'] );
|
502 |
}
|
init.php
CHANGED
@@ -3,7 +3,7 @@
|
|
3 |
* Plugin Name: YITH WooCommerce Ajax Product Filter
|
4 |
* Plugin URI: https://wordpress.org/plugins/yith-woocommerce-ajax-navigation/
|
5 |
* Description:<code><strong>YITH WooCommerce AJAX Product Filter</strong></code> allows your users to find the product they are looking for as quickly as possible. Thanks to the plugin you will be able to set up one or more search filters for your WooCommerce products, improve the user experience and give the impression of being in a big and reliable store. <a href="https://yithemes.com/" target="_blank">Get more plugins for your e-commerce shop on <strong>YITH</strong></a>
|
6 |
-
* Version: 3.8.
|
7 |
* Author: YITH
|
8 |
* Author URI: https://yithemes.com/
|
9 |
* Text Domain: yith-woocommerce-ajax-navigation
|
@@ -67,7 +67,7 @@ load_plugin_textdomain( 'yith-woocommerce-ajax-navigation', false, dirname( plug
|
|
67 |
! defined( 'YITH_WCAN' ) && define( 'YITH_WCAN', true );
|
68 |
! defined( 'YITH_WCAN_URL' ) && define( 'YITH_WCAN_URL', plugin_dir_url( __FILE__ ) );
|
69 |
! defined( 'YITH_WCAN_DIR' ) && define( 'YITH_WCAN_DIR', plugin_dir_path( __FILE__ ) );
|
70 |
-
! defined( 'YITH_WCAN_VERSION' ) && define( 'YITH_WCAN_VERSION', '3.8.
|
71 |
! defined( 'YITH_WCAN_FREE_INIT') && define( 'YITH_WCAN_FREE_INIT', plugin_basename( __FILE__ ) );
|
72 |
! defined( 'YITH_WCAN_FILE' ) && define( 'YITH_WCAN_FILE', __FILE__ );
|
73 |
|
3 |
* Plugin Name: YITH WooCommerce Ajax Product Filter
|
4 |
* Plugin URI: https://wordpress.org/plugins/yith-woocommerce-ajax-navigation/
|
5 |
* Description:<code><strong>YITH WooCommerce AJAX Product Filter</strong></code> allows your users to find the product they are looking for as quickly as possible. Thanks to the plugin you will be able to set up one or more search filters for your WooCommerce products, improve the user experience and give the impression of being in a big and reliable store. <a href="https://yithemes.com/" target="_blank">Get more plugins for your e-commerce shop on <strong>YITH</strong></a>
|
6 |
+
* Version: 3.8.3
|
7 |
* Author: YITH
|
8 |
* Author URI: https://yithemes.com/
|
9 |
* Text Domain: yith-woocommerce-ajax-navigation
|
67 |
! defined( 'YITH_WCAN' ) && define( 'YITH_WCAN', true );
|
68 |
! defined( 'YITH_WCAN_URL' ) && define( 'YITH_WCAN_URL', plugin_dir_url( __FILE__ ) );
|
69 |
! defined( 'YITH_WCAN_DIR' ) && define( 'YITH_WCAN_DIR', plugin_dir_path( __FILE__ ) );
|
70 |
+
! defined( 'YITH_WCAN_VERSION' ) && define( 'YITH_WCAN_VERSION', '3.8.3' );
|
71 |
! defined( 'YITH_WCAN_FREE_INIT') && define( 'YITH_WCAN_FREE_INIT', plugin_basename( __FILE__ ) );
|
72 |
! defined( 'YITH_WCAN_FILE' ) && define( 'YITH_WCAN_FILE', __FILE__ );
|
73 |
|
plugin-fw/init.php
CHANGED
@@ -1,13 +1,13 @@
|
|
1 |
<?php
|
2 |
/**
|
3 |
* Framework Name: YIT Plugin Framework
|
4 |
-
* Version: 3.4.
|
5 |
* Author: YITHEMES
|
6 |
* Text Domain: yith-plugin-fw
|
7 |
* Domain Path: /languages/
|
8 |
*
|
9 |
* @author Your Inspiration Themes
|
10 |
-
* @version 3.4.
|
11 |
*/
|
12 |
/**
|
13 |
* This file belongs to the YIT Plugin Framework.
|
1 |
<?php
|
2 |
/**
|
3 |
* Framework Name: YIT Plugin Framework
|
4 |
+
* Version: 3.4.5
|
5 |
* Author: YITHEMES
|
6 |
* Text Domain: yith-plugin-fw
|
7 |
* Domain Path: /languages/
|
8 |
*
|
9 |
* @author Your Inspiration Themes
|
10 |
+
* @version 3.4.5
|
11 |
*/
|
12 |
/**
|
13 |
* This file belongs to the YIT Plugin Framework.
|
plugin-fw/languages/yith-plugin-fw-es_ES.mo
CHANGED
Binary file
|
plugin-fw/languages/yith-plugin-fw-es_ES.po
CHANGED
@@ -5,14 +5,14 @@ msgstr ""
|
|
5 |
"Project-Id-Version: YITH Plugin Starter 1.0.0 Plugin FW\n"
|
6 |
"Report-Msgid-Bugs-To: Your Inspiration Themes <plugins@yithemes.com>\n"
|
7 |
"POT-Creation-Date: 2019-02-04 16:04+0100\n"
|
8 |
-
"PO-Revision-Date: 2019-02
|
9 |
"Last-Translator: \n"
|
10 |
"Language-Team: Your Inspiration Themes <info@yithemes.com>\n"
|
11 |
"Language: es_ES\n"
|
12 |
"MIME-Version: 1.0\n"
|
13 |
"Content-Type: text/plain; charset=UTF-8\n"
|
14 |
"Content-Transfer-Encoding: 8bit\n"
|
15 |
-
"X-Generator: Poedit
|
16 |
"X-Poedit-KeywordsList: __;_e;_x:1,2c;_ex:1,2c;_n:1,2;_nx:1,2,4c;_n_noop:1,2;"
|
17 |
"_nx_noop:1,2,3c;esc_attr__;esc_html__;esc_attr_e;esc_html_e;esc_attr_x:1,2c;"
|
18 |
"esc_html_x:1,2c\n"
|
@@ -921,7 +921,7 @@ msgstr "Barra lateral derecha"
|
|
921 |
#: templates/fields/upload.php:18 templates/metaboxes/types/icon-list.php:70
|
922 |
#: templates/panel/woocommerce/woocommerce-upload.php:40
|
923 |
msgid "Upload"
|
924 |
-
msgstr "
|
925 |
|
926 |
#: templates/fields/upload.php:19
|
927 |
msgid "Reset"
|
5 |
"Project-Id-Version: YITH Plugin Starter 1.0.0 Plugin FW\n"
|
6 |
"Report-Msgid-Bugs-To: Your Inspiration Themes <plugins@yithemes.com>\n"
|
7 |
"POT-Creation-Date: 2019-02-04 16:04+0100\n"
|
8 |
+
"PO-Revision-Date: 2019-12-02 10:38+0000\n"
|
9 |
"Last-Translator: \n"
|
10 |
"Language-Team: Your Inspiration Themes <info@yithemes.com>\n"
|
11 |
"Language: es_ES\n"
|
12 |
"MIME-Version: 1.0\n"
|
13 |
"Content-Type: text/plain; charset=UTF-8\n"
|
14 |
"Content-Transfer-Encoding: 8bit\n"
|
15 |
+
"X-Generator: Poedit 1.8.12\n"
|
16 |
"X-Poedit-KeywordsList: __;_e;_x:1,2c;_ex:1,2c;_n:1,2;_nx:1,2,4c;_n_noop:1,2;"
|
17 |
"_nx_noop:1,2,3c;esc_attr__;esc_html__;esc_attr_e;esc_html_e;esc_attr_x:1,2c;"
|
18 |
"esc_html_x:1,2c\n"
|
921 |
#: templates/fields/upload.php:18 templates/metaboxes/types/icon-list.php:70
|
922 |
#: templates/panel/woocommerce/woocommerce-upload.php:40
|
923 |
msgid "Upload"
|
924 |
+
msgstr "Subir"
|
925 |
|
926 |
#: templates/fields/upload.php:19
|
927 |
msgid "Reset"
|
plugin-fw/lib/yit-plugin-panel-wc.php
CHANGED
@@ -549,6 +549,12 @@ if ( !class_exists( 'YIT_Plugin_Panel_WooCommerce' ) ) {
|
|
549 |
|
550 |
if ( $value && isset( $option[ 'elements' ] ) && !empty( $option[ 'elements' ] ) ) {
|
551 |
|
|
|
|
|
|
|
|
|
|
|
|
|
552 |
foreach ( $value as $index => $single_toggle ) {
|
553 |
|
554 |
if ( $value && isset( $option[ 'onoff_field' ] ) && !empty( $option[ 'onoff_field' ] ) ) {
|
@@ -561,7 +567,8 @@ if ( !class_exists( 'YIT_Plugin_Panel_WooCommerce' ) ) {
|
|
561 |
}
|
562 |
|
563 |
foreach ( $option[ 'elements' ] as $element ) {
|
564 |
-
|
|
|
565 |
}
|
566 |
}
|
567 |
}
|
549 |
|
550 |
if ( $value && isset( $option[ 'elements' ] ) && !empty( $option[ 'elements' ] ) ) {
|
551 |
|
552 |
+
$value = maybe_unserialize( $value );
|
553 |
+
|
554 |
+
if( isset( $value['box_id'] ) ){
|
555 |
+
unset( $value['box_id'] );
|
556 |
+
}
|
557 |
+
|
558 |
foreach ( $value as $index => $single_toggle ) {
|
559 |
|
560 |
if ( $value && isset( $option[ 'onoff_field' ] ) && !empty( $option[ 'onoff_field' ] ) ) {
|
567 |
}
|
568 |
|
569 |
foreach ( $option[ 'elements' ] as $element ) {
|
570 |
+
$element_value = isset( $value[ $index ][ $element[ 'id' ] ] ) ? $value[ $index ][ $element[ 'id' ] ] : false;
|
571 |
+
$value[ $index ][ $element[ 'id' ] ] = self::sanitize_option( $element_value, $element, $element_value );
|
572 |
}
|
573 |
}
|
574 |
}
|
plugin-fw/lib/yit-plugin-panel.php
CHANGED
@@ -496,7 +496,7 @@ if ( !class_exists( 'YIT_Plugin_Panel' ) ) {
|
|
496 |
$url = admin_url( "admin.php{$url}" );
|
497 |
}
|
498 |
|
499 |
-
return $url;
|
500 |
}
|
501 |
|
502 |
/**
|
496 |
$url = admin_url( "admin.php{$url}" );
|
497 |
}
|
498 |
|
499 |
+
return apply_filters( 'yith_plugin_fw_panel_url', $url, $page, $tab, $sub_tab, $parent_page );
|
500 |
}
|
501 |
|
502 |
/**
|
plugin-fw/yit-plugin.php
CHANGED
@@ -158,7 +158,8 @@ if( ! function_exists( 'yit_plugin_fw_row_meta' ) ){
|
|
158 |
}
|
159 |
|
160 |
if( ! empty( $url ) && ! empty( $label ) ){
|
161 |
-
|
|
|
162 |
}
|
163 |
}
|
164 |
|
158 |
}
|
159 |
|
160 |
if( ! empty( $url ) && ! empty( $label ) ){
|
161 |
+
$url = trailingslashit( $url );
|
162 |
+
$plugin_meta[] = sprintf( '<a href="%s" target="_blank"><span class="%s"></span>%s</a>', $url, $icon, $label );
|
163 |
}
|
164 |
}
|
165 |
|