Version Description
- Fix - Compatibility with Product Table plugin
- Fix - URL decoding option with Product Table plugin
- Fix - Link generation for price filters
Download this release
Release Info
Developer | RazyRx |
Plugin | Advanced AJAX Product Filters |
Version | 1.6.1.1 |
Comparing to | |
See all releases |
Code changes from version 1.6.1 to 1.6.1.1
- includes/compatibility/product-table.php +11 -1
- includes/custom_post.php +1 -0
- includes/url-parse.php +5 -4
- includes/url-parse/price.php +16 -1
- main.php +1 -1
- readme.txt +6 -1
- woocommerce-filters.php +2 -2
includes/compatibility/product-table.php
CHANGED
@@ -2,10 +2,18 @@
|
|
2 |
class BeRocket_AAPF_compat_product_table {
|
3 |
function __construct() {
|
4 |
add_action( 'plugins_loaded', array( __CLASS__, 'plugins_loaded' ), 1 );
|
|
|
|
|
|
|
5 |
$filter_nn_name = apply_filters('berocket_aapf_filter_variable_name_nn', 'filters');
|
6 |
if(defined('DOING_AJAX') && DOING_AJAX && !empty($_POST['action']) && $_POST['action'] == 'wcpt_load_products') {
|
7 |
if( ! empty($_POST[$filter_nn_name]) ) {
|
8 |
-
$
|
|
|
|
|
|
|
|
|
|
|
9 |
}
|
10 |
$table_id = filter_input( INPUT_POST, 'table_id', FILTER_SANITIZE_STRING );
|
11 |
$table_transient = get_transient( $table_id );
|
@@ -46,6 +54,8 @@ class BeRocket_AAPF_compat_product_table {
|
|
46 |
return $query_vars;
|
47 |
}
|
48 |
$query_vars = apply_filters('bapf_uparse_apply_filters_to_query_vars_save', $query_vars);
|
|
|
|
|
49 |
return $query_vars;
|
50 |
}
|
51 |
public static function aapf_localize_widget_script($localize) {
|
2 |
class BeRocket_AAPF_compat_product_table {
|
3 |
function __construct() {
|
4 |
add_action( 'plugins_loaded', array( __CLASS__, 'plugins_loaded' ), 1 );
|
5 |
+
add_action('bapf_class_ready', array($this, 'init'), 10, 1);
|
6 |
+
}
|
7 |
+
public function init($BeRocket_AAPF) {
|
8 |
$filter_nn_name = apply_filters('berocket_aapf_filter_variable_name_nn', 'filters');
|
9 |
if(defined('DOING_AJAX') && DOING_AJAX && !empty($_POST['action']) && $_POST['action'] == 'wcpt_load_products') {
|
10 |
if( ! empty($_POST[$filter_nn_name]) ) {
|
11 |
+
$options = $BeRocket_AAPF->get_option();
|
12 |
+
if( empty($options['seo_uri_decode']) ) {
|
13 |
+
$_GET[$filter_nn_name] = $_POST[$filter_nn_name];
|
14 |
+
} else {
|
15 |
+
$_GET[$filter_nn_name] = urldecode($_POST[$filter_nn_name]);
|
16 |
+
}
|
17 |
}
|
18 |
$table_id = filter_input( INPUT_POST, 'table_id', FILTER_SANITIZE_STRING );
|
19 |
$table_transient = get_transient( $table_id );
|
54 |
return $query_vars;
|
55 |
}
|
56 |
$query_vars = apply_filters('bapf_uparse_apply_filters_to_query_vars_save', $query_vars);
|
57 |
+
global $berocket_parse_page_obj;
|
58 |
+
$berocket_parse_page_obj->save_shortcode_query_vars($query_vars);
|
59 |
return $query_vars;
|
60 |
}
|
61 |
public static function aapf_localize_widget_script($localize) {
|
includes/custom_post.php
CHANGED
@@ -542,6 +542,7 @@ class BeRocket_AAPF_single_filter extends BeRocket_custom_post_class {
|
|
542 |
}
|
543 |
public function wc_save_product_without_check( $post_id, $post ) {
|
544 |
parent::wc_save_product_without_check( $post_id, $post );
|
|
|
545 |
$instance = $_POST[$this->post_name];
|
546 |
|
547 |
$filter_type_array = array(
|
542 |
}
|
543 |
public function wc_save_product_without_check( $post_id, $post ) {
|
544 |
parent::wc_save_product_without_check( $post_id, $post );
|
545 |
+
delete_site_transient('BeRocket_products_label_style_generate');
|
546 |
$instance = $_POST[$this->post_name];
|
547 |
|
548 |
$filter_type_array = array(
|
includes/url-parse.php
CHANGED
@@ -98,17 +98,18 @@ if( ! class_exists('BeRocket_url_parse_page') ) {
|
|
98 |
}
|
99 |
}
|
100 |
}
|
101 |
-
global $br_wc_query, $br_aapf_wc_footer_widget;
|
|
|
102 |
$br_query_vars['fields'] = 'ids';
|
103 |
$br_wc_query = $br_query_vars;
|
104 |
$br_aapf_wc_footer_widget = true;
|
105 |
add_action( 'wp_footer', array( $this, 'wp_footer_widget'), 99999 );
|
106 |
}
|
107 |
public function wp_footer_widget() {
|
108 |
-
global $
|
109 |
-
if( isset( $
|
110 |
echo '<div class="berocket_wc_shortcode_fix" style="display: none;">';
|
111 |
-
foreach ( $
|
112 |
$widget['instance']['br_wp_footer'] = true;
|
113 |
the_widget( 'BeRocket_new_AAPF_Widget_single', $widget['instance'], $widget['args']);
|
114 |
}
|
98 |
}
|
99 |
}
|
100 |
}
|
101 |
+
global $br_wc_query, $br_aapf_wc_footer_widget, $br_widget_ids, $br_widget_ids_apply;
|
102 |
+
$br_widget_ids_apply = $br_widget_ids;
|
103 |
$br_query_vars['fields'] = 'ids';
|
104 |
$br_wc_query = $br_query_vars;
|
105 |
$br_aapf_wc_footer_widget = true;
|
106 |
add_action( 'wp_footer', array( $this, 'wp_footer_widget'), 99999 );
|
107 |
}
|
108 |
public function wp_footer_widget() {
|
109 |
+
global $br_widget_ids_apply, $br_wc_query;
|
110 |
+
if( isset( $br_widget_ids_apply ) && is_array( $br_widget_ids_apply ) && count( $br_widget_ids_apply ) > 0 ) {
|
111 |
echo '<div class="berocket_wc_shortcode_fix" style="display: none;">';
|
112 |
+
foreach ( $br_widget_ids_apply as $widget ) {
|
113 |
$widget['instance']['br_wp_footer'] = true;
|
114 |
the_widget( 'BeRocket_new_AAPF_Widget_single', $widget['instance'], $widget['args']);
|
115 |
}
|
includes/url-parse/price.php
CHANGED
@@ -58,18 +58,33 @@ if( ! class_exists('BeRocket_url_parse_page_price') ) {
|
|
58 |
}
|
59 |
public function generate_filter_link($result, $instance, $filter, $data) {
|
60 |
if( $filter['type'] == 'price' && isset($filter['val_arr']['from']) && isset($filter['val_arr']['to']) ) {
|
61 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
62 |
}
|
63 |
return $result;
|
64 |
}
|
65 |
public function generate_filter_link_val_arr($val_arr, $filter, $instance) {
|
|
|
66 |
if( isset($val_arr['from']) && isset($val_arr['to']) ) {
|
67 |
$delimiter = '_';
|
68 |
if( isset($val_arr['op']) ) {
|
69 |
$delimiter = $instance->func_operator_to_delimiter($val_arr['op']);
|
70 |
unset($val_arr['op']);
|
71 |
}
|
|
|
72 |
}
|
|
|
73 |
}
|
74 |
public function post_clauses($args, $filter) {
|
75 |
return $this->add_price_to_post_clauses($args, $filter);
|
58 |
}
|
59 |
public function generate_filter_link($result, $instance, $filter, $data) {
|
60 |
if( $filter['type'] == 'price' && isset($filter['val_arr']['from']) && isset($filter['val_arr']['to']) ) {
|
61 |
+
$price_taxonomy = apply_filters('bapf_uparse_price_taxonomy', 'price');
|
62 |
+
$link_elements = apply_filters('bapf_uparse_generate_filter_link_each_taxval_delimiters', array(
|
63 |
+
'before_values' => '[',
|
64 |
+
'after_values' => ']',
|
65 |
+
), $this, $filter, $data);
|
66 |
+
$values_line = $this->generate_filter_link_val_arr($filter['val_arr'], $filter, $instance);
|
67 |
+
if( ! empty($values_line) ) {
|
68 |
+
$values_line = $price_taxonomy . $link_elements['before_values'] . $values_line . $link_elements['after_values'];
|
69 |
+
return array(apply_filters('bapf_uparse_generate_filter_link_each_values_line', $values_line, $this, $filter, $data, $link_elements, array(
|
70 |
+
'taxonomy_name' => $price_taxonomy,
|
71 |
+
'filter_line' => $values_line
|
72 |
+
)));
|
73 |
+
}
|
74 |
}
|
75 |
return $result;
|
76 |
}
|
77 |
public function generate_filter_link_val_arr($val_arr, $filter, $instance) {
|
78 |
+
$filter_line = '';
|
79 |
if( isset($val_arr['from']) && isset($val_arr['to']) ) {
|
80 |
$delimiter = '_';
|
81 |
if( isset($val_arr['op']) ) {
|
82 |
$delimiter = $instance->func_operator_to_delimiter($val_arr['op']);
|
83 |
unset($val_arr['op']);
|
84 |
}
|
85 |
+
$filter_line = $val_arr['from'] . $delimiter . $val_arr['to'];
|
86 |
}
|
87 |
+
return $filter_line;
|
88 |
}
|
89 |
public function post_clauses($args, $filter) {
|
90 |
return $this->add_price_to_post_clauses($args, $filter);
|
main.php
CHANGED
@@ -193,7 +193,6 @@ class BeRocket_AAPF extends BeRocket_Framework {
|
|
193 |
//INIT ADITIONAL CLASSES
|
194 |
BeRocket_AAPF_single_filter::getInstance();
|
195 |
BeRocket_AAPF_group_filters::getInstance();
|
196 |
-
new BeRocket_AAPF_compat_product_table();
|
197 |
new BeRocket_AAPF_compat_JetSmartFilter();
|
198 |
add_action('vc_before_init', 'berocket_filter_vc_before_init', 100000);
|
199 |
//----------------------
|
@@ -203,6 +202,7 @@ class BeRocket_AAPF extends BeRocket_Framework {
|
|
203 |
if ( $this->init_validation() ) {
|
204 |
new BeRocket_AAPF_get_terms();
|
205 |
new BeRocket_AAPF_get_terms_additionals();
|
|
|
206 |
}
|
207 |
if ( ! function_exists('is_network_admin') || ! is_network_admin() ) {
|
208 |
if( $this->check_framework_version() ) {
|
193 |
//INIT ADITIONAL CLASSES
|
194 |
BeRocket_AAPF_single_filter::getInstance();
|
195 |
BeRocket_AAPF_group_filters::getInstance();
|
|
|
196 |
new BeRocket_AAPF_compat_JetSmartFilter();
|
197 |
add_action('vc_before_init', 'berocket_filter_vc_before_init', 100000);
|
198 |
//----------------------
|
202 |
if ( $this->init_validation() ) {
|
203 |
new BeRocket_AAPF_get_terms();
|
204 |
new BeRocket_AAPF_get_terms_additionals();
|
205 |
+
new BeRocket_AAPF_compat_product_table();
|
206 |
}
|
207 |
if ( ! function_exists('is_network_admin') || ! is_network_admin() ) {
|
208 |
if( $this->check_framework_version() ) {
|
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: 5.0
|
7 |
Tested up to: 5.8
|
8 |
-
Stable tag: 1.6.1
|
9 |
License: GPLv2 or later
|
10 |
License URI: http://www.gnu.org/licenses/gpl-2.0.html
|
11 |
|
@@ -185,6 +185,11 @@ You can try this plugin's admin side [here](https://berocket.com/product/woocomm
|
|
185 |
|
186 |
== Changelog ==
|
187 |
|
|
|
|
|
|
|
|
|
|
|
188 |
= 1.6.1 =
|
189 |
* Fix - Compatibility filtering with WPML and Polylang
|
190 |
* Fix - Compatibility with WPML taxonomy translation
|
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: 5.0
|
7 |
Tested up to: 5.8
|
8 |
+
Stable tag: 1.6.1.1
|
9 |
License: GPLv2 or later
|
10 |
License URI: http://www.gnu.org/licenses/gpl-2.0.html
|
11 |
|
185 |
|
186 |
== Changelog ==
|
187 |
|
188 |
+
= 1.6.1.1 =
|
189 |
+
* Fix - Compatibility with Product Table plugin
|
190 |
+
* Fix - URL decoding option with Product Table plugin
|
191 |
+
* Fix - Link generation for price filters
|
192 |
+
|
193 |
= 1.6.1 =
|
194 |
* Fix - Compatibility filtering with WPML and Polylang
|
195 |
* Fix - Compatibility with WPML taxonomy translation
|
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.6.1
|
7 |
* Author: BeRocket
|
8 |
* Requires at least: 5.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: 5.9
|
13 |
*/
|
14 |
-
define( "BeRocket_AJAX_filters_version", '1.6.1' );
|
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.6.1.1
|
7 |
* Author: BeRocket
|
8 |
* Requires at least: 5.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: 5.9
|
13 |
*/
|
14 |
+
define( "BeRocket_AJAX_filters_version", '1.6.1.1' );
|
15 |
define( "BeRocket_AJAX_filters_file", __FILE__ );
|
16 |
include_once('main.php');
|