Advanced Woo Search - Version 1.21

Version Description

  • Fix search page switching to degault language
Download this release

Release Info

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

Code changes from version 1.20 to 1.21

advanced-woo-search.php CHANGED
@@ -3,8 +3,9 @@
3
  /*
4
  Plugin Name: Advanced Woo Search
5
  Description: Advance ajax WooCommerce product search.
6
- Version: 1.20
7
  Author: ILLID
 
8
  Text Domain: aws
9
  */
10
 
@@ -13,7 +14,7 @@ if ( ! defined( 'ABSPATH' ) ) {
13
  exit;
14
  }
15
 
16
- define( 'AWS_VERSION', '1.20' );
17
 
18
 
19
  define( 'AWS_DIR', dirname( __FILE__ ) );
3
  /*
4
  Plugin Name: Advanced Woo Search
5
  Description: Advance ajax WooCommerce product search.
6
+ Version: 1.21
7
  Author: ILLID
8
+ Author URI: https://advanced-woo-search.com/
9
  Text Domain: aws
10
  */
11
 
14
  exit;
15
  }
16
 
17
+ define( 'AWS_VERSION', '1.21' );
18
 
19
 
20
  define( 'AWS_DIR', dirname( __FILE__ ) );
assets/js/common.js CHANGED
@@ -269,6 +269,7 @@
269
  self.data( pluginPfx, {
270
  minChars : ( self.data('min-chars') !== undefined ) ? self.data('min-chars') : 1,
271
  showLoader: ( self.data('show-loader') !== undefined ) ? self.data('show-loader') : true,
 
272
  useAnalytics: ( self.data('use-analytics') !== undefined ) ? self.data('use-analytics') : false,
273
  instance: instance,
274
  resultBlock: '#aws-search-result-' + instance
@@ -294,6 +295,13 @@
294
  });
295
 
296
 
 
 
 
 
 
 
 
297
  $(document).on( 'click', function (e) {
298
  methods.hideResults(e);
299
  });
269
  self.data( pluginPfx, {
270
  minChars : ( self.data('min-chars') !== undefined ) ? self.data('min-chars') : 1,
271
  showLoader: ( self.data('show-loader') !== undefined ) ? self.data('show-loader') : true,
272
+ showPage: ( self.data('show-page') !== undefined ) ? self.data('show-page') : true,
273
  useAnalytics: ( self.data('use-analytics') !== undefined ) ? self.data('use-analytics') : false,
274
  instance: instance,
275
  resultBlock: '#aws-search-result-' + instance
295
  });
296
 
297
 
298
+ $searchForm.on( 'keypress', function(e) {
299
+ if ( e.keyCode == 13 && ! d.showPage ) {
300
+ e.preventDefault();
301
+ }
302
+ });
303
+
304
+
305
  $(document).on( 'click', function (e) {
306
  methods.hideResults(e);
307
  });
includes/class-aws-markup.php CHANGED
@@ -29,14 +29,24 @@ if ( ! class_exists( 'AWS_Markup' ) ) :
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
  $use_analytics = AWS()->get_settings( 'use_analytics' );
33
 
 
 
 
 
 
 
 
 
34
  $params_string = '';
35
 
36
  $params = array(
37
  'data-url' => admin_url('admin-ajax.php'),
38
  'data-siteurl' => home_url(),
39
  'data-show-loader' => $show_loader,
 
40
  'data-use-analytics' => $use_analytics,
41
  'data-min-chars' => $min_chars,
42
  );
@@ -51,6 +61,13 @@ if ( ! class_exists( 'AWS_Markup' ) ) :
51
  $markup .= '<input type="text" name="s" value="' . get_search_query() . '" class="aws-search-field" placeholder="' . $placeholder . '" autocomplete="off" />';
52
  $markup .= '<input type="hidden" name="post_type" value="product">';
53
  $markup .= '<input type="hidden" name="type_aws" value="true">';
 
 
 
 
 
 
 
54
  $markup .= '<div class="aws-search-result" style="display: none;"></div>';
55
  $markup .= '</form>';
56
  $markup .= '</div>';
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_page = AWS()->get_settings( 'show_page' );
33
  $use_analytics = AWS()->get_settings( 'use_analytics' );
34
 
35
+ $url_array = parse_url( home_url() );
36
+ $url_query_parts = array();
37
+
38
+ if ( isset( $url_array['query'] ) && $url_array['query'] ) {
39
+ parse_str( $url_array['query'], $url_query_parts );
40
+ }
41
+
42
+
43
  $params_string = '';
44
 
45
  $params = array(
46
  'data-url' => admin_url('admin-ajax.php'),
47
  'data-siteurl' => home_url(),
48
  'data-show-loader' => $show_loader,
49
+ 'data-show-page' => $show_page,
50
  'data-use-analytics' => $use_analytics,
51
  'data-min-chars' => $min_chars,
52
  );
61
  $markup .= '<input type="text" name="s" value="' . get_search_query() . '" class="aws-search-field" placeholder="' . $placeholder . '" autocomplete="off" />';
62
  $markup .= '<input type="hidden" name="post_type" value="product">';
63
  $markup .= '<input type="hidden" name="type_aws" value="true">';
64
+
65
+ if ( $url_query_parts ) {
66
+ foreach( $url_query_parts as $url_query_key => $url_query_value ) {
67
+ $markup .= '<input type="hidden" name="' . $url_query_key . '" value="' . $url_query_value . '">';
68
+ }
69
+ }
70
+
71
  $markup .= '<div class="aws-search-result" style="display: none;"></div>';
72
  $markup .= '</form>';
73
  $markup .= '</div>';
includes/class-aws-versions.php CHANGED
@@ -79,6 +79,19 @@ if ( ! class_exists( 'AWS_Versions' ) ) :
79
 
80
  }
81
 
 
 
 
 
 
 
 
 
 
 
 
 
 
82
  }
83
 
84
  update_option( 'aws_plugin_ver', AWS_VERSION );
79
 
80
  }
81
 
82
+ if ( version_compare( $current_version, '1.21', '<' ) ) {
83
+
84
+ $settings = get_option( 'aws_settings' );
85
+
86
+ if ( $settings ) {
87
+ if ( ! isset( $settings['show_page'] ) ) {
88
+ $settings['show_page'] = 'false';
89
+ update_option( 'aws_settings', $settings );
90
+ }
91
+ }
92
+
93
+ }
94
+
95
  }
96
 
97
  update_option( 'aws_plugin_ver', AWS_VERSION );
includes/options.php CHANGED
@@ -87,6 +87,17 @@ $options['form'][] = array(
87
  )
88
  );
89
 
 
 
 
 
 
 
 
 
 
 
 
90
 
91
  // Search Results Settings
92
 
87
  )
88
  );
89
 
90
+ $options['form'][] = array(
91
+ "name" => __( "Search Results Page", "aws" ),
92
+ "desc" => __( "Go to search results page when user clicks 'Enter' key on search form?", "aws" ),
93
+ "id" => "show_page",
94
+ "value" => 'false',
95
+ "type" => "radio",
96
+ 'choices' => array(
97
+ 'true' => __( 'On', 'aws' ),
98
+ 'false' => __( 'Off', 'aws' )
99
+ )
100
+ );
101
 
102
  // Search Results Settings
103
 
languages/aws.pot CHANGED
@@ -175,6 +175,12 @@ msgstr ""
175
  msgid "Show loader animation while searching."
176
  msgstr ""
177
 
 
 
 
 
 
 
178
  #: includes/options.php:49
179
  msgid "Show image"
180
  msgstr ""
175
  msgid "Show loader animation while searching."
176
  msgstr ""
177
 
178
+ msgid "Search Results Page"
179
+ msgstr ""
180
+
181
+ msgid "Go to search results page when user clicks 'Enter' key on search form?"
182
+ msgstr ""
183
+
184
  #: includes/options.php:49
185
  msgid "Show image"
186
  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.8
7
- Stable tag: 1.20
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
@@ -74,6 +74,9 @@ Yep. This plugin is always compatible with the latest version of Woocommerce?
74
 
75
  == Changelog ==
76
 
 
 
 
77
  = 1.20 =
78
  * Add WPML, WooCommerce Multilingual support
79
 
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.8
7
+ Stable tag: 1.21
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
74
 
75
  == Changelog ==
76
 
77
+ = 1.21 =
78
+ * Fix search page switching to degault language
79
+
80
  = 1.20 =
81
  * Add WPML, WooCommerce Multilingual support
82