Advanced Woo Search - Version 1.43

Version Description

  • Add 'aws_search_results_all' filter
  • Update WPML string translation
  • Fix bug with term_source column in index table
Download this release

Release Info

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

Code changes from version 1.42 to 1.43

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.42
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.42' );
20
 
21
 
22
  define( 'AWS_DIR', dirname( __FILE__ ) );
@@ -143,7 +143,7 @@ final class AWS_Main {
143
  wp_localize_script('aws-script', 'aws_vars', array(
144
  'sale' => __('Sale!', 'aws'),
145
  'showmore' => __('View all results', 'aws'),
146
- 'noresults' => $this->get_settings('not_found_text') ? stripslashes( $this->get_settings('not_found_text') ) : __('Nothing found', 'aws')
147
  ));
148
  }
149
 
3
  /*
4
  Plugin Name: Advanced Woo Search
5
  Description: Advance ajax WooCommerce product search.
6
+ Version: 1.43
7
  Author: ILLID
8
  Author URI: https://advanced-woo-search.com/
9
  Text Domain: aws
16
  exit;
17
  }
18
 
19
+ define( 'AWS_VERSION', '1.43' );
20
 
21
 
22
  define( 'AWS_DIR', dirname( __FILE__ ) );
143
  wp_localize_script('aws-script', 'aws_vars', array(
144
  'sale' => __('Sale!', 'aws'),
145
  'showmore' => __('View all results', 'aws'),
146
+ 'noresults' => $this->get_settings('not_found_text') ? AWS_Helpers::translate( 'not_found_text', stripslashes( $this->get_settings('not_found_text') ) ) : __('Nothing found', 'aws')
147
  ));
148
  }
149
 
includes/class-aws-admin.php CHANGED
@@ -119,6 +119,8 @@ class AWS_Admin {
119
 
120
  update_option( 'aws_settings', $update_settings );
121
 
 
 
122
  do_action( 'aws_settings_saved' );
123
 
124
  do_action( 'aws_cache_clear' );
119
 
120
  update_option( 'aws_settings', $update_settings );
121
 
122
+ AWS_Helpers::register_wpml_translations( $update_settings );
123
+
124
  do_action( 'aws_settings_saved' );
125
 
126
  do_action( 'aws_cache_clear' );
includes/class-aws-helpers.php CHANGED
@@ -206,6 +206,48 @@ if ( ! class_exists( 'AWS_Helpers' ) ) :
206
 
207
  }
208
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
209
  }
210
 
211
  endif;
206
 
207
  }
208
 
209
+ /*
210
+ * Registers the WPML translations
211
+ *
212
+ */
213
+ static public function register_wpml_translations( $params = false ) {
214
+
215
+ // No WPML
216
+ if ( ! function_exists( 'icl_register_string' ) ) {
217
+ return;
218
+ }
219
+
220
+ // These options are registered
221
+ $options_to_reg = array(
222
+ "search_field_text" => "Search",
223
+ "not_found_text" => "Nothing found",
224
+ );
225
+
226
+ if ( ! $params ) {
227
+ $params = $options_to_reg;
228
+ }
229
+
230
+ foreach ( $options_to_reg as $key => $option ) {
231
+ icl_register_string( 'aws', $key, $params[$key] );
232
+ }
233
+
234
+ }
235
+
236
+ /*
237
+ * Wrapper for WPML print
238
+ *
239
+ * @return string Source name
240
+ */
241
+ static public function translate( $name, $value ) {
242
+
243
+ if ( function_exists( 'icl_t' ) ) {
244
+ return icl_t( 'aws', $name, $value );
245
+ }
246
+
247
+ return $value;
248
+
249
+ }
250
+
251
  }
252
 
253
  endif;
includes/class-aws-markup.php CHANGED
@@ -26,7 +26,7 @@ if ( ! class_exists( 'AWS_Markup' ) ) :
26
  }
27
 
28
 
29
- $placeholder = AWS()->get_settings( 'search_field_text' );
30
  $min_chars = AWS()->get_settings( 'min_chars' );
31
  $show_loader = AWS()->get_settings( 'show_loader' );
32
  $show_more = AWS()->get_settings( 'show_more' );
26
  }
27
 
28
 
29
+ $placeholder = AWS_Helpers::translate( 'search_field_text', AWS()->get_settings( 'search_field_text' ) );
30
  $min_chars = AWS()->get_settings( 'min_chars' );
31
  $show_loader = AWS()->get_settings( 'show_loader' );
32
  $show_more = AWS()->get_settings( 'show_more' );
includes/class-aws-search.php CHANGED
@@ -165,6 +165,16 @@ if ( ! class_exists( 'AWS_Search' ) ) :
165
  'products' => $products_array
166
  );
167
 
 
 
 
 
 
 
 
 
 
 
168
  if ( $cache === 'true' && ! $keyword ) {
169
  AWS()->cache->insert_into_cache_table( $cache_option_name, $result_array );
170
  }
165
  'products' => $products_array
166
  );
167
 
168
+ /**
169
+ * Filters array of all results data before they displayed in search results
170
+ *
171
+ * @since 1.43
172
+ *
173
+ * @param array $brands_array Array of products data
174
+ * @param string $s Search query
175
+ */
176
+ $result_array = apply_filters( 'aws_search_results_all', $result_array, $s );
177
+
178
  if ( $cache === 'true' && ! $keyword ) {
179
  AWS()->cache->insert_into_cache_table( $cache_option_name, $result_array );
180
  }
includes/class-aws-table.php CHANGED
@@ -199,7 +199,7 @@ if ( ! class_exists( 'AWS_Table' ) ) :
199
  $sql = "CREATE TABLE {$this->table_name} (
200
  id BIGINT(20) UNSIGNED NOT NULL DEFAULT 0,
201
  term VARCHAR(50) NOT NULL DEFAULT 0,
202
- term_source VARCHAR(20) NOT NULL DEFAULT 0,
203
  type VARCHAR(50) NOT NULL DEFAULT 0,
204
  count BIGINT(20) UNSIGNED NOT NULL DEFAULT 0,
205
  in_stock INT(11) NOT NULL DEFAULT 0,
199
  $sql = "CREATE TABLE {$this->table_name} (
200
  id BIGINT(20) UNSIGNED NOT NULL DEFAULT 0,
201
  term VARCHAR(50) NOT NULL DEFAULT 0,
202
+ term_source VARCHAR(50) NOT NULL DEFAULT 0,
203
  type VARCHAR(50) NOT NULL DEFAULT 0,
204
  count BIGINT(20) UNSIGNED NOT NULL DEFAULT 0,
205
  in_stock INT(11) NOT NULL DEFAULT 0,
includes/class-aws-versions.php CHANGED
@@ -147,6 +147,22 @@ if ( ! class_exists( 'AWS_Versions' ) ) :
147
 
148
  }
149
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
150
  }
151
 
152
  update_option( 'aws_plugin_ver', AWS_VERSION );
147
 
148
  }
149
 
150
+ if ( version_compare( $current_version, '1.43', '<' ) ) {
151
+
152
+ if ( ! AWS_Helpers::is_table_not_exist() ) {
153
+
154
+ global $wpdb;
155
+ $table_name = $wpdb->prefix . AWS_INDEX_TABLE_NAME;
156
+
157
+ $wpdb->query("
158
+ ALTER TABLE {$table_name}
159
+ MODIFY term_source varchar(50);
160
+ ");
161
+
162
+ }
163
+
164
+ }
165
+
166
  }
167
 
168
  update_option( 'aws_plugin_ver', AWS_VERSION );
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.6
7
- Stable tag: 1.42
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
@@ -45,12 +45,15 @@ Advanced Woo Search - powerful live search plugin for WooCommerce. Just start ty
45
  * **Unlimited** amount of search form instances
46
  * Product **attributes** search ( including custom attributes)
47
  * Product **custom taxonomies** search
 
48
  * **Advanced settings page** with lot of options
49
  * **Exclude/include** spicific products by its ids, categories or tags from search results
50
  * Ability to specify **source of image** for search results: featured image, gallery, product content, product short description or set default image if there is no other images
51
  * **Visibility/stock status option** - choose what catalog visibility and stock status must be for product to displayed in search results
52
  * Show product **categories** and **variations** in search results
 
53
  * Support for [WooCommerce Brands plugin](https://woocommerce.com/products/brands/)
 
54
 
55
  [Features list](https://advanced-woo-search.com/features/)
56
 
@@ -87,6 +90,11 @@ Yep. This plugin is always compatible with the latest version of Woocommerce?
87
 
88
  == Changelog ==
89
 
 
 
 
 
 
90
  = 1.42 =
91
  * Add option to display ‘View All Results’ button in the bottom of search results list
92
  * Fix bug with stop words option
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.6
7
+ Stable tag: 1.43
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
45
  * **Unlimited** amount of search form instances
46
  * Product **attributes** search ( including custom attributes)
47
  * Product **custom taxonomies** search
48
+ * Product **custom fields** search
49
  * **Advanced settings page** with lot of options
50
  * **Exclude/include** spicific products by its ids, categories or tags from search results
51
  * Ability to specify **source of image** for search results: featured image, gallery, product content, product short description or set default image if there is no other images
52
  * **Visibility/stock status option** - choose what catalog visibility and stock status must be for product to displayed in search results
53
  * Show product **categories** and **variations** in search results
54
+ * AND or OR search logic
55
  * Support for [WooCommerce Brands plugin](https://woocommerce.com/products/brands/)
56
+ * Support for Advanced Custom Fields plugin
57
 
58
  [Features list](https://advanced-woo-search.com/features/)
59
 
90
 
91
  == Changelog ==
92
 
93
+ = 1.43 =
94
+ * Add 'aws_search_results_all' filter
95
+ * Update WPML string translation
96
+ * Fix bug with term_source column in index table
97
+
98
  = 1.42 =
99
  * Add option to display ‘View All Results’ button in the bottom of search results list
100
  * Fix bug with stop words option