Advanced AJAX Product Filters - Version 1.1.5

Version Description

  • Fix - Shortcode doesn't work
  • Fix - Optimization for price filters
  • Fix - Filters work incorrect on search page
  • Fix - Some strings is not translated with WPML
  • Fix - Optimization for hiding attribute values without products
Download this release

Release Info

Developer dholovnia
Plugin Icon wp plugin Advanced AJAX Product Filters
Version 1.1.5
Comparing to
See all releases

Code changes from version 1.1.4 to 1.1.5

README.md CHANGED
@@ -4,8 +4,8 @@ Contributors: dholovnia, berocket
4
  Donate link: http://berocket.com
5
  Tags: filters, product filters, ajax product filters, advanced product filters, woocommerce filters, woocommerce product filters, woocommerce ajax product filters, widget, plugin
6
  Requires at least: 4.0
7
- Tested up to: 4.4
8
- Stable tag: 1.1.4
9
  License: GPLv2 or later
10
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
11
 
@@ -139,6 +139,14 @@ http://woocommerce-product-filter.berocket.com
139
 
140
  == Changelog ==
141
 
 
 
 
 
 
 
 
 
142
  = 1.1.4 =
143
  * Enhancement - Russian translation
144
  * Fix - Translation
4
  Donate link: http://berocket.com
5
  Tags: filters, product filters, ajax product filters, advanced product filters, woocommerce filters, woocommerce product filters, woocommerce ajax product filters, widget, plugin
6
  Requires at least: 4.0
7
+ Tested up to: 4.5.3
8
+ Stable tag: 1.1.5
9
  License: GPLv2 or later
10
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
11
 
139
 
140
  == Changelog ==
141
 
142
+ = 1.1.5 =
143
+ * Fix - Shortcode doesn't work
144
+ * Fix - Optimization for price filters
145
+ * Fix - Filters work incorrect on search page
146
+ * Fix - Some strings is not translated with WPML
147
+ * Fix - Optimization for hiding attribute values without products
148
+
149
+
150
  = 1.1.4 =
151
  * Enhancement - Russian translation
152
  * Fix - Translation
includes/widget.php CHANGED
@@ -103,6 +103,7 @@ class BeRocket_AAPF_Widget extends WP_Widget {
103
  'scroll_shop_top' => @ $br_options['scroll_shop_top'],
104
  'hide_sel_value' => @ $br_options['hide_value']['sel'],
105
  'ajax_request_load' => @ $br_options['ajax_request_load'],
 
106
  )
107
  );
108
  unset( $current_language );
@@ -209,6 +210,8 @@ class BeRocket_AAPF_Widget extends WP_Widget {
209
  set_query_var( 'x', time() );
210
  set_query_var( 'hide_o_value', @ $br_options['hide_value']['o'] );
211
  set_query_var( 'hide_sel_value', @ $br_options['hide_value']['sel'] );
 
 
212
 
213
  echo $before_widget;
214
 
@@ -306,72 +309,59 @@ class BeRocket_AAPF_Widget extends WP_Widget {
306
  }
307
 
308
  public static function get_price_range( $wp_query_product_cat, $woocommerce_hide_out_of_stock_items ){
309
- global $wp_query;
310
- $br_options = apply_filters( 'berocket_aapf_listener_br_options', get_option('br_filters_options') );
311
- $wp_query_product_cat_save = $wp_query;
312
- $price_range = array();
313
- if( @ $br_options['show_all_values'] ) {
314
- $products = BeRocket_AAPF_Widget::get_filter_products( $wp_query_product_cat, $woocommerce_hide_out_of_stock_items, false );
315
- foreach ( $products as $ID ) {
316
- $meta_values = get_post_meta( $ID, '_price' );
317
- if ( $meta_values[0] or $woocommerce_hide_out_of_stock_items != 'yes' ) {
318
- $price_range[] = $meta_values[0];
319
- }
320
- $product_variation = get_children ( array ( 'post_parent' => $ID, 'post_type' => 'product_variation', 'numberposts' => -1, 'post_status' => 'any' ) );
321
- if ( is_array( $product_variation ) ) {
322
- foreach ( $product_variation as $variation ) {
323
- $meta_values = get_post_meta( $variation->ID, '_price' );
324
- if ( $meta_values[0] or $woocommerce_hide_out_of_stock_items != 'yes' ) {
325
- $price_range[] = $meta_values[0];
326
- }
327
- }
328
- }
329
  }
330
- } else {
331
- $q_args = $wp_query->query_vars;
332
- $q_args['posts_per_page'] = 2000;
333
- $q_args['post__in'] = '';
334
- $q_args['tax_query'] = '';
335
- $q_args['taxonomy'] = '';
336
- $q_args['term'] = '';
337
- $q_args['meta_query'] = '';
338
- $q_args['attribute'] = '';
339
- $q_args['title'] = '';
340
- $q_args['post_type'] = 'product';
341
- $q_args['fields'] = 'ids';
342
- $paged = 1;
343
- do{
344
- $q_args['paged'] = $paged;
345
- $the_query = new WP_Query($q_args);
346
- if ( $the_query->have_posts() ) {
347
- foreach ( $the_query->posts as $ID ) {
348
- $meta_values = get_post_meta( $ID, '_price' );
349
- if ( $meta_values[0] or $woocommerce_hide_out_of_stock_items != 'yes' ) {
350
- $price_range[] = $meta_values[0];
351
- }
352
- $product_variation = get_children ( array ( 'post_parent' => $ID, 'post_type' => 'product_variation', 'numberposts' => -1, 'post_status' => 'any' ) );
353
- if ( is_array( $product_variation ) ) {
354
- foreach ( $product_variation as $variation ) {
355
- $meta_values = get_post_meta( $variation->ID, '_price' );
356
- if ( $meta_values[0] or $woocommerce_hide_out_of_stock_items != 'yes' ) {
357
- $price_range[] = $meta_values[0];
358
- }
359
- }
360
- }
361
- }
362
- }
363
- $paged++;
364
- } while($paged <= $the_query->max_num_pages);
365
- }
366
- $wp_query = $wp_query_product_cat_save;
367
- unset( $wp_query_product_cat_save );
368
 
369
- $price_range = array_unique( $price_range );
 
370
 
371
- if ( @ count( $price_range ) < 2 ) {
372
- $price_range = false;
 
 
 
 
 
 
 
 
 
 
373
  }
 
374
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
375
  return apply_filters( 'berocket_aapf_get_price_range', $price_range );
376
  }
377
 
@@ -379,49 +369,113 @@ class BeRocket_AAPF_Widget extends WP_Widget {
379
  if ( ! $taxonomy ) return array();
380
  $re = array();
381
  if( $hide_empty ) {
382
- global $wp_query, $post;
383
- $terms = array();
384
- $q_args = $wp_query->query_vars;
385
- $q_args['posts_per_page'] = 2000;
386
- $q_args['post__in'] = '';
387
- $q_args['tax_query'] = '';
388
- $q_args['taxonomy'] = '';
389
- $q_args['term'] = '';
390
- $q_args['meta_query'] = '';
391
- $q_args['attribute'] = '';
392
- $q_args['title'] = '';
393
- $q_args['post_type'] = 'product';
394
- $q_args['fields'] = 'ids';
395
- $paged = 1;
396
- do{
397
- $q_args['paged'] = $paged;
398
- $the_query = new WP_Query($q_args);
399
- if ( $the_query->have_posts() ) {
400
- foreach ( $the_query->posts as $post_id ) {
401
- $curent_terms = wp_get_object_terms( $post_id, $taxonomy, array( 'fields' => 'ids' ) );
402
- foreach ( $curent_terms as $t ) {
403
- if ( ! in_array( $t,$terms ) ) {
404
- $terms[] = $t;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
405
  }
406
  }
407
  }
408
- }
409
- $paged++;
410
- } while($paged <= $the_query->max_num_pages);
411
- unset( $q_args );
412
- unset( $the_query );
413
- wp_reset_query();
414
- $args = array(
415
- 'orderby' => $order_by,
416
- 'order' => 'ASC',
417
- 'hide_empty' => false,
418
- );
419
- $terms2 = get_terms( $taxonomy, $args );
420
- foreach ( $terms2 as $t ) {
421
- if ( in_array( $t->term_id, $terms ) ) {
422
- $re[] = $t;
423
  }
424
  }
 
425
  return $re;
426
  } else {
427
  $args = array(
@@ -587,6 +641,9 @@ class BeRocket_AAPF_Widget extends WP_Widget {
587
  $args['taxonomy'] = $product_taxonomy[0];
588
  $args['term'] = $product_taxonomy[1];
589
  }
 
 
 
590
 
591
  $wp_query = new WP_Query( $args );
592
 
103
  'scroll_shop_top' => @ $br_options['scroll_shop_top'],
104
  'hide_sel_value' => @ $br_options['hide_value']['sel'],
105
  'ajax_request_load' => @ $br_options['ajax_request_load'],
106
+ 's' => @ $_GET['s'],
107
  )
108
  );
109
  unset( $current_language );
210
  set_query_var( 'x', time() );
211
  set_query_var( 'hide_o_value', @ $br_options['hide_value']['o'] );
212
  set_query_var( 'hide_sel_value', @ $br_options['hide_value']['sel'] );
213
+ set_query_var( 'before_title', @ $before_title );
214
+ set_query_var( 'after_title', @ $after_title );
215
 
216
  echo $before_widget;
217
 
309
  }
310
 
311
  public static function get_price_range( $wp_query_product_cat, $woocommerce_hide_out_of_stock_items ){
312
+ global $wpdb, $wp_query;
313
+ $_POST['product_cat'] = $wp_query_product_cat;
314
+ $extra_inner = $extra_where = '';
315
+
316
+ if ( @ $_POST['product_cat'] and $_POST['product_cat'] != '-1' ) {
317
+ $product_cat = get_term_by( 'slug', $_POST['product_cat'], 'product_cat' );
318
+ $sub_categories = get_term_children($product_cat->term_id, 'product_cat');
319
+ if( empty($sub_categories) || ! is_array($sub_categories) ) {
320
+ $sub_categories = array();
 
 
 
 
 
 
 
 
 
 
 
321
  }
322
+ $sub_categories[] = $product_cat->term_id;
323
+ $sub_categories = implode(',', $sub_categories);
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
324
 
325
+ $extra_inner = " INNER JOIN {$wpdb->term_relationships} ON ({$wpdb->posts}.ID = {$wpdb->term_relationships}.object_id) ";
326
+ $extra_where = " AND ( {$wpdb->term_relationships}.term_taxonomy_id IN (" . $sub_categories . ") ) ";
327
 
328
+ unset( $sub_categories );
329
+ } elseif ( isset($wp_query->query_vars['product_tag']) ) {
330
+ $product_tag = get_term_by( 'slug', $wp_query->query_vars['product_tag'], 'product_tag' );
331
+ $extra_inner = " INNER JOIN {$wpdb->term_relationships} ON ({$wpdb->posts}.ID = {$wpdb->term_relationships}.object_id) ";
332
+ $extra_where = " AND ( {$wpdb->term_relationships}.term_taxonomy_id IN (" . $product_tag->term_id . ") ) ";
333
+ }
334
+ $hide_out_of_stock = BeRocket_AAPF_Widget::woocommerce_hide_out_of_stock_items();
335
+ $out_of_stock1 = '';
336
+ $out_of_stock2 = '';
337
+ if ( $hide_out_of_stock == 'yes' ) {
338
+ $out_of_stock1 = "INNER JOIN {$wpdb->postmeta} AS pm2 ON ({$wpdb->posts}.ID = pm2.post_id)";
339
+ $out_of_stock2 = "AND ( pm2.meta_key = '_stock_status' AND CAST(pm2.meta_value AS CHAR) = 'instock' )";
340
  }
341
+
342
 
343
+ $query_string = "
344
+ SELECT MIN(cast({$wpdb->postmeta}.meta_value as unsigned)) as min_price, MAX(cast({$wpdb->postmeta}.meta_value as unsigned)) as max_price
345
+ FROM {$wpdb->posts}
346
+ INNER JOIN {$wpdb->postmeta} ON ({$wpdb->posts}.ID = {$wpdb->postmeta}.post_id)
347
+ INNER JOIN {$wpdb->postmeta} AS pm1 ON ({$wpdb->posts}.ID = pm1.post_id)
348
+ {$out_of_stock1}
349
+ {$extra_inner}
350
+ WHERE {$wpdb->posts}.post_type = 'product'
351
+ AND {$wpdb->posts}.post_status = 'publish'
352
+ {$extra_where}
353
+ AND ( {$wpdb->postmeta}.meta_key = '_price' AND {$wpdb->postmeta}.meta_value > 0
354
+ AND ( pm1.meta_key = '_visibility' AND CAST(pm1.meta_value AS CHAR) IN ('visible','catalog') )
355
+ {$out_of_stock2} ) ";
356
+
357
+ $prices = $wpdb->get_row($query_string);
358
+ $price_range = false;
359
+ if( isset($prices->min_price) && isset($prices->max_price) && $prices->min_price != $prices->max_price ) {
360
+ $price_range = array(
361
+ apply_filters( 'woocommerce_price_filter_widget_min_amount', $prices->min_price ),
362
+ apply_filters( 'woocommerce_price_filter_widget_max_amount', $prices->max_price )
363
+ );
364
+ }
365
  return apply_filters( 'berocket_aapf_get_price_range', $price_range );
366
  }
367
 
369
  if ( ! $taxonomy ) return array();
370
  $re = array();
371
  if( $hide_empty ) {
372
+ global $wp_query, $post, $wp_the_query;
373
+ $old_wp_the_query = $wp_the_query;
374
+ $wp_the_query = $wp_query;
375
+ if( method_exists('WC_Query', 'get_main_tax_query') && method_exists('WC_Query', 'get_main_tax_query') &&
376
+ class_exists('WP_Meta_Query') && class_exists('WP_Tax_Query') ) {
377
+ $args = array(
378
+ 'orderby' => $order_by,
379
+ 'order' => 'ASC',
380
+ 'hide_empty' => false,
381
+ );
382
+ $re = get_terms( $taxonomy, $args );
383
+ global $wpdb;
384
+ $meta_query = WC_Query::get_main_meta_query();
385
+ $args = $wp_the_query->query_vars;
386
+ $tax_query = array();
387
+ if ( ! empty( $args['product_cat'] ) ) {
388
+ $tax_query[ 'product_cat' ] = array(
389
+ 'taxonomy' => 'product_cat',
390
+ 'terms' => array( $args['product_cat'] ),
391
+ 'field' => 'slug',
392
+ );
393
+ }
394
+
395
+ $meta_query = new WP_Meta_Query( $meta_query );
396
+ $tax_query = new WP_Tax_Query( $tax_query );
397
+ $meta_query_sql = $meta_query->get_sql( 'post', $wpdb->posts, 'ID' );
398
+ $tax_query_sql = $tax_query->get_sql( $wpdb->posts, 'ID' );
399
+ $term_ids = wp_list_pluck( $re, 'term_id' );
400
+
401
+ // Generate query
402
+ $query = array();
403
+ $query['select'] = "SELECT COUNT( DISTINCT {$wpdb->posts}.ID ) as term_count, terms.term_id as term_count_id";
404
+ $query['from'] = "FROM {$wpdb->posts}";
405
+ $query['join'] = "
406
+ INNER JOIN {$wpdb->term_relationships} AS term_relationships ON {$wpdb->posts}.ID = term_relationships.object_id
407
+ INNER JOIN {$wpdb->term_taxonomy} AS term_taxonomy USING( term_taxonomy_id )
408
+ INNER JOIN {$wpdb->terms} AS terms USING( term_id )
409
+ " . $tax_query_sql['join'] . $meta_query_sql['join'];
410
+ $query['where'] = "
411
+ WHERE {$wpdb->posts}.post_type IN ( 'product' )
412
+ AND {$wpdb->posts}.post_status = 'publish'
413
+ " . $tax_query_sql['where'] . $meta_query_sql['where'] . "
414
+ AND terms.term_id IN (" . implode( ',', array_map( 'absint', $term_ids ) ) . ")
415
+ ";
416
+ $query['group_by'] = "GROUP BY terms.term_id";
417
+ $query = apply_filters( 'woocommerce_get_filtered_term_product_counts_query', $query );
418
+ $query = implode( ' ', $query );
419
+ $results = $wpdb->get_results( $query );
420
+ $results = wp_list_pluck( $results, 'term_count', 'term_count_id' );
421
+ $term_count = array();
422
+ $terms = array();
423
+ foreach($re as &$res_count) {
424
+ if( ! empty($results[$res_count->term_id] ) ) {
425
+ $res_count->count = $results[$res_count->term_id];
426
+ } else {
427
+ $res_count->count = 0;
428
+ }
429
+ if( $res_count->count > 0 ) {
430
+ $terms[] = $res_count;
431
+ }
432
+ }
433
+ $re = $terms;
434
+ } else {
435
+ $terms = array();
436
+ $q_args = $wp_query->query_vars;
437
+ $q_args['posts_per_page'] = 2000;
438
+ $q_args['post__in'] = '';
439
+ $q_args['tax_query'] = '';
440
+ $q_args['taxonomy'] = '';
441
+ $q_args['term'] = '';
442
+ $q_args['meta_query'] = '';
443
+ $q_args['attribute'] = '';
444
+ $q_args['title'] = '';
445
+ $q_args['post_type'] = 'product';
446
+ $q_args['fields'] = 'ids';
447
+ $paged = 1;
448
+ do{
449
+ $q_args['paged'] = $paged;
450
+ $the_query = new WP_Query($q_args);
451
+ if ( $the_query->have_posts() ) {
452
+ foreach ( $the_query->posts as $post_id ) {
453
+ $curent_terms = wp_get_object_terms( $post_id, $taxonomy, array( 'fields' => 'ids' ) );
454
+ foreach ( $curent_terms as $t ) {
455
+ if ( ! in_array( $t,$terms ) ) {
456
+ $terms[] = $t;
457
+ }
458
  }
459
  }
460
  }
461
+ $paged++;
462
+ } while($paged <= $the_query->max_num_pages);
463
+ unset( $q_args );
464
+ unset( $the_query );
465
+ wp_reset_query();
466
+ $args = array(
467
+ 'orderby' => $order_by,
468
+ 'order' => 'ASC',
469
+ 'hide_empty' => false,
470
+ );
471
+ $terms2 = get_terms( $taxonomy, $args );
472
+ foreach ( $terms2 as $t ) {
473
+ if ( in_array( $t->term_id, $terms ) ) {
474
+ $re[] = $t;
475
+ }
476
  }
477
  }
478
+ $wp_the_query = $old_wp_the_query;
479
  return $re;
480
  } else {
481
  $args = array(
641
  $args['taxonomy'] = $product_taxonomy[0];
642
  $args['term'] = $product_taxonomy[1];
643
  }
644
+ if( isset($_POST['s']) && strlen($_POST['s']) > 0 ) {
645
+ $args['s'] = $_POST['s'];
646
+ }
647
 
648
  $wp_query = new WP_Query( $args );
649
 
js/widget.min.js CHANGED
@@ -182,7 +182,8 @@
182
  product_cat: the_ajax_script.product_cat,
183
  product_taxonomy: the_ajax_script.product_taxonomy,
184
  action: 'berocket_aapf_listener',
185
- orderby: orderby
 
186
  };
187
 
188
  if( the_ajax_script.seo_friendly_urls && 'history' in window && 'pushState' in history ) {
@@ -454,7 +455,7 @@
454
  _next_page = $(this).text();
455
  }
456
  $('.woocommerce-pagination span.current').removeClass('current');
457
- $(this).after("<span class='page-numbers current'>"+_next_page+"</span>").remove();
458
  berocket_aapf_widget_first_page_jump = false;
459
  updateProducts(true);
460
  });
182
  product_cat: the_ajax_script.product_cat,
183
  product_taxonomy: the_ajax_script.product_taxonomy,
184
  action: 'berocket_aapf_listener',
185
+ orderby: orderby,
186
+ s: the_ajax_script.s
187
  };
188
 
189
  if( the_ajax_script.seo_friendly_urls && 'history' in window && 'pushState' in history ) {
455
  _next_page = $(this).text();
456
  }
457
  $('.woocommerce-pagination span.current').removeClass('current');
458
+ $(this).after("<span class='page-numbers current' style='display:none!important;'>"+_next_page+"</span>");
459
  berocket_aapf_widget_first_page_jump = false;
460
  updateProducts(true);
461
  });
languages/BeRocket_AJAX_domain-ru_RU.mo CHANGED
Binary file
languages/BeRocket_AJAX_domain-ru_RU.po CHANGED
@@ -3,7 +3,7 @@ msgstr ""
3
  "Project-Id-Version: Advanced AJAX Product Filters for WooCommerce\n"
4
  "Report-Msgid-Bugs-To: \n"
5
  "POT-Creation-Date: Thu Feb 11 2016 10:53:27 GMT+0200 (EET)\n"
6
- "PO-Revision-Date: Thu Feb 11 2016 11:32:11 GMT+0200 (EET)\n"
7
  "Last-Translator: RazyRx <djcrazysait@mail.ru>\n"
8
  "Language-Team: \n"
9
  "Language: Russian\n"
@@ -23,6 +23,14 @@ msgstr ""
23
  "X-Generator: Loco - https://localise.biz/\n"
24
  "X-Loco-Target-Locale: ru_RU"
25
 
 
 
 
 
 
 
 
 
26
  #. Name of the plugin
27
  msgid "Advanced AJAX Product Filters for WooCommerce"
28
  msgstr "dvanced AJAX Product Filters for WooCommerce"
@@ -39,27 +47,27 @@ msgstr "BeRocket"
39
  msgid "http://berocket.com"
40
  msgstr "http://berocket.com"
41
 
42
- #: ../woocommerce-filters.php:84
43
  msgid "Activate WooCommerce plugin before"
44
  msgstr "Сначала активируйте плагин WooCommerce"
45
 
46
- #: ../woocommerce-filters.php:92
47
  msgid "Update WooCommerce plugin"
48
  msgstr "Обновите плагин WooCommerce"
49
 
50
- #: ../woocommerce-filters.php:98
51
  msgid "Product Filters Settings"
52
  msgstr "Product Filters Настройки"
53
 
54
- #: ../woocommerce-filters.php:98
55
  msgid "Product Filters"
56
  msgstr "Product Filters"
57
 
58
- #: ../includes/widget.php:27
59
  msgid "Add Filters to Products page"
60
  msgstr "Добавляет фильтры на страницы с продуктами"
61
 
62
- #: ../includes/widget.php:34 ../includes/widget.php:36
63
  msgid "AJAX Product Filters"
64
  msgstr "AJAX Product Filters"
65
 
3
  "Project-Id-Version: Advanced AJAX Product Filters for WooCommerce\n"
4
  "Report-Msgid-Bugs-To: \n"
5
  "POT-Creation-Date: Thu Feb 11 2016 10:53:27 GMT+0200 (EET)\n"
6
+ "PO-Revision-Date: Thu Jul 07 2016 15:50:19 GMT+0300 (EEST)\n"
7
  "Last-Translator: RazyRx <djcrazysait@mail.ru>\n"
8
  "Language-Team: \n"
9
  "Language: Russian\n"
23
  "X-Generator: Loco - https://localise.biz/\n"
24
  "X-Loco-Target-Locale: ru_RU"
25
 
26
+ #: ../templates/checkbox.php:44 ../templates/radio.php:34
27
+ msgid "Show value"
28
+ msgstr "Показать значения"
29
+
30
+ #: ../templates/select.php:4
31
+ msgid "Any"
32
+ msgstr "Любые"
33
+
34
  #. Name of the plugin
35
  msgid "Advanced AJAX Product Filters for WooCommerce"
36
  msgstr "dvanced AJAX Product Filters for WooCommerce"
47
  msgid "http://berocket.com"
48
  msgstr "http://berocket.com"
49
 
50
+ #: ../woocommerce-filters.php:85
51
  msgid "Activate WooCommerce plugin before"
52
  msgstr "Сначала активируйте плагин WooCommerce"
53
 
54
+ #: ../woocommerce-filters.php:93
55
  msgid "Update WooCommerce plugin"
56
  msgstr "Обновите плагин WooCommerce"
57
 
58
+ #: ../woocommerce-filters.php:99
59
  msgid "Product Filters Settings"
60
  msgstr "Product Filters Настройки"
61
 
62
+ #: ../woocommerce-filters.php:99
63
  msgid "Product Filters"
64
  msgstr "Product Filters"
65
 
66
+ #: ../includes/widget.php:28
67
  msgid "Add Filters to Products page"
68
  msgstr "Добавляет фильтры на страницы с продуктами"
69
 
70
+ #: ../includes/widget.php:35 ../includes/widget.php:37
71
  msgid "AJAX Product Filters"
72
  msgstr "AJAX Product Filters"
73
 
languages/BeRocket_AJAX_domain.pot CHANGED
@@ -5,7 +5,7 @@ msgstr ""
5
  "Project-Id-Version: Advanced AJAX Product Filters for WooCommerce\n"
6
  "Report-Msgid-Bugs-To: \n"
7
  "POT-Creation-Date: Thu Feb 11 2016 10:53:27 GMT+0200 (EET)\n"
8
- "POT-Revision-Date: Thu Feb 11 2016 10:53:29 GMT+0200 (EET)\n"
9
  "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
10
  "Last-Translator: \n"
11
  "Language-Team: \n"
@@ -40,30 +40,34 @@ msgstr ""
40
  msgid "http://berocket.com"
41
  msgstr ""
42
 
43
- #: ../woocommerce-filters.php:84
44
  msgid "Activate WooCommerce plugin before"
45
  msgstr ""
46
 
47
- #: ../woocommerce-filters.php:92
48
  msgid "Update WooCommerce plugin"
49
  msgstr ""
50
 
51
- #: ../woocommerce-filters.php:98
52
  msgid "Product Filters Settings"
53
  msgstr ""
54
 
55
- #: ../woocommerce-filters.php:98
56
  msgid "Product Filters"
57
  msgstr ""
58
 
59
- #: ../includes/widget.php:27
60
  msgid "Add Filters to Products page"
61
  msgstr ""
62
 
63
- #: ../includes/widget.php:34 ../includes/widget.php:36
64
  msgid "AJAX Product Filters"
65
  msgstr ""
66
 
 
 
 
 
67
  #: ../templates/admin.php:2
68
  msgid "Widget Type:"
69
  msgstr ""
@@ -120,6 +124,10 @@ msgstr ""
120
  msgid "Scroll Theme:"
121
  msgstr ""
122
 
 
 
 
 
123
  #: ../templates/admin-settings.php:9
124
  msgid "General"
125
  msgstr ""
5
  "Project-Id-Version: Advanced AJAX Product Filters for WooCommerce\n"
6
  "Report-Msgid-Bugs-To: \n"
7
  "POT-Creation-Date: Thu Feb 11 2016 10:53:27 GMT+0200 (EET)\n"
8
+ "POT-Revision-Date: Thu Jul 07 2016 15:45:32 GMT+0300 (EEST)\n"
9
  "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
10
  "Last-Translator: \n"
11
  "Language-Team: \n"
40
  msgid "http://berocket.com"
41
  msgstr ""
42
 
43
+ #: ../woocommerce-filters.php:85
44
  msgid "Activate WooCommerce plugin before"
45
  msgstr ""
46
 
47
+ #: ../woocommerce-filters.php:93
48
  msgid "Update WooCommerce plugin"
49
  msgstr ""
50
 
51
+ #: ../woocommerce-filters.php:99
52
  msgid "Product Filters Settings"
53
  msgstr ""
54
 
55
+ #: ../woocommerce-filters.php:99
56
  msgid "Product Filters"
57
  msgstr ""
58
 
59
+ #: ../includes/widget.php:28
60
  msgid "Add Filters to Products page"
61
  msgstr ""
62
 
63
+ #: ../includes/widget.php:35 ../includes/widget.php:37
64
  msgid "AJAX Product Filters"
65
  msgstr ""
66
 
67
+ #: ../templates/checkbox.php:44 ../templates/radio.php:34
68
+ msgid "Show value"
69
+ msgstr ""
70
+
71
  #: ../templates/admin.php:2
72
  msgid "Widget Type:"
73
  msgstr ""
124
  msgid "Scroll Theme:"
125
  msgstr ""
126
 
127
+ #: ../templates/select.php:4
128
+ msgid "Any"
129
+ msgstr ""
130
+
131
  #: ../templates/admin-settings.php:9
132
  msgid "General"
133
  msgstr ""
readme.txt CHANGED
@@ -4,8 +4,8 @@ Contributors: dholovnia, berocket
4
  Donate link: http://berocket.com
5
  Tags: filters, product filters, ajax product filters, advanced product filters, woocommerce filters, woocommerce product filters, woocommerce ajax product filters, widget, plugin
6
  Requires at least: 4.0
7
- Tested up to: 4.4
8
- Stable tag: 1.1.4
9
  License: GPLv2 or later
10
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
11
 
@@ -139,6 +139,13 @@ http://woocommerce-product-filter.berocket.com
139
 
140
  == Changelog ==
141
 
 
 
 
 
 
 
 
142
  = 1.1.4 =
143
  * Enhancement - Russian translation
144
  * Fix - Translation
@@ -276,4 +283,4 @@ you set to order `by custom` you can drag&amp;drop values up and down and set yo
276
  * Fix - better support for older PHP versions
277
 
278
  = 1.0.1 =
279
- * First public version
4
  Donate link: http://berocket.com
5
  Tags: filters, product filters, ajax product filters, advanced product filters, woocommerce filters, woocommerce product filters, woocommerce ajax product filters, widget, plugin
6
  Requires at least: 4.0
7
+ Tested up to: 4.5.3
8
+ Stable tag: 1.1.5
9
  License: GPLv2 or later
10
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
11
 
139
 
140
  == Changelog ==
141
 
142
+ = 1.1.5 =
143
+ * Fix - Shortcode doesn't work
144
+ * Fix - Optimization for price filters
145
+ * Fix - Filters work incorrect on search page
146
+ * Fix - Some strings is not translated with WPML
147
+ * Fix - Optimization for hiding attribute values without products
148
+
149
  = 1.1.4 =
150
  * Enhancement - Russian translation
151
  * Fix - Translation
283
  * Fix - better support for older PHP versions
284
 
285
  = 1.0.1 =
286
+ * First public version
templates/checkbox.php CHANGED
@@ -41,5 +41,5 @@ if ( @ $terms ):
41
  </li>
42
  <?php
43
  endforeach; ?>
44
- <li class="berocket_widget_show_values"<?php if( !$hiden_value ) echo ' style="display: none;"'; ?>>Show value<span class="show_button"></span></li>
45
  <?php endif; ?>
41
  </li>
42
  <?php
43
  endforeach; ?>
44
+ <li class="berocket_widget_show_values"<?php if( !$hiden_value ) echo ' style="display: none;"'; ?>><?php _e( 'Show value', 'BeRocket_AJAX_domain' ) ?><span class="show_button"></span></li>
45
  <?php endif; ?>
templates/radio.php CHANGED
@@ -31,5 +31,5 @@ if ( $terms ):
31
  </span>
32
  </li>
33
  <?php endforeach; ?>
34
- <li class="berocket_widget_show_values"<?php if( !$hiden_value ) echo ' style="display: none;"'; ?>>Show value<span class="show_button"></span></li>
35
  <?php endif; ?>
31
  </span>
32
  </li>
33
  <?php endforeach; ?>
34
+ <li class="berocket_widget_show_values"<?php if( !$hiden_value ) echo ' style="display: none;"'; ?>><?php _e( 'Show value', 'BeRocket_AJAX_domain' ) ?><span class="show_button"></span></li>
35
  <?php endif; ?>
templates/select.php CHANGED
@@ -1,7 +1,7 @@
1
  <li>
2
  <span>
3
  <select class="<?php echo @ $uo['class']['selectbox'] ?> <?php echo $terms[0]->taxonomy?>" data-taxonomy='<?php echo $terms[0]->taxonomy ?>'>
4
- <option data-taxonomy='<?php echo $terms[0]->taxonomy ?>' value=''>Any</option>
5
  <?php foreach( $terms as $term ): ?>
6
  <option value='<?php echo $term->term_id?>' data-term_id='<?php echo $term->term_id ?>' data-taxonomy='<?php echo $term->taxonomy ?>'
7
  data-operator='<?php echo $operator ?>'
1
  <li>
2
  <span>
3
  <select class="<?php echo @ $uo['class']['selectbox'] ?> <?php echo $terms[0]->taxonomy?>" data-taxonomy='<?php echo $terms[0]->taxonomy ?>'>
4
+ <option data-taxonomy='<?php echo $terms[0]->taxonomy ?>' value=''><?php _e( 'Any', 'BeRocket_AJAX_domain' ) ?></option>
5
  <?php foreach( $terms as $term ): ?>
6
  <option value='<?php echo $term->term_id?>' data-term_id='<?php echo $term->term_id ?>' data-taxonomy='<?php echo $term->taxonomy ?>'
7
  data-operator='<?php echo $operator ?>'
woocommerce-filters.php CHANGED
@@ -3,14 +3,14 @@
3
  * Plugin Name: Advanced AJAX Product Filters for WooCommerce
4
  * Plugin URI: http://berocket.com/wp-plugins/product-filters
5
  * Description: Advanced AJAX Product Filters for WooCommerce
6
- * Version: 1.1.4
7
  * Author: BeRocket
8
  * Author URI: http://berocket.com
9
  * Text Domain: BeRocket_AJAX_domain
10
  * Domain Path: /languages/
11
  */
12
 
13
- define( "BeRocket_AJAX_filters_version", '1.1.4' );
14
  define( "BeRocket_AJAX_domain", 'BeRocket_AJAX_domain' );
15
 
16
  define( "AAPF_TEMPLATE_PATH", plugin_dir_path( __FILE__ ) . "templates/" );
@@ -121,7 +121,7 @@ class BeRocket_AAPF {
121
 
122
  if ( ! $a['attribute'] || ! $a['type'] ) return false;
123
 
124
- the_widget( 'br_filters', $a);
125
  }
126
 
127
  public static function br_render_form() {
3
  * Plugin Name: Advanced AJAX Product Filters for WooCommerce
4
  * Plugin URI: http://berocket.com/wp-plugins/product-filters
5
  * Description: Advanced AJAX Product Filters for WooCommerce
6
+ * Version: 1.1.5
7
  * Author: BeRocket
8
  * Author URI: http://berocket.com
9
  * Text Domain: BeRocket_AJAX_domain
10
  * Domain Path: /languages/
11
  */
12
 
13
+ define( "BeRocket_AJAX_filters_version", '1.1.5' );
14
  define( "BeRocket_AJAX_domain", 'BeRocket_AJAX_domain' );
15
 
16
  define( "AAPF_TEMPLATE_PATH", plugin_dir_path( __FILE__ ) . "templates/" );
121
 
122
  if ( ! $a['attribute'] || ! $a['type'] ) return false;
123
 
124
+ the_widget( 'BeRocket_AAPF_widget', $a);
125
  }
126
 
127
  public static function br_render_form() {