Advanced Woo Search - Version 1.96

Version Description

  • Add - Mobile full screen search option
  • Fix - Search form markup
Download this release

Release Info

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

Code changes from version 1.95 to 1.96

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.95
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', '1.95' );
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.96
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', '1.96' );
20
 
21
 
22
  define( 'AWS_DIR', dirname( __FILE__ ) );
assets/css/common.css CHANGED
@@ -427,6 +427,44 @@
427
  background: #f5f5f5;
428
  }
429
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
430
 
431
  /* Integrations */
432
 
427
  background: #f5f5f5;
428
  }
429
 
430
+ /* Mobile form overlay */
431
+
432
+ body.aws-overlay {
433
+ overflow: hidden !important;
434
+ position: fixed;
435
+ width: 100%;
436
+ }
437
+
438
+ .aws-container.aws-mobile-fixed {
439
+ position: fixed !important;
440
+ z-index: 9999999 !important;
441
+ top: 10px !important;
442
+ left: 20px !important;
443
+ width: 100%;
444
+ width: calc(100% - 40px) !important;
445
+ }
446
+
447
+ .aws-mobile-fixed-close {
448
+ padding: 15px;
449
+ margin-right: -10px;
450
+ display: inline-block;
451
+ float: right;
452
+ }
453
+
454
+ .aws-overlay-mask {
455
+ display: block;
456
+ position: fixed;
457
+ top: 0;
458
+ left: 0;
459
+ right: 0;
460
+ bottom: 0;
461
+ opacity: 0;
462
+ background: #fff;
463
+ z-index: 9999998 !important;
464
+ }
465
+ .aws-overlay .aws-overlay-mask {
466
+ opacity: 1;
467
+ }
468
 
469
  /* Integrations */
470
 
assets/js/common.js CHANGED
@@ -250,9 +250,15 @@
250
  },
251
 
252
  onFocus: function( event ) {
 
 
 
 
 
253
  if ( searchFor !== '' ) {
254
  methods.showResultsBlock();
255
  }
 
256
  },
257
 
258
  hideResults: function( event ) {
@@ -280,7 +286,7 @@
280
  var top = 0;
281
  var left = 0;
282
 
283
- if ( bodyPosition === 'relative' || bodyPosition === 'absolute' ) {
284
  top = offset.top + $(self).innerHeight() - bodyOffset.top;
285
  left = offset.left - bodyOffset.left;
286
  } else {
@@ -298,6 +304,35 @@
298
 
299
  },
300
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
301
  analytics: function( label ) {
302
  if ( d.useAnalytics ) {
303
  try {
@@ -367,6 +402,7 @@
367
  showMore: ( self.data('show-more') !== undefined ) ? self.data('show-more') : true,
368
  showPage: ( self.data('show-page') !== undefined ) ? self.data('show-page') : true,
369
  showClear: ( self.data('show-clear') !== undefined ) ? self.data('show-clear') : false,
 
370
  useAnalytics: ( self.data('use-analytics') !== undefined ) ? self.data('use-analytics') : false,
371
  instance: instance,
372
  resultBlock: '#aws-search-result-' + instance,
@@ -453,6 +489,10 @@
453
  $searchForm.submit();
454
  });
455
 
 
 
 
 
456
 
457
  $(window).on( 'keydown', function(e) {
458
 
250
  },
251
 
252
  onFocus: function( event ) {
253
+
254
+ if ( methods.isMobile() && d.mobileScreen && ! $('body').hasClass('aws-overlay') ) {
255
+ methods.showMobileLayout();
256
+ }
257
+
258
  if ( searchFor !== '' ) {
259
  methods.showResultsBlock();
260
  }
261
+
262
  },
263
 
264
  hideResults: function( event ) {
286
  var top = 0;
287
  var left = 0;
288
 
289
+ if ( bodyPosition === 'relative' || bodyPosition === 'absolute' || bodyPosition === 'fixed' ) {
290
  top = offset.top + $(self).innerHeight() - bodyOffset.top;
291
  left = offset.left - bodyOffset.left;
292
  } else {
304
 
305
  },
306
 
307
+ showMobileLayout: function() {
308
+ if ( ! methods.isFixed() ) {
309
+ self.after('<div class="aws-placement-container"></div>');
310
+ self.addClass('aws-mobile-fixed').prepend('<div class="aws-mobile-fixed-close"><svg width="17" height="17" viewBox="1.5 1.5 21 21"><path d="M22.182 3.856c.522-.554.306-1.394-.234-1.938-.54-.543-1.433-.523-1.826-.135C19.73 2.17 11.955 10 11.955 10S4.225 2.154 3.79 1.783c-.438-.371-1.277-.4-1.81.135-.533.537-.628 1.513-.25 1.938.377.424 8.166 8.218 8.166 8.218s-7.85 7.864-8.166 8.219c-.317.354-.34 1.335.25 1.805.59.47 1.24.455 1.81 0 .568-.456 8.166-7.951 8.166-7.951l8.167 7.86c.747.72 1.504.563 1.96.09.456-.471.609-1.268.1-1.804-.508-.537-8.167-8.219-8.167-8.219s7.645-7.665 8.167-8.218z"></path></svg></div>');
311
+ $('body').addClass('aws-overlay').append('<div class="aws-overlay-mask"></div>').append( self );
312
+ $searchField.focus();
313
+ }
314
+ },
315
+
316
+ hideMobileLayout: function() {
317
+ $('.aws-placement-container').after( self ).remove();
318
+ self.removeClass('aws-mobile-fixed');
319
+ $('body').removeClass('aws-overlay');
320
+ $('.aws-mobile-fixed-close').remove();
321
+ $('.aws-overlay-mask').remove();
322
+ },
323
+
324
+ isFixed: function() {
325
+ var $checkElements = self.add(self.parents());
326
+ var isFixed = false;
327
+ $checkElements.each(function(){
328
+ if ($(this).css("position") === "fixed") {
329
+ isFixed = true;
330
+ return false;
331
+ }
332
+ });
333
+ return isFixed;
334
+ },
335
+
336
  analytics: function( label ) {
337
  if ( d.useAnalytics ) {
338
  try {
402
  showMore: ( self.data('show-more') !== undefined ) ? self.data('show-more') : true,
403
  showPage: ( self.data('show-page') !== undefined ) ? self.data('show-page') : true,
404
  showClear: ( self.data('show-clear') !== undefined ) ? self.data('show-clear') : false,
405
+ mobileScreen: ( self.data('mobile-screen') !== undefined ) ? self.data('mobile-screen') : false,
406
  useAnalytics: ( self.data('use-analytics') !== undefined ) ? self.data('use-analytics') : false,
407
  instance: instance,
408
  resultBlock: '#aws-search-result-' + instance,
489
  $searchForm.submit();
490
  });
491
 
492
+ $( self ).on( 'click', '.aws-mobile-fixed-close', function(e) {
493
+ methods.hideMobileLayout();
494
+ });
495
+
496
 
497
  $(window).on( 'keydown', function(e) {
498
 
includes/admin/class-aws-admin-options.php CHANGED
@@ -319,6 +319,18 @@ if ( ! class_exists( 'AWS_Admin_Options' ) ) :
319
  )
320
  );
321
 
 
 
 
 
 
 
 
 
 
 
 
 
322
  $options['form'][] = array(
323
  "name" => __( "Search Results", "advanced-woo-search" ),
324
  "desc" => __( "Choose how to view search results.", "advanced-woo-search" ),
319
  )
320
  );
321
 
322
+ $options['form'][] = array(
323
+ "name" => __( "Mobile full screen", "advanced-woo-search" ),
324
+ "desc" => __( "Full screen search on focus. Will not works if search form is inside block with position: fixed.", "advanced-woo-search" ),
325
+ "id" => "mobile_overlay",
326
+ "value" => 'false',
327
+ "type" => "radio",
328
+ 'choices' => array(
329
+ 'true' => __( 'On', 'advanced-woo-search' ),
330
+ 'false' => __( 'Off', 'advanced-woo-search' )
331
+ )
332
+ );
333
+
334
  $options['form'][] = array(
335
  "name" => __( "Search Results", "advanced-woo-search" ),
336
  "desc" => __( "Choose how to view search results.", "advanced-woo-search" ),
includes/class-aws-markup.php CHANGED
@@ -32,6 +32,7 @@ if ( ! class_exists( 'AWS_Markup' ) ) :
32
  $show_more = AWS()->get_settings( 'show_more' );
33
  $show_page = AWS()->get_settings( 'show_page' );
34
  $show_clear = AWS()->get_settings( 'show_clear' );
 
35
  $use_analytics = AWS()->get_settings( 'use_analytics' );
36
  $buttons_order = AWS()->get_settings( 'buttons_order' );
37
 
@@ -56,6 +57,7 @@ if ( ! class_exists( 'AWS_Markup' ) ) :
56
  'data-show-more' => $show_more,
57
  'data-show-page' => $show_page,
58
  'data-show-clear' => $show_clear,
 
59
  'data-use-analytics' => $use_analytics,
60
  'data-min-chars' => $min_chars,
61
  'data-buttons-order' => $buttons_order,
@@ -98,7 +100,7 @@ if ( ! class_exists( 'AWS_Markup' ) ) :
98
  }
99
 
100
  $markup .= '<div class="aws-search-clear">';
101
- $markup .= '<span aria-label="Clear Search">×</span>';
102
  $markup .= '</div>';
103
 
104
  $markup .= '<div class="aws-loader"></div>';
32
  $show_more = AWS()->get_settings( 'show_more' );
33
  $show_page = AWS()->get_settings( 'show_page' );
34
  $show_clear = AWS()->get_settings( 'show_clear' );
35
+ $mobile_screen = AWS()->get_settings( 'mobile_overlay' );
36
  $use_analytics = AWS()->get_settings( 'use_analytics' );
37
  $buttons_order = AWS()->get_settings( 'buttons_order' );
38
 
57
  'data-show-more' => $show_more,
58
  'data-show-page' => $show_page,
59
  'data-show-clear' => $show_clear,
60
+ 'data-mobile-screen' => $mobile_screen,
61
  'data-use-analytics' => $use_analytics,
62
  'data-min-chars' => $min_chars,
63
  'data-buttons-order' => $buttons_order,
100
  }
101
 
102
  $markup .= '<div class="aws-search-clear">';
103
+ $markup .= '<span>×</span>';
104
  $markup .= '</div>';
105
 
106
  $markup .= '<div class="aws-loader"></div>';
includes/class-aws-versions.php CHANGED
@@ -297,6 +297,19 @@ if ( ! class_exists( 'AWS_Versions' ) ) :
297
 
298
  }
299
 
 
 
 
 
 
 
 
 
 
 
 
 
 
300
  }
301
 
302
  update_option( 'aws_plugin_ver', AWS_VERSION );
297
 
298
  }
299
 
300
+ if ( version_compare( $current_version, '1.96', '<' ) ) {
301
+
302
+ $settings = get_option( 'aws_settings' );
303
+
304
+ if ( $settings ) {
305
+ if ( ! isset( $settings['mobile_overlay'] ) ) {
306
+ $settings['mobile_overlay'] = 'false';
307
+ update_option( 'aws_settings', $settings );
308
+ }
309
+ }
310
+
311
+ }
312
+
313
  }
314
 
315
  update_option( 'aws_plugin_ver', AWS_VERSION );
languages/advanced-woo-search.pot CHANGED
@@ -241,6 +241,12 @@ msgstr ""
241
  msgid "Show link to search results page at the bottom of search results block."
242
  msgstr ""
243
 
 
 
 
 
 
 
244
  msgid "Search Results"
245
  msgstr ""
246
 
241
  msgid "Show link to search results page at the bottom of search results block."
242
  msgstr ""
243
 
244
+ msgid "Mobile full screen"
245
+ msgstr ""
246
+
247
+ msgid "Full screen search on focus. Will not works if search form is inside block with position: fixed."
248
+ msgstr ""
249
+
250
  msgid "Search Results"
251
  msgstr ""
252
 
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.3
7
- Stable tag: 1.95
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
@@ -104,6 +104,10 @@ Yep. This plugin is always compatible with the latest version of Woocommerce?
104
 
105
  == Changelog ==
106
 
 
 
 
 
107
  = 1.95 =
108
  * Fix - Ajax request cache problem
109
  * Fix - Polylang plugin fix search results page URL
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.3
7
+ Stable tag: 1.96
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
104
 
105
  == Changelog ==
106
 
107
+ = 1.96 =
108
+ * Add - Mobile full screen search option
109
+ * Fix - Search form markup
110
+
111
  = 1.95 =
112
  * Fix - Ajax request cache problem
113
  * Fix - Polylang plugin fix search results page URL