Advanced Woo Search - Version 2.63

Version Description

( 2022-09-19 ) = * Add - Archive pages number option * Update - Tested with WC 6.9 * Fix - SQL query for language selection

Download this release

Release Info

Developer Mihail Barinov
Plugin Icon 128x128 Advanced Woo Search
Version 2.63
Comparing to
See all releases

Code changes from version 2.62 to 2.63

advanced-woo-search.php CHANGED
@@ -3,12 +3,12 @@
3
  /*
4
  Plugin Name: Advanced Woo Search
5
  Description: Advance ajax WooCommerce product search.
6
- Version: 2.62
7
  Author: ILLID
8
  Author URI: https://advanced-woo-search.com/
9
  Text Domain: advanced-woo-search
10
  WC requires at least: 3.0.0
11
- WC tested up to: 6.8.0
12
  */
13
 
14
 
@@ -96,7 +96,7 @@ final class AWS_Main {
96
  */
97
  private function define_constants() {
98
 
99
- $this->define( 'AWS_VERSION', '2.62' );
100
 
101
  $this->define( 'AWS_DIR', plugin_dir_path( AWS_FILE ) );
102
  $this->define( 'AWS_URL', plugin_dir_url( AWS_FILE ) );
3
  /*
4
  Plugin Name: Advanced Woo Search
5
  Description: Advance ajax WooCommerce product search.
6
+ Version: 2.63
7
  Author: ILLID
8
  Author URI: https://advanced-woo-search.com/
9
  Text Domain: advanced-woo-search
10
  WC requires at least: 3.0.0
11
+ WC tested up to: 6.9.0
12
  */
13
 
14
 
96
  */
97
  private function define_constants() {
98
 
99
+ $this->define( 'AWS_VERSION', '2.63' );
100
 
101
  $this->define( 'AWS_DIR', plugin_dir_path( AWS_FILE ) );
102
  $this->define( 'AWS_URL', plugin_dir_url( AWS_FILE ) );
includes/admin/class-aws-admin-options.php CHANGED
@@ -586,13 +586,21 @@ if ( ! class_exists( 'AWS_Admin_Options' ) ) :
586
  );
587
 
588
  $options['results'][] = array(
589
- "name" => __( "Max number of results", "advanced-woo-search" ),
590
- "desc" => __( "Maximum number of displayed search results.", "advanced-woo-search" ),
591
  "id" => "results_num",
592
  "value" => 10,
593
  "type" => "number"
594
  );
595
 
 
 
 
 
 
 
 
 
596
  $options['results'][] = array(
597
  "name" => __( "Show out-of-stock", "advanced-woo-search" ),
598
  "desc" => __( "Show out-of-stock products in search", "advanced-woo-search" ),
586
  );
587
 
588
  $options['results'][] = array(
589
+ "name" => __( "Products number", "advanced-woo-search" ),
590
+ "desc" => __( "Maximum number of displayed products search results.", "advanced-woo-search" ),
591
  "id" => "results_num",
592
  "value" => 10,
593
  "type" => "number"
594
  );
595
 
596
+ $options['results'][] = array(
597
+ "name" => __( "Archive pages number", "advanced-woo-search" ),
598
+ "desc" => __( "Maximum number of displayed archive pages search results.", "advanced-woo-search" ),
599
+ "id" => "pages_results_num",
600
+ "value" => 10,
601
+ "type" => "number"
602
+ );
603
+
604
  $options['results'][] = array(
605
  "name" => __( "Show out-of-stock", "advanced-woo-search" ),
606
  "desc" => __( "Show out-of-stock products in search", "advanced-woo-search" ),
includes/class-aws-search.php CHANGED
@@ -127,13 +127,14 @@ if ( ! class_exists( 'AWS_Search' ) ) :
127
  }
128
  }
129
 
130
- $search_archives = AWS()->get_settings( 'search_archives' );
131
- $show_cats = ( isset( $search_archives['archive_category'] ) && $search_archives['archive_category'] ) ? 'true' : 'false';
132
- $show_tags = ( isset( $search_archives['archive_tag'] ) && $search_archives['archive_tag'] ) ? 'true' : 'false';
133
- $results_num = $keyword ? apply_filters( 'aws_page_results', 100 ) : AWS()->get_settings( 'results_num' );
134
- $search_in = AWS()->get_settings( 'search_in' );
135
- $outofstock = AWS()->get_settings( 'outofstock' );
136
- $search_rule = AWS()->get_settings( 'search_rule' );
 
137
 
138
  $search_in_arr = array();
139
 
@@ -153,6 +154,7 @@ if ( ! class_exists( 'AWS_Search' ) ) :
153
 
154
  $this->data['s'] = $s;
155
  $this->data['results_num'] = $results_num ? $results_num : 10;
 
156
  $this->data['search_terms'] = array();
157
  $this->data['search_in'] = $search_in_arr;
158
  $this->data['outofstock'] = $outofstock;
@@ -440,7 +442,7 @@ if ( ! class_exists( 'AWS_Search' ) ) :
440
  $current_lang = apply_filters( 'aws_search_current_lang', $current_lang );
441
 
442
  if ( $current_lang && $reindex_version && version_compare( $reindex_version, '1.20', '>=' ) ) {
443
- $query['lang'] = $wpdb->prepare( " AND ( lang LIKE %s OR lang = '' )", '%' . $wpdb->esc_like( $current_lang ) . '%' );
444
  }
445
 
446
  /**
127
  }
128
  }
129
 
130
+ $search_archives = AWS()->get_settings( 'search_archives' );
131
+ $show_cats = ( isset( $search_archives['archive_category'] ) && $search_archives['archive_category'] ) ? 'true' : 'false';
132
+ $show_tags = ( isset( $search_archives['archive_tag'] ) && $search_archives['archive_tag'] ) ? 'true' : 'false';
133
+ $results_num = $keyword ? apply_filters( 'aws_page_results', 100 ) : AWS()->get_settings( 'results_num' );
134
+ $pages_results_num = AWS()->get_settings( 'pages_results_num' );
135
+ $search_in = AWS()->get_settings( 'search_in' );
136
+ $outofstock = AWS()->get_settings( 'outofstock' );
137
+ $search_rule = AWS()->get_settings( 'search_rule' );
138
 
139
  $search_in_arr = array();
140
 
154
 
155
  $this->data['s'] = $s;
156
  $this->data['results_num'] = $results_num ? $results_num : 10;
157
+ $this->data['pages_results_num'] = $pages_results_num;
158
  $this->data['search_terms'] = array();
159
  $this->data['search_in'] = $search_in_arr;
160
  $this->data['outofstock'] = $outofstock;
442
  $current_lang = apply_filters( 'aws_search_current_lang', $current_lang );
443
 
444
  if ( $current_lang && $reindex_version && version_compare( $reindex_version, '1.20', '>=' ) ) {
445
+ $query['lang'] = $wpdb->prepare( " AND ( lang = '%s' OR lang = '' )", $current_lang );
446
  }
447
 
448
  /**
includes/class-aws-tax-search.php CHANGED
@@ -31,6 +31,11 @@ if ( ! class_exists( 'AWS_Tax_Search' ) ) :
31
  */
32
  private $search_terms;
33
 
 
 
 
 
 
34
  /*
35
  * Constructor
36
  */
@@ -48,6 +53,7 @@ if ( ! class_exists( 'AWS_Tax_Search' ) ) :
48
  $this->search_string = isset( $data['s'] ) ? $data['s'] : '';
49
  $this->search_string_unfiltered = isset( $data['s_nonormalize'] ) ? $data['s_nonormalize'] : $this->search_string ;
50
  $this->search_terms = isset( $data['search_terms'] ) ? $data['search_terms'] : array();
 
51
 
52
  }
53
 
@@ -105,7 +111,7 @@ if ( ! class_exists( 'AWS_Tax_Search' ) ) :
105
  * @since 1.73
106
  * @param int
107
  */
108
- $terms_number = apply_filters( 'aws_search_terms_number', 10 );
109
 
110
  $excludes_array = $this->get_excluded_terms();
111
  if ( $excludes_array && ! empty( $excludes_array ) ) {
31
  */
32
  private $search_terms;
33
 
34
+ /**
35
+ * @var AWS_Tax_Search Number of search results $results_num
36
+ */
37
+ private $results_num = 10;
38
+
39
  /*
40
  * Constructor
41
  */
53
  $this->search_string = isset( $data['s'] ) ? $data['s'] : '';
54
  $this->search_string_unfiltered = isset( $data['s_nonormalize'] ) ? $data['s_nonormalize'] : $this->search_string ;
55
  $this->search_terms = isset( $data['search_terms'] ) ? $data['search_terms'] : array();
56
+ $this->results_num = isset( $data['pages_results_num'] ) ? $data['pages_results_num'] : 10;
57
 
58
  }
59
 
111
  * @since 1.73
112
  * @param int
113
  */
114
+ $terms_number = apply_filters( 'aws_search_terms_number', $this->results_num );
115
 
116
  $excludes_array = $this->get_excluded_terms();
117
  if ( $excludes_array && ! empty( $excludes_array ) ) {
includes/class-aws-versions.php CHANGED
@@ -418,6 +418,19 @@ if ( ! class_exists( 'AWS_Versions' ) ) :
418
 
419
  }
420
 
 
 
 
 
 
 
 
 
 
 
 
 
 
421
  }
422
 
423
  update_option( 'aws_plugin_ver', AWS_VERSION );
418
 
419
  }
420
 
421
+ if ( version_compare( $current_version, '2.63', '<' ) ) {
422
+
423
+ $settings = get_option( 'aws_settings' );
424
+
425
+ if ( $settings ) {
426
+ if ( ! isset( $settings['pages_results_num'] ) ) {
427
+ $settings['pages_results_num'] = 10;
428
+ update_option( 'aws_settings', $settings );
429
+ }
430
+ }
431
+
432
+ }
433
+
434
  }
435
 
436
  update_option( 'aws_plugin_ver', AWS_VERSION );
languages/advanced-woo-search.pot CHANGED
@@ -814,4 +814,16 @@ msgid "View Pricing"
814
  msgstr ""
815
 
816
  msgid "Dismiss"
 
 
 
 
 
 
 
 
 
 
 
 
817
  msgstr ""
814
  msgstr ""
815
 
816
  msgid "Dismiss"
817
+ msgstr ""
818
+
819
+ msgid "Products number"
820
+ msgstr ""
821
+
822
+ msgid "Maximum number of displayed products search results."
823
+ msgstr ""
824
+
825
+ msgid "Archive pages number"
826
+ msgstr ""
827
+
828
+ msgid "Maximum number of displayed archive pages search results."
829
  msgstr ""
readme.txt CHANGED
@@ -4,7 +4,7 @@ Donate link: https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_i
4
  Tags: widget, plugin, woocommerce, search, product search, woocommerce search, ajax search, live search, custom search, ajax, shortcode, better search, relevance search, relevant search, search by sku, search plugin, shop, store, wordpress search, wp ajax search, wp search, wp search plugin, sidebar, ecommerce, merketing, products, category search, instant-search, search highlight, woocommerce advanced search, woocommerce live search, WooCommerce Plugin, woocommerce product search
5
  Requires at least: 4.0
6
  Tested up to: 6.0
7
- Stable tag: 2.62
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
@@ -168,6 +168,11 @@ Yep. This plugin is always compatible with the latest version of Woocommerce?
168
 
169
  == Changelog ==
170
 
 
 
 
 
 
171
  = 2.62 ( 2022-09-05 ) =
172
  * Dev - Add aws_create_cache_table action
173
 
4
  Tags: widget, plugin, woocommerce, search, product search, woocommerce search, ajax search, live search, custom search, ajax, shortcode, better search, relevance search, relevant search, search by sku, search plugin, shop, store, wordpress search, wp ajax search, wp search, wp search plugin, sidebar, ecommerce, merketing, products, category search, instant-search, search highlight, woocommerce advanced search, woocommerce live search, WooCommerce Plugin, woocommerce product search
5
  Requires at least: 4.0
6
  Tested up to: 6.0
7
+ Stable tag: 2.63
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
168
 
169
  == Changelog ==
170
 
171
+ = 2.63 ( 2022-09-19 ) =
172
+ * Add - Archive pages number option
173
+ * Update - Tested with WC 6.9
174
+ * Fix - SQL query for language selection
175
+
176
  = 2.62 ( 2022-09-05 ) =
177
  * Dev - Add aws_create_cache_table action
178