Advanced Woo Search - Version 1.34

Version Description

  • Add arrows navigation for search results
  • Fix bug with php 7+ vesion
Download this release

Release Info

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

Code changes from version 1.33 to 1.34

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: 1.33
7
  Author: ILLID
8
  Author URI: https://advanced-woo-search.com/
9
  Text Domain: aws
10
  WC requires at least: 3.0.0
11
- WC tested up to: 3.2.2
12
  */
13
 
14
 
@@ -16,7 +16,7 @@ if ( ! defined( 'ABSPATH' ) ) {
16
  exit;
17
  }
18
 
19
- define( 'AWS_VERSION', '1.33' );
20
 
21
 
22
  define( 'AWS_DIR', dirname( __FILE__ ) );
3
  /*
4
  Plugin Name: Advanced Woo Search
5
  Description: Advance ajax WooCommerce product search.
6
+ Version: 1.34
7
  Author: ILLID
8
  Author URI: https://advanced-woo-search.com/
9
  Text Domain: aws
10
  WC requires at least: 3.0.0
11
+ WC tested up to: 3.3.0
12
  */
13
 
14
 
16
  exit;
17
  }
18
 
19
+ define( 'AWS_VERSION', '1.34' );
20
 
21
 
22
  define( 'AWS_DIR', dirname( __FILE__ ) );
assets/css/common.css CHANGED
@@ -26,7 +26,7 @@
26
  z-index: 999;
27
  }
28
 
29
- .aws-container .aws-search-form.processing:after {
30
  display: block;
31
  }
32
 
@@ -96,7 +96,10 @@
96
  text-decoration: none;
97
  border: 0;
98
  }
99
- .aws-search-result .aws_result_link:hover {
 
 
 
100
  background: #f5f5f5;
101
  }
102
 
26
  z-index: 999;
27
  }
28
 
29
+ .aws-container .aws-search-form.aws-processing:after {
30
  display: block;
31
  }
32
 
96
  text-decoration: none;
97
  border: 0;
98
  }
99
+
100
+
101
+ .aws-search-result .aws_result_item:hover,
102
+ .aws-search-result .aws_result_item.hovered {
103
  background: #f5f5f5;
104
  }
105
 
assets/js/common.js CHANGED
@@ -201,11 +201,11 @@
201
  },
202
 
203
  showLoader: function() {
204
- $searchForm.addClass('processing');
205
  },
206
 
207
  hideLoader: function() {
208
- $searchForm.removeClass('processing');
209
  },
210
 
211
  onFocus: function( event ) {
@@ -220,6 +220,14 @@
220
  }
221
  },
222
 
 
 
 
 
 
 
 
 
223
  resultLayout: function () {
224
  var offset = self.offset();
225
 
@@ -293,7 +301,9 @@
293
 
294
 
295
  $searchField.on( 'keyup', function(e) {
296
- methods.onKeyup(e);
 
 
297
  });
298
 
299
 
@@ -325,6 +335,66 @@
325
  }
326
  });
327
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
328
  };
329
 
330
 
201
  },
202
 
203
  showLoader: function() {
204
+ $searchForm.addClass('aws-processing');
205
  },
206
 
207
  hideLoader: function() {
208
+ $searchForm.removeClass('aws-processing');
209
  },
210
 
211
  onFocus: function( event ) {
220
  }
221
  },
222
 
223
+ isResultsVisible:function() {
224
+ return $(d.resultBlock).is(":visible");
225
+ },
226
+
227
+ removeHovered: function() {
228
+ $( d.resultBlock ).find('.aws_result_item').removeClass('hovered');
229
+ },
230
+
231
  resultLayout: function () {
232
  var offset = self.offset();
233
 
301
 
302
 
303
  $searchField.on( 'keyup', function(e) {
304
+ if ( e.keyCode != 40 && e.keyCode != 38 ) {
305
+ methods.onKeyup(e);
306
+ }
307
  });
308
 
309
 
335
  }
336
  });
337
 
338
+
339
+ $( d.resultBlock ).on( 'mouseenter', '.aws_result_item', function() {
340
+ methods.removeHovered();
341
+ $(this).addClass('hovered');
342
+ });
343
+
344
+
345
+ $( d.resultBlock ).on( 'mouseleave', '.aws_result_item', function() {
346
+ methods.removeHovered();
347
+ });
348
+
349
+
350
+ $(window).on( 'keydown', function(e) {
351
+
352
+ if ( e.keyCode == 40 || e.keyCode == 38 ) {
353
+ if ( methods.isResultsVisible() ) {
354
+
355
+ e.stopPropagation();
356
+ e.preventDefault();
357
+
358
+ var $item = $( d.resultBlock ).find('.aws_result_item');
359
+ var $hoveredItem = $( d.resultBlock ).find('.aws_result_item.hovered');
360
+ var $itemsList = $( d.resultBlock ).find('ul');
361
+
362
+ if ( e.keyCode == 40 ) {
363
+
364
+ if ( $hoveredItem.length > 0 ) {
365
+ methods.removeHovered();
366
+ $hoveredItem.next().addClass('hovered');
367
+ } else {
368
+ $item.first().addClass('hovered');
369
+ }
370
+
371
+ }
372
+
373
+ if ( e.keyCode == 38 ) {
374
+
375
+ if ( $hoveredItem.length > 0 ) {
376
+ methods.removeHovered();
377
+ $hoveredItem.prev().addClass('hovered');
378
+ } else {
379
+ $item.last().addClass('hovered');
380
+ }
381
+
382
+ }
383
+
384
+ var scrolledTop = $itemsList.scrollTop();
385
+ var position = $( d.resultBlock ).find('.aws_result_item.hovered').position();
386
+
387
+ if ( position ) {
388
+ $itemsList.scrollTop( position.top + scrolledTop )
389
+ }
390
+
391
+
392
+ }
393
+ }
394
+
395
+ });
396
+
397
+
398
  };
399
 
400
 
includes/class-aws-table.php CHANGED
@@ -80,7 +80,7 @@ if ( ! class_exists( 'AWS_Table' ) ) :
80
  }
81
 
82
  $index_meta = apply_filters( 'aws_index_meta', $index_meta );
83
- $posts_per_page = apply_filters( 'aws_index_posts_per_page', 10 );
84
 
85
 
86
  $args = array(
80
  }
81
 
82
  $index_meta = apply_filters( 'aws_index_meta', $index_meta );
83
+ $posts_per_page = apply_filters( 'aws_index_posts_per_page', 30 );
84
 
85
 
86
  $args = array(
includes/widget.php CHANGED
@@ -3,8 +3,11 @@
3
  * Initialized plugins widget
4
  */
5
 
6
- add_action( 'widgets_init', create_function( '', 'return register_widget("AWS_Widget");' ) );
7
-
 
 
 
8
 
9
  class AWS_Widget extends WP_Widget {
10
 
3
  * Initialized plugins widget
4
  */
5
 
6
+ add_action( 'widgets_init', 'aws_register_widget' );
7
+
8
+ function aws_register_widget() {
9
+ register_widget("AWS_Widget");
10
+ }
11
 
12
  class AWS_Widget extends WP_Widget {
13
 
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.2
7
- Stable tag: 1.33
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
@@ -75,6 +75,10 @@ Yep. This plugin is always compatible with the latest version of Woocommerce?
75
 
76
  == Changelog ==
77
 
 
 
 
 
78
  = 1.33 =
79
  * Fix re-index bug
80
  * Fix bug with search page
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.2
7
+ Stable tag: 1.34
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
75
 
76
  == Changelog ==
77
 
78
+ = 1.34 =
79
+ * Add arrows navigation for search results
80
+ * Fix bug with php 7+ vesion
81
+
82
  = 1.33 =
83
  * Fix re-index bug
84
  * Fix bug with search page