Advanced Woo Search - Version 2.05

Version Description

  • Add - Support for Perfect Brands for WooCommerce plugin
  • Update - Show ajax block in top if no space at bottom
  • Update - Taxonomies search
  • Dev - Add aws_results_html js filter
Download this release

Release Info

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

Code changes from version 2.04 to 2.05

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: 2.04
7
  Author: ILLID
8
  Author URI: https://advanced-woo-search.com/
9
  Text Domain: advanced-woo-search
@@ -16,7 +16,7 @@ if ( ! defined( 'ABSPATH' ) ) {
16
  exit;
17
  }
18
 
19
- define( 'AWS_VERSION', '2.04' );
20
 
21
 
22
  define( 'AWS_DIR', dirname( __FILE__ ) );
3
  /*
4
  Plugin Name: Advanced Woo Search
5
  Description: Advance ajax WooCommerce product search.
6
+ Version: 2.05
7
  Author: ILLID
8
  Author URI: https://advanced-woo-search.com/
9
  Text Domain: advanced-woo-search
16
  exit;
17
  }
18
 
19
+ define( 'AWS_VERSION', '2.05' );
20
 
21
 
22
  define( 'AWS_DIR', dirname( __FILE__ ) );
assets/js/common.js CHANGED
@@ -1,3 +1,7 @@
 
 
 
 
1
  (function($){
2
  "use strict";
3
 
@@ -11,6 +15,42 @@
11
  noresults : aws_vars.noresults
12
  };
13
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
14
  $.fn.aws_search = function( options ) {
15
 
16
  var methods = {
@@ -214,6 +254,10 @@
214
 
215
  html += '</ul>';
216
 
 
 
 
 
217
  methods.hideLoader();
218
 
219
  $(d.resultBlock).html( html );
@@ -276,9 +320,13 @@
276
  },
277
 
278
  resultLayout: function () {
 
 
279
  var offset = self.offset();
280
  var bodyOffset = $('body').offset();
281
  var bodyPosition = $('body').css('position');
 
 
282
 
283
  if ( offset && bodyOffset ) {
284
 
@@ -294,7 +342,14 @@
294
  left = offset.left;
295
  }
296
 
297
- $( d.resultBlock ).css({
 
 
 
 
 
 
 
298
  width : width,
299
  top : top,
300
  left: left
@@ -304,6 +359,26 @@
304
 
305
  },
306
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
307
  showMobileLayout: function() {
308
  if ( ! methods.isFixed() ) {
309
  self.after('<div class="aws-placement-container"></div>');
1
+ // Hooks
2
+ var AwsHooks = AwsHooks || {};
3
+ AwsHooks.filters = AwsHooks.filters || {};
4
+
5
  (function($){
6
  "use strict";
7
 
15
  noresults : aws_vars.noresults
16
  };
17
 
18
+ AwsHooks.add_filter = function( tag, callback, priority ) {
19
+
20
+ if( typeof priority === "undefined" ) {
21
+ priority = 10;
22
+ }
23
+
24
+ AwsHooks.filters[ tag ] = AwsHooks.filters[ tag ] || [];
25
+ AwsHooks.filters[ tag ].push( { priority: priority, callback: callback } );
26
+
27
+ };
28
+
29
+ AwsHooks.apply_filters = function( tag, value, options ) {
30
+
31
+ var filters = [];
32
+
33
+ if( typeof AwsHooks.filters[ tag ] !== "undefined" && AwsHooks.filters[ tag ].length > 0 ) {
34
+
35
+ AwsHooks.filters[ tag ].forEach( function( hook ) {
36
+
37
+ filters[ hook.priority ] = filters[ hook.priority ] || [];
38
+ filters[ hook.priority ].push( hook.callback );
39
+ } );
40
+
41
+ filters.forEach( function( AwsHooks ) {
42
+
43
+ AwsHooks.forEach( function( callback ) {
44
+ value = callback( value, options );
45
+ } );
46
+
47
+ } );
48
+ }
49
+
50
+ return value;
51
+
52
+ };
53
+
54
  $.fn.aws_search = function( options ) {
55
 
56
  var methods = {
254
 
255
  html += '</ul>';
256
 
257
+ // @since 2.05
258
+ html = AwsHooks.apply_filters( 'aws_results_html', html, { response: response, data: d } );
259
+
260
+
261
  methods.hideLoader();
262
 
263
  $(d.resultBlock).html( html );
320
  },
321
 
322
  resultLayout: function () {
323
+
324
+ var $resultsBlock = $( d.resultBlock );
325
  var offset = self.offset();
326
  var bodyOffset = $('body').offset();
327
  var bodyPosition = $('body').css('position');
328
+ var bodyHeight = $('body').height();
329
+ var resultsHeight = $resultsBlock.height();
330
 
331
  if ( offset && bodyOffset ) {
332
 
342
  left = offset.left;
343
  }
344
 
345
+ if ( bodyHeight - offset.top < 500 ) {
346
+ resultsHeight = methods.getResultsBlockHeight();
347
+ if ( bodyHeight - offset.top < resultsHeight ) {
348
+ top = top - resultsHeight - $(self).innerHeight();
349
+ }
350
+ }
351
+
352
+ $resultsBlock.css({
353
  width : width,
354
  top : top,
355
  left: left
359
 
360
  },
361
 
362
+ getResultsBlockHeight: function() {
363
+
364
+ var $resultsBlock = $( d.resultBlock );
365
+ var resultsHeight = $resultsBlock.height();
366
+
367
+ if ( resultsHeight === 0 ) {
368
+ var copied_elem = $resultsBlock.clone()
369
+ .attr("id", false)
370
+ .css({visibility:"hidden", display:"block",
371
+ position:"absolute"});
372
+ $("body").append(copied_elem);
373
+ //copied_elem.find('.mCSB_outside').attr('style', '');
374
+ resultsHeight = copied_elem.height();
375
+ copied_elem.remove();
376
+ }
377
+
378
+ return resultsHeight;
379
+
380
+ },
381
+
382
  showMobileLayout: function() {
383
  if ( ! methods.isFixed() ) {
384
  self.after('<div class="aws-placement-container"></div>');
includes/class-aws-tax-search.php CHANGED
@@ -189,6 +189,7 @@ if ( ! class_exists( 'AWS_Tax_Search' ) ) :
189
 
190
  $new_result = array(
191
  'name' => $result->name,
 
192
  'count' => ( $result->count > 0 ) ? $result->count : '',
193
  'link' => $term_link
194
  );
189
 
190
  $new_result = array(
191
  'name' => $result->name,
192
+ 'id' => $result->term_id,
193
  'count' => ( $result->count > 0 ) ? $result->count : '',
194
  'link' => $term_link
195
  );
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: 5.4
7
- Stable tag: 2.04
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
@@ -67,6 +67,12 @@ Additional features available only in PRO plugin version.
67
 
68
  [Features list](https://advanced-woo-search.com/features/?utm_source=wp-repo&utm_medium=listing&utm_campaign=aws-repo)
69
 
 
 
 
 
 
 
70
  == Installation ==
71
 
72
  1. Upload advanced-woo-search to the /wp-content/plugins/ directory
@@ -105,6 +111,12 @@ Yep. This plugin is always compatible with the latest version of Woocommerce?
105
 
106
  == Changelog ==
107
 
 
 
 
 
 
 
108
  = 2.04 =
109
  * Add - Add BeRocket WooCommerce AJAX Products Filter plugin support
110
  * Add - Add WCFM - WooCommerce Multivendor Marketplace plugin support for users search
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: 5.4
7
+ Stable tag: 2.05
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
67
 
68
  [Features list](https://advanced-woo-search.com/features/?utm_source=wp-repo&utm_medium=listing&utm_campaign=aws-repo)
69
 
70
+ = More Plugins From Us =
71
+
72
+ Here are some additional plugins that were made with love.
73
+
74
+ * [Advanced Woo Labels](https://wordpress.org/plugins/advanced-woo-labels/)
75
+
76
  == Installation ==
77
 
78
  1. Upload advanced-woo-search to the /wp-content/plugins/ directory
111
 
112
  == Changelog ==
113
 
114
+ = 2.05 =
115
+ * Add - Support for Perfect Brands for WooCommerce plugin
116
+ * Update - Show ajax block in top if no space at bottom
117
+ * Update - Taxonomies search
118
+ * Dev - Add aws_results_html js filter
119
+
120
  = 2.04 =
121
  * Add - Add BeRocket WooCommerce AJAX Products Filter plugin support
122
  * Add - Add WCFM - WooCommerce Multivendor Marketplace plugin support for users search