Advanced AJAX Product Filters - Version 1.4.1.7

Version Description

  • Fix - Avada 6.2.0 incompatibility. Products not editable
Download this release

Release Info

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

Code changes from version 1.4.1.6 to 1.4.1.7

includes/new_widget.php CHANGED
@@ -105,23 +105,22 @@ class BeRocket_new_AAPF_Widget extends WP_Widget
105
  <p>
106
  <label for="<?php echo $this->get_field_id('group_id'); ?>"><?php _e('Group', 'BeRocket_AJAX_domain'); ?></label><br>
107
  <?php
108
- $query = new WP_Query(array('post_type' => 'br_filters_group', 'nopaging' => true));
 
109
  $edit_link_current = '';
110
- if ( $query->have_posts() ) {
111
  echo '<select class="berocket_new_widget_selectbox group" id="'.$this->get_field_id('group_id').'" name="'.$this->get_field_name('group_id').'">';
112
  echo '<option>'.__('--Please select group--', 'BeRocket_AJAX_domain').'</option>';
113
- while ( $query->have_posts() ) {
114
  if( empty($instance['group_id']) ) {
115
- $instance['group_id'] = get_the_id();
116
  }
117
- $query->the_post();
118
- echo '<option data-edit="'.get_edit_post_link().'" value="' . get_the_id() . '"'.(get_the_id() == $instance['group_id'] ? ' selected' : '').'>' . substr(get_the_title(), 0, 50) . (strlen(get_the_title()) > 50 ? '...' : '') . ' (ID:' . get_the_id() . ')</option>';
119
- if( get_the_id() == $instance['group_id'] ) {
120
- $edit_link_current = get_edit_post_link();
121
  }
122
  }
123
  echo '</select>';
124
- wp_reset_postdata();
125
  }
126
  ?>
127
  <a target="_blank" class="berocket_aapf_edit_post_link" href="<?php echo $edit_link_current; ?>"<?php if( empty($edit_link_current) ) echo ' style="display: none;"'; ?>><?php _e('Edit', 'BeRocket_AJAX_domain'); ?></a>
@@ -259,23 +258,22 @@ class BeRocket_new_AAPF_Widget_single extends WP_Widget
259
  <p class="berocketwizard_aapf_single_widget_filter_id">
260
  <label for="<?php echo $this->get_field_id('filter_id'); ?>"><?php _e('Filter', 'BeRocket_AJAX_domain'); ?></label><br>
261
  <?php
262
- $query = new WP_Query(array('post_type' => 'br_product_filter', 'nopaging' => true));
 
263
  $edit_link_current = '';
264
- if ( $query->have_posts() ) {
265
  echo '<select class="berocket_new_widget_selectbox single" id="'.$this->get_field_id('filter_id').'" name="'.$this->get_field_name('filter_id').'">';
266
  echo '<option>'.__('--Please select filter--', 'BeRocket_AJAX_domain').'</option>';
267
- while ( $query->have_posts() ) {
268
  if( empty($instance['filter_id']) ) {
269
- $instance['filter_id'] = get_the_id();
270
  }
271
- $query->the_post();
272
- echo '<option data-edit="'.get_edit_post_link().'" value="' . get_the_id() . '"'.(get_the_id() == $instance['filter_id'] ? ' selected' : '').'>' . substr(get_the_title(), 0, 50) . (strlen(get_the_title()) > 50 ? '...' : '') . ' (ID:' . get_the_id() . ')</option>';
273
- if( get_the_id() == $instance['filter_id'] ) {
274
- $edit_link_current = get_edit_post_link();
275
  }
276
  }
277
  echo '</select>';
278
- wp_reset_postdata();
279
  }
280
  ?>
281
  <a target="_blank" class="berocket_aapf_edit_post_link" href="<?php echo $edit_link_current; ?>"<?php if( empty($edit_link_current) ) echo ' style="display: none;"'; ?>><?php _e('Edit', 'BeRocket_AJAX_domain'); ?></a>
105
  <p>
106
  <label for="<?php echo $this->get_field_id('group_id'); ?>"><?php _e('Group', 'BeRocket_AJAX_domain'); ?></label><br>
107
  <?php
108
+ $query = new WP_Query(array('post_type' => 'br_filters_group', 'nopaging' => true, 'fields' => 'ids'));
109
+ $posts = $query->get_posts();
110
  $edit_link_current = '';
111
+ if ( !empty($posts) ) {
112
  echo '<select class="berocket_new_widget_selectbox group" id="'.$this->get_field_id('group_id').'" name="'.$this->get_field_name('group_id').'">';
113
  echo '<option>'.__('--Please select group--', 'BeRocket_AJAX_domain').'</option>';
114
+ foreach($posts as $post_id) {
115
  if( empty($instance['group_id']) ) {
116
+ $instance['group_id'] = $post_id;
117
  }
118
+ echo '<option data-edit="'.get_edit_post_link($post_id).'" value="' . $post_id . '"'.($post_id == $instance['group_id'] ? ' selected' : '').'>' . substr(get_the_title($post_id), 0, 50) . (strlen(get_the_title($post_id)) > 50 ? '...' : '') . ' (ID:' . $post_id . ')</option>';
119
+ if( $post_id == $instance['group_id'] ) {
120
+ $edit_link_current = get_edit_post_link($post_id);
 
121
  }
122
  }
123
  echo '</select>';
 
124
  }
125
  ?>
126
  <a target="_blank" class="berocket_aapf_edit_post_link" href="<?php echo $edit_link_current; ?>"<?php if( empty($edit_link_current) ) echo ' style="display: none;"'; ?>><?php _e('Edit', 'BeRocket_AJAX_domain'); ?></a>
258
  <p class="berocketwizard_aapf_single_widget_filter_id">
259
  <label for="<?php echo $this->get_field_id('filter_id'); ?>"><?php _e('Filter', 'BeRocket_AJAX_domain'); ?></label><br>
260
  <?php
261
+ $query = new WP_Query(array('post_type' => 'br_product_filter', 'nopaging' => true, 'fields' => 'ids'));
262
+ $posts = $query->get_posts();
263
  $edit_link_current = '';
264
+ if ( !empty($posts) ) {
265
  echo '<select class="berocket_new_widget_selectbox single" id="'.$this->get_field_id('filter_id').'" name="'.$this->get_field_name('filter_id').'">';
266
  echo '<option>'.__('--Please select filter--', 'BeRocket_AJAX_domain').'</option>';
267
+ foreach($posts as $post_id) {
268
  if( empty($instance['filter_id']) ) {
269
+ $instance['filter_id'] = $post_id;
270
  }
271
+ echo '<option data-edit="'.get_edit_post_link($post_id).'" value="' . $post_id . '"'.($post_id == $instance['filter_id'] ? ' selected' : '').'>' . substr(get_the_title($post_id), 0, 50) . (strlen(get_the_title($post_id)) > 50 ? '...' : '') . ' (ID:' . $post_id . ')</option>';
272
+ if( $post_id == $instance['filter_id'] ) {
273
+ $edit_link_current = get_edit_post_link($post_id);
 
274
  }
275
  }
276
  echo '</select>';
 
277
  }
278
  ?>
279
  <a target="_blank" class="berocket_aapf_edit_post_link" href="<?php echo $edit_link_current; ?>"<?php if( empty($edit_link_current) ) echo ' style="display: none;"'; ?>><?php _e('Edit', 'BeRocket_AJAX_domain'); ?></a>
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.6
9
  License: GPLv2 or later
10
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
11
 
@@ -184,6 +184,9 @@ You can try this plugin's admin side [here](https://berocket.com/product/woocomm
184
 
185
  == Changelog ==
186
 
 
 
 
187
  = 1.4.1.6 =
188
  * Fix - PHP Warning/Notice on some site
189
  * Fix - Sorting in WooCommerce shortcodes works incorrect
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
 
185
  == Changelog ==
186
 
187
+ = 1.4.1.7 =
188
+ * Fix - Avada 6.2.0 incompatibility. Products not editable
189
+
190
  = 1.4.1.6 =
191
  * Fix - PHP Warning/Notice on some site
192
  * Fix - Sorting in WooCommerce shortcodes works incorrect
templates/filter_post.php CHANGED
@@ -542,7 +542,7 @@ $custom_taxonomies = array_combine($custom_taxonomies, $custom_taxonomies);
542
  <label class="br_admin_full_size" for="<?php echo 'use_max_price'; ?>"><?php _e('Use max price', 'BeRocket_AJAX_domain') ?></label>
543
  </div>
544
  <div <?php if ( !$instance['use_max_price'] ) echo 'style="display:none"'; ?>>
545
- <input type=number min=1 id="<?php echo 'max_price'; ?>" name="<?php echo $post_name.'[max_price]'; ?>" value="<?php echo ( ( $instance['max_price'] ) ? $instance['max_price'] : '0' ); ?>" class="br_admin_full_size berocket_aapf_widget_admin_input_price">
546
  </div>
547
  </div>
548
  <div class="br_clearfix"></div>
542
  <label class="br_admin_full_size" for="<?php echo 'use_max_price'; ?>"><?php _e('Use max price', 'BeRocket_AJAX_domain') ?></label>
543
  </div>
544
  <div <?php if ( !$instance['use_max_price'] ) echo 'style="display:none"'; ?>>
545
+ <input type=number min=0 id="<?php echo 'max_price'; ?>" name="<?php echo $post_name.'[max_price]'; ?>" value="<?php echo ( ( $instance['max_price'] ) ? $instance['max_price'] : '0' ); ?>" class="br_admin_full_size berocket_aapf_widget_admin_input_price">
546
  </div>
547
  </div>
548
  <div class="br_clearfix"></div>
woocommerce-filters.php CHANGED
@@ -3,7 +3,7 @@
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.6
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
@@ -11,6 +11,6 @@
11
  * Domain Path: /languages/
12
  * WC tested up to: 3.9.1
13
  */
14
- define( "BeRocket_AJAX_filters_version", '1.4.1.6' );
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.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
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');