Advanced Woo Search - Version 1.62

Version Description

  • Fix Google Analytics events
  • Fix jQuery errors
  • Add Enfold theme support
  • Add Porto theme support
  • Add aws_indexed_data filter
Download this release

Release Info

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

Code changes from version 1.61 to 1.62

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.61
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.61' );
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.62
7
  Author: ILLID
8
  Author URI: https://advanced-woo-search.com/
9
  Text Domain: aws
16
  exit;
17
  }
18
 
19
+ define( 'AWS_VERSION', '1.62' );
20
 
21
 
22
  define( 'AWS_DIR', dirname( __FILE__ ) );
assets/js/common.js CHANGED
@@ -300,7 +300,15 @@
300
  analytics: function( label ) {
301
  if ( d.useAnalytics ) {
302
  try {
303
- ga('send', 'event', 'AWS search', 'AWS Search Term', label);
 
 
 
 
 
 
 
 
304
  }
305
  catch (error) {
306
  }
@@ -489,12 +497,19 @@
489
 
490
 
491
  // Call plugin method
492
- $(document).ready(function() {
493
 
494
  $(selector).each( function() {
495
  $(this).aws_search();
496
  });
497
 
 
 
 
 
 
 
 
498
  });
499
 
500
 
300
  analytics: function( label ) {
301
  if ( d.useAnalytics ) {
302
  try {
303
+ if ( typeof gtag !== 'undefined' ) {
304
+ gtag('event', 'AWS search', {
305
+ 'event_label': label,
306
+ 'event_category': 'AWS Search Term'
307
+ });
308
+ }
309
+ if ( typeof ga !== 'undefined' ) {
310
+ ga('send', 'event', 'AWS search', 'AWS Search Term', label);
311
+ }
312
  }
313
  catch (error) {
314
  }
497
 
498
 
499
  // Call plugin method
500
+ $(document).ready( function() {
501
 
502
  $(selector).each( function() {
503
  $(this).aws_search();
504
  });
505
 
506
+ // Enfold header
507
+ $('[data-avia-search-tooltip]').on( 'click', function() {
508
+ window.setTimeout(function(){
509
+ $(selector).aws_search();
510
+ }, 1000);
511
+ } );
512
+
513
  });
514
 
515
 
includes/class-aws-integrations.php CHANGED
@@ -66,6 +66,9 @@ if ( ! class_exists( 'AWS_Integrations' ) ) :
66
  add_filter( 'aws_search_pre_filter_products', array( $this, 'wc_marketplace_products_filter' ), 10, 2 );
67
  }
68
 
 
 
 
69
  add_filter( 'aws_terms_exclude_product_cat', array( $this, 'filter_protected_cats_term_exclude' ) );
70
  add_filter( 'aws_exclude_products', array( $this, 'filter_products_exclude' ) );
71
 
@@ -298,6 +301,20 @@ if ( ! class_exists( 'AWS_Integrations' ) ) :
298
 
299
  }
300
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
301
  /*
302
  * Exclude product categories
303
  */
66
  add_filter( 'aws_search_pre_filter_products', array( $this, 'wc_marketplace_products_filter' ), 10, 2 );
67
  }
68
 
69
+ // Porto theme
70
+ add_filter( 'porto_search_form_content', array( $this, 'porto_search_form_content_filter' ) );
71
+
72
  add_filter( 'aws_terms_exclude_product_cat', array( $this, 'filter_protected_cats_term_exclude' ) );
73
  add_filter( 'aws_exclude_products', array( $this, 'filter_products_exclude' ) );
74
 
301
 
302
  }
303
 
304
+ /*
305
+ * Porto theme seamless integration
306
+ */
307
+ public function porto_search_form_content_filter( $markup ) {
308
+
309
+ if ( AWS()->get_settings('seamless') === 'true' ) {
310
+ $pattern = '/(<form[\S\s]*?<\/form>)/i';
311
+ $markup = preg_replace( $pattern, aws_get_search_form( false ), $markup );
312
+ }
313
+
314
+ return $markup;
315
+
316
+ }
317
+
318
  /*
319
  * Exclude product categories
320
  */
includes/class-aws-table.php CHANGED
@@ -525,6 +525,16 @@ if ( ! class_exists( 'AWS_Table' ) ) :
525
 
526
  }
527
 
 
 
 
 
 
 
 
 
 
 
528
 
529
  //Insert data into table
530
  $this->insert_into_table( $data );
525
 
526
  }
527
 
528
+ /**
529
+ * Filters product data array before it will be added to index table.
530
+ *
531
+ * @since 1.62
532
+ *
533
+ * @param array $data Product data array.
534
+ * @param int $data['id'] Product id.
535
+ * @param object $product Current product object.
536
+ */
537
+ $data = apply_filters( 'aws_indexed_data', $data, $data['id'], $product );
538
 
539
  //Insert data into table
540
  $this->insert_into_table( $data );
includes/options.php CHANGED
@@ -280,8 +280,8 @@ $options['results'][] = array(
280
  );
281
 
282
  $options['results'][] = array(
283
- "name" => __( "Show categories", "aws" ),
284
- "desc" => __( "Include categories in search result.", "aws" ),
285
  "id" => "show_cats",
286
  "value" => 'false',
287
  "type" => "radio",
@@ -292,8 +292,8 @@ $options['results'][] = array(
292
  );
293
 
294
  $options['results'][] = array(
295
- "name" => __( "Show tags", "aws" ),
296
- "desc" => __( "Include tags in search result.", "aws" ),
297
  "id" => "show_tags",
298
  "value" => 'false',
299
  "type" => "radio",
280
  );
281
 
282
  $options['results'][] = array(
283
+ "name" => __( "Show categories archive", "aws" ),
284
+ "desc" => __( "Include categories archives pages to search result.", "aws" ),
285
  "id" => "show_cats",
286
  "value" => 'false',
287
  "type" => "radio",
292
  );
293
 
294
  $options['results'][] = array(
295
+ "name" => __( "Show tags archive", "aws" ),
296
+ "desc" => __( "Include tags archives pages to search results.", "aws" ),
297
  "id" => "show_tags",
298
  "value" => 'false',
299
  "type" => "radio",
languages/aws.pot CHANGED
@@ -330,19 +330,19 @@ msgid "What to show in product description?"
330
  msgstr ""
331
 
332
  #: includes/options.php:117
333
- msgid "Show categories"
334
  msgstr ""
335
 
336
  #: includes/options.php:118
337
- msgid "Include categories in search result."
338
  msgstr ""
339
 
340
  #: includes/options.php:129
341
- msgid "Show tags"
342
  msgstr ""
343
 
344
  #: includes/options.php:130
345
- msgid "Include tags in search result."
346
  msgstr ""
347
 
348
  #: includes/options.php:141
330
  msgstr ""
331
 
332
  #: includes/options.php:117
333
+ msgid "Show categories archive"
334
  msgstr ""
335
 
336
  #: includes/options.php:118
337
+ msgid "Include categories archives pages to search result."
338
  msgstr ""
339
 
340
  #: includes/options.php:129
341
+ msgid "Show tags archive"
342
  msgstr ""
343
 
344
  #: includes/options.php:130
345
+ msgid "Include tags archives pages to search results."
346
  msgstr ""
347
 
348
  #: includes/options.php:141
readme.txt CHANGED
@@ -101,6 +101,13 @@ Yep. This plugin is always compatible with the latest version of Woocommerce?
101
 
102
  == Changelog ==
103
 
 
 
 
 
 
 
 
104
  = 1.61 =
105
  * Fix stopwords
106
  * Fix markup for finded words in products content
101
 
102
  == Changelog ==
103
 
104
+ = 1.62 =
105
+ * Fix Google Analytics events
106
+ * Fix jQuery errors
107
+ * Add Enfold theme support
108
+ * Add Porto theme support
109
+ * Add aws_indexed_data filter
110
+
111
  = 1.61 =
112
  * Fix stopwords
113
  * Fix markup for finded words in products content