Advanced Woo Search - Version 1.49

Version Description

  • Add option to set text for 'show more' button
  • add aws_search_terms filter
Download this release

Release Info

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

Code changes from version 1.48 to 1.49

advanced-woo-search.php CHANGED
@@ -3,7 +3,7 @@
3
  /*
4
  Plugin Name: Advanced Woo Search
5
  Description: Advance ajax WooCommerce product search.
6
- Version: 1.48
7
  Author: ILLID
8
  Author URI: https://advanced-woo-search.com/
9
  Text Domain: aws
@@ -16,7 +16,7 @@ if ( ! defined( 'ABSPATH' ) ) {
16
  exit;
17
  }
18
 
19
- define( 'AWS_VERSION', '1.48' );
20
 
21
 
22
  define( 'AWS_DIR', dirname( __FILE__ ) );
@@ -150,7 +150,7 @@ final class AWS_Main {
150
  wp_localize_script('aws-script', 'aws_vars', array(
151
  'sale' => __('Sale!', 'aws'),
152
  'sku' => __('SKU', 'aws'),
153
- 'showmore' => __('View all results', 'aws'),
154
  'noresults' => $this->get_settings('not_found_text') ? AWS_Helpers::translate( 'not_found_text', stripslashes( $this->get_settings('not_found_text') ) ) : __('Nothing found', 'aws')
155
  ));
156
  }
3
  /*
4
  Plugin Name: Advanced Woo Search
5
  Description: Advance ajax WooCommerce product search.
6
+ Version: 1.49
7
  Author: ILLID
8
  Author URI: https://advanced-woo-search.com/
9
  Text Domain: aws
16
  exit;
17
  }
18
 
19
+ define( 'AWS_VERSION', '1.49' );
20
 
21
 
22
  define( 'AWS_DIR', dirname( __FILE__ ) );
150
  wp_localize_script('aws-script', 'aws_vars', array(
151
  'sale' => __('Sale!', 'aws'),
152
  'sku' => __('SKU', 'aws'),
153
+ 'showmore' => $this->get_settings('show_more_text') ? AWS_Helpers::translate( 'show_more_text', stripslashes( $this->get_settings('show_more_text') ) ) : __('View all results', 'aws'),
154
  'noresults' => $this->get_settings('not_found_text') ? AWS_Helpers::translate( 'not_found_text', stripslashes( $this->get_settings('not_found_text') ) ) : __('Nothing found', 'aws')
155
  ));
156
  }
includes/class-aws-helpers.php CHANGED
@@ -224,6 +224,7 @@ if ( ! class_exists( 'AWS_Helpers' ) ) :
224
  $options_to_reg = array(
225
  "search_field_text" => "Search",
226
  "not_found_text" => "Nothing found",
 
227
  );
228
 
229
  if ( ! $params ) {
224
  $options_to_reg = array(
225
  "search_field_text" => "Search",
226
  "not_found_text" => "Nothing found",
227
+ "show_more_text" => "View all results",
228
  );
229
 
230
  if ( ! $params ) {
includes/class-aws-search.php CHANGED
@@ -80,6 +80,7 @@ if ( ! class_exists( 'AWS_Search' ) ) :
80
  $s = str_replace( array( "\r", "\n" ), '', $s );
81
  $s = str_replace( $special_chars, '', $s );
82
  $s = trim( $s );
 
83
 
84
  $cache_option_name = '';
85
 
@@ -234,6 +235,16 @@ if ( ! class_exists( 'AWS_Search' ) ) :
234
  $new_relevance_array = array();
235
 
236
 
 
 
 
 
 
 
 
 
 
 
237
  foreach ( $this->data['search_terms'] as $search_term ) {
238
 
239
  $search_term_len = strlen( $search_term );
80
  $s = str_replace( array( "\r", "\n" ), '', $s );
81
  $s = str_replace( $special_chars, '', $s );
82
  $s = trim( $s );
83
+ $s = strtolower( $s );
84
 
85
  $cache_option_name = '';
86
 
235
  $new_relevance_array = array();
236
 
237
 
238
+ /**
239
+ * Filters array of search terms before generating SQL query
240
+ *
241
+ * @since 1.49
242
+ *
243
+ * @param array $this->data['search_terms'] Array of search terms
244
+ */
245
+ $this->data['search_terms'] = apply_filters( 'aws_search_terms', $this->data['search_terms'] );
246
+
247
+
248
  foreach ( $this->data['search_terms'] as $search_term ) {
249
 
250
  $search_term_len = strlen( $search_term );
includes/class-aws-versions.php CHANGED
@@ -189,6 +189,19 @@ if ( ! class_exists( 'AWS_Versions' ) ) :
189
 
190
  }
191
 
 
 
 
 
 
 
 
 
 
 
 
 
 
192
  }
193
 
194
  update_option( 'aws_plugin_ver', AWS_VERSION );
189
 
190
  }
191
 
192
+ if ( version_compare( $current_version, '1.49', '<' ) ) {
193
+
194
+ $settings = get_option( 'aws_settings' );
195
+
196
+ if ( $settings ) {
197
+ if ( ! isset( $settings['show_more_text'] ) ) {
198
+ $settings['show_more_text'] = __('View all results', 'aws');
199
+ update_option( 'aws_settings', $settings );
200
+ }
201
+ }
202
+
203
+ }
204
+
205
  }
206
 
207
  update_option( 'aws_plugin_ver', AWS_VERSION );
includes/options.php CHANGED
@@ -84,6 +84,14 @@ $options['form'][] = array(
84
  "type" => "text"
85
  );
86
 
 
 
 
 
 
 
 
 
87
  $options['form'][] = array(
88
  "name" => __( "Nothing found field", "aws" ),
89
  "desc" => __( "Text when there is no search results. HTML tags is allowed.", "aws" ),
84
  "type" => "text"
85
  );
86
 
87
+ $options['form'][] = array(
88
+ "name" => __( "Text for show more button", "aws" ),
89
+ "desc" => __( "Text for link to search results page at the bottom of search results block.", "aws" ),
90
+ "id" => "show_more_text",
91
+ "value" => __( "View all results", "aws" ),
92
+ "type" => "text"
93
+ );
94
+
95
  $options['form'][] = array(
96
  "name" => __( "Nothing found field", "aws" ),
97
  "desc" => __( "Text when there is no search results. HTML tags is allowed.", "aws" ),
languages/aws.pot CHANGED
@@ -186,6 +186,12 @@ msgstr ""
186
  msgid "Search"
187
  msgstr ""
188
 
 
 
 
 
 
 
189
  #: includes/options.php:40
190
  msgid "Nothing found field"
191
  msgstr ""
186
  msgid "Search"
187
  msgstr ""
188
 
189
+ msgid "Text for show more button"
190
+ msgstr ""
191
+
192
+ msgid "Text for link to search results page at the bottom of search results block."
193
+ msgstr ""
194
+
195
  #: includes/options.php:40
196
  msgid "Nothing found field"
197
  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: 4.9.8
7
- Stable tag: 1.48
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
@@ -96,6 +96,10 @@ Yep. This plugin is always compatible with the latest version of Woocommerce?
96
 
97
  == Changelog ==
98
 
 
 
 
 
99
  = 1.48 =
100
  * Add option to display 'Clear search results' buttom on desktop devices
101
 
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: 4.9.8
7
+ Stable tag: 1.49
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
96
 
97
  == Changelog ==
98
 
99
+ = 1.49 =
100
+ * Add option to set text for 'show more' button
101
+ * add aws_search_terms filter
102
+
103
  = 1.48 =
104
  * Add option to display 'Clear search results' buttom on desktop devices
105