Advanced AJAX Product Filters - Version 1.4.1.8

Version Description

  • Enhancement - Remove some queries
  • Fix - Hide out of stock variations with price slider do not work
  • Fix - Hide out of stock variations work incorrect on some sites
Download this release

Release Info

Developer RazyRx
Plugin Icon wp plugin Advanced AJAX Product Filters
Version 1.4.1.8
Comparing to
See all releases

Code changes from version 1.4.1.7 to 1.4.1.8

addons/additional_tables/add_table.php CHANGED
@@ -72,7 +72,7 @@ class BeRocket_aapf_variations_tables {
72
  );
73
  $query['subquery']['join_close_1'] = ') as max_filtered_post ON max_filtered_post.ID = filtered_post.ID';
74
  $query['subquery']['select'] = 'SELECT filtered_post.*, max_filtered_post.max_meta_count, IF(max_filtered_post.max_meta_count != filtered_post.meta_count OR stock_table.out_of_stock_init = 1, 1, 0) as out_of_stock';
75
- if ( ! empty($_POST['price_ranges']) || ! empty($_POST['price']) ) {
76
  $query_custom['join'] = "JOIN {$wpdb->prefix}wc_product_meta_lookup as wc_product_meta_lookup ON wc_product_meta_lookup.product_id = {$wpdb->prefix}braapf_product_stock_status_parent.post_id";
77
  $query_custom['where_open'] = 'WHERE';
78
  if ( ! empty($_POST['price']) ) {
@@ -97,7 +97,7 @@ class BeRocket_aapf_variations_tables {
97
  }
98
  $query_custom['where_1'] = implode(' AND ', $price_ranges);
99
  }
100
- }
101
  $query_custom['group'] = 'GROUP BY id';
102
  $query['subquery']['subquery_3'] = $query_custom;
103
  return $query;
72
  );
73
  $query['subquery']['join_close_1'] = ') as max_filtered_post ON max_filtered_post.ID = filtered_post.ID';
74
  $query['subquery']['select'] = 'SELECT filtered_post.*, max_filtered_post.max_meta_count, IF(max_filtered_post.max_meta_count != filtered_post.meta_count OR stock_table.out_of_stock_init = 1, 1, 0) as out_of_stock';
75
+ /*if ( ! empty($_POST['price_ranges']) || ! empty($_POST['price']) ) {
76
  $query_custom['join'] = "JOIN {$wpdb->prefix}wc_product_meta_lookup as wc_product_meta_lookup ON wc_product_meta_lookup.product_id = {$wpdb->prefix}braapf_product_stock_status_parent.post_id";
77
  $query_custom['where_open'] = 'WHERE';
78
  if ( ! empty($_POST['price']) ) {
97
  }
98
  $query_custom['where_1'] = implode(' AND ', $price_ranges);
99
  }
100
+ }*/
101
  $query_custom['group'] = 'GROUP BY id';
102
  $query['subquery']['subquery_3'] = $query_custom;
103
  return $query;
includes/addons/woocommerce-variation.php CHANGED
@@ -263,14 +263,7 @@ class BeRocket_AAPF_compat_woocommerce_variation {
263
  $limit_post__not_in_where_array = array();
264
  if( is_array($limit_post__not_in) && count($limit_post__not_in) ) {
265
  $limit_post__term_id_without_product = array();
266
- foreach($limit_post__not_in as $terms_id => $limit_post) {
267
- if( in_array($term_data->taxonomy, array('_sale', '_stock_status')) ) {
268
- $wp_terms_id = $terms_id;
269
- } else {
270
- $wp_term = get_term($terms_id);
271
- if( empty($wp_term) || is_wp_error($wp_term) ) continue;
272
- $wp_terms_id = $wp_term->term_taxonomy_id;
273
- }
274
  if( is_array($limit_post) && count($limit_post) ) {
275
  $limit_post__not_in_where_array[$wp_terms_id] = "({$wpdb->posts}.ID NOT IN (\"" . implode('","', $limit_post) . "\") AND term_relationships.term_taxonomy_id = {$wp_terms_id})";
276
  } else {
263
  $limit_post__not_in_where_array = array();
264
  if( is_array($limit_post__not_in) && count($limit_post__not_in) ) {
265
  $limit_post__term_id_without_product = array();
266
+ foreach($limit_post__not_in as $wp_terms_id => $limit_post) {
 
 
 
 
 
 
 
267
  if( is_array($limit_post) && count($limit_post) ) {
268
  $limit_post__not_in_where_array[$wp_terms_id] = "({$wpdb->posts}.ID NOT IN (\"" . implode('","', $limit_post) . "\") AND term_relationships.term_taxonomy_id = {$wp_terms_id})";
269
  } else {
includes/filters/display_widget.php CHANGED
@@ -573,7 +573,8 @@ class BeRocket_AAPF_Widget extends WP_Widget {
573
  } elseif( $type == 'select' ) {
574
  $set_query_var_title['select_multiple'] = ! empty($select_multiple);
575
  }
576
- set_query_var( 'berocket_query_var_title', apply_filters('berocket_query_var_title_before_widget', $set_query_var_title, $type, $instance, $args, $terms));
 
577
  br_get_template_part( apply_filters('berocket_widget_load_template_name', $type, $instance, (empty($terms) ? '' : $terms)) );
578
 
579
  do_action('berocket_aapf_widget_before_end');
573
  } elseif( $type == 'select' ) {
574
  $set_query_var_title['select_multiple'] = ! empty($select_multiple);
575
  }
576
+ $set_query_var_title = apply_filters('berocket_query_var_title_before_widget', $set_query_var_title, $type, $instance, $args, $terms);
577
+ set_query_var( 'berocket_query_var_title', $set_query_var_title);
578
  br_get_template_part( apply_filters('berocket_widget_load_template_name', $type, $instance, (empty($terms) ? '' : $terms)) );
579
 
580
  do_action('berocket_aapf_widget_before_end');
includes/widget_functions.php CHANGED
@@ -44,7 +44,11 @@ class BeRocket_AAPF_Widget_functions {
44
  'after' => (isset($text_after_price) ? $text_after_price : ''),
45
  )
46
  );
47
- $price_range = BeRocket_AAPF_Widget_functions::get_price_range( ( isset($cat_value_limit) ? $cat_value_limit : null ) );
 
 
 
 
48
  if ( ! empty($price_values) ) {
49
  $all_terms_name = $price_range;
50
  $all_terms_slug = $price_range;
44
  'after' => (isset($text_after_price) ? $text_after_price : ''),
45
  )
46
  );
47
+ if ( ! empty($price_values) ) {
48
+ $price_range = explode( ",", $price_values );
49
+ } else {
50
+ $price_range = BeRocket_AAPF_Widget_functions::get_price_range( ( isset($cat_value_limit) ? $cat_value_limit : null ) );
51
+ }
52
  if ( ! empty($price_values) ) {
53
  $all_terms_name = $price_range;
54
  $all_terms_slug = $price_range;
main.php CHANGED
@@ -345,13 +345,6 @@ class BeRocket_AAPF extends BeRocket_Framework {
345
  return $notices;
346
  }
347
  public function init () {
348
- /*$terms = berocket_aapf_get_terms( array(
349
- 'taxonomy' => 'product_cat',
350
- 'hide_empty' => false,
351
- 'order' => 'DESC',
352
- 'suppress_filter' => (function_exists('wpm_get_language') ? 0 : 1)
353
- ) );
354
- echo '<pre>', print_r($terms, true), '</pre>';die;*/
355
  parent::init();
356
  $option = $this->get_option();
357
  if( ! empty($option['use_tax_for_price']) ) {
345
  return $notices;
346
  }
347
  public function init () {
 
 
 
 
 
 
 
348
  parent::init();
349
  $option = $this->get_option();
350
  if( ! empty($option['use_tax_for_price']) ) {
readme.txt CHANGED
@@ -5,7 +5,7 @@ Donate link: https://berocket.com/product/woocommerce-ajax-products-filter?utm_s
5
  Tags: filters, product filters, ajax product filters, ajax filter, ajax filter widget, color filter, size filter, product onsale filter, product preview, product category filter, product reset filter, product sort by filter, stock filter, product tag filter, price range filter, price box filter, advanced product filters, woocommerce filters, woocommerce product filters, woocommerce products filter, woocommerce ajax product filters, widget, plugin, woocommerce item filters, filters plugin, ajax filters plugin, filter woocommerce products, filter woocommerce products plugin, wc filters, wc filters products, wc products filters, wc ajax products filters, wc product filters, wc advanced product filters, woocommerce layered nav, woocommerce layered navigation, ajax filtered nav, ajax filtered navigation, price filter, ajax price filter, woocommerce product sorting, sidebar filter, sidebar ajax filter, taxonomy filter, category filter, attribute filter, attributes filter, woocommerce product sort, ajax products filter plugin for woocommerce, rocket, berocket, berocket woocommerce ajax products filter
6
  Requires at least: 4.0
7
  Tested up to: 5.3.2
8
- Stable tag: 1.4.1.7
9
  License: GPLv2 or later
10
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
11
 
@@ -184,6 +184,11 @@ You can try this plugin's admin side [here](https://berocket.com/product/woocomm
184
 
185
  == Changelog ==
186
 
 
 
 
 
 
187
  = 1.4.1.7 =
188
  * Fix - Avada 6.2.0 incompatibility. Products not editable
189
 
5
  Tags: filters, product filters, ajax product filters, ajax filter, ajax filter widget, color filter, size filter, product onsale filter, product preview, product category filter, product reset filter, product sort by filter, stock filter, product tag filter, price range filter, price box filter, advanced product filters, woocommerce filters, woocommerce product filters, woocommerce products filter, woocommerce ajax product filters, widget, plugin, woocommerce item filters, filters plugin, ajax filters plugin, filter woocommerce products, filter woocommerce products plugin, wc filters, wc filters products, wc products filters, wc ajax products filters, wc product filters, wc advanced product filters, woocommerce layered nav, woocommerce layered navigation, ajax filtered nav, ajax filtered navigation, price filter, ajax price filter, woocommerce product sorting, sidebar filter, sidebar ajax filter, taxonomy filter, category filter, attribute filter, attributes filter, woocommerce product sort, ajax products filter plugin for woocommerce, rocket, berocket, berocket woocommerce ajax products filter
6
  Requires at least: 4.0
7
  Tested up to: 5.3.2
8
+ Stable tag: 1.4.1.8
9
  License: GPLv2 or later
10
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
11
 
184
 
185
  == Changelog ==
186
 
187
+ = 1.4.1.8 =
188
+ * Enhancement - Remove some queries
189
+ * Fix - Hide out of stock variations with price slider do not work
190
+ * Fix - Hide out of stock variations work incorrect on some sites
191
+
192
  = 1.4.1.7 =
193
  * Fix - Avada 6.2.0 incompatibility. Products not editable
194
 
woocommerce-filters.php CHANGED
@@ -3,14 +3,14 @@
3
  * Plugin Name: Advanced AJAX Product Filters for WooCommerce
4
  * Plugin URI: https://wordpress.org/plugins/woocommerce-ajax-filters/?utm_source=free_plugin&utm_medium=plugins&utm_campaign=ajax_filters
5
  * Description: Unlimited AJAX products filters to make your shop perfect
6
- * Version: 1.4.1.7
7
  * Author: BeRocket
8
  * Requires at least: 4.0
9
  * Author URI: https://berocket.com?utm_source=free_plugin&utm_medium=plugins&utm_campaign=ajax_filters
10
  * Text Domain: BeRocket_AJAX_domain
11
  * Domain Path: /languages/
12
- * WC tested up to: 3.9.1
13
  */
14
- define( "BeRocket_AJAX_filters_version", '1.4.1.7' );
15
  define( "BeRocket_AJAX_filters_file", __FILE__ );
16
  include_once('main.php');
3
  * Plugin Name: Advanced AJAX Product Filters for WooCommerce
4
  * Plugin URI: https://wordpress.org/plugins/woocommerce-ajax-filters/?utm_source=free_plugin&utm_medium=plugins&utm_campaign=ajax_filters
5
  * Description: Unlimited AJAX products filters to make your shop perfect
6
+ * Version: 1.4.1.8
7
  * Author: BeRocket
8
  * Requires at least: 4.0
9
  * Author URI: https://berocket.com?utm_source=free_plugin&utm_medium=plugins&utm_campaign=ajax_filters
10
  * Text Domain: BeRocket_AJAX_domain
11
  * Domain Path: /languages/
12
+ * WC tested up to: 3.9.2
13
  */
14
+ define( "BeRocket_AJAX_filters_version", '1.4.1.8' );
15
  define( "BeRocket_AJAX_filters_file", __FILE__ );
16
  include_once('main.php');