Ajax Search for WooCommerce - Version 1.1.1

Version Description

Download this release

Release Info

Developer damian-gora
Plugin Icon 128x128 Ajax Search for WooCommerce
Version 1.1.1
Comparing to
See all releases

Code changes from version 1.1 to 1.1.1

ajax-search-for-woocommerce.php CHANGED
@@ -4,7 +4,7 @@
4
  * Plugin Name: Ajax Search for WooCommerce
5
  * Plugin URI: https://wordpress.org/plugins/ajax-search-for-woocommerce/
6
  * Description: The plugin allows you to display the WooCommerce AJAX search form anywhere on the page.
7
- * Version: 1.1
8
  * Author: Damian Góra
9
  * Author URI: http://damiangora.com
10
  * Text Domain: ajax-search-for-woocommerce
@@ -84,7 +84,7 @@ if ( !class_exists( 'DGWT_WC_Ajax_Search' ) ) {
84
  <div class="error">
85
  <p>
86
  <?php
87
- _e( '<b>Ajax Search for WooCommerce</b>: You need PHP version at least 5.3 to run this plugin. You are currently using PHP version ', DGWT_WCAS_DOMAIN );
88
  echo PHP_VERSION . '.';
89
  ?>
90
  </p>
@@ -97,12 +97,11 @@ if ( !class_exists( 'DGWT_WC_Ajax_Search' ) ) {
97
  */
98
  private function constants() {
99
 
100
- $this->define( 'DGWT_WCAS_VERSION', '1.1' );
101
  $this->define( 'DGWT_WCAS_NAME', 'Ajax Search for WooCommerce' );
102
  $this->define( 'DGWT_WCAS_FILE', __FILE__ );
103
  $this->define( 'DGWT_WCAS_DIR', plugin_dir_path( __FILE__ ) );
104
  $this->define( 'DGWT_WCAS_URL', plugin_dir_url( __FILE__ ) );
105
- $this->define( 'DGWT_WCAS_DOMAIN', 'ajax-search-for-woocommerce' );
106
 
107
  $this->define( 'DGWT_WCAS_SETTINGS_KEY', 'dgwt_wcas_settings' );
108
 
@@ -202,7 +201,7 @@ if ( !class_exists( 'DGWT_WC_Ajax_Search' ) ) {
202
 
203
  private function load_textdomain() {
204
  $lang_dir = dirname( plugin_basename( DGWT_WCAS_FILE ) ) . '/languages/';
205
- load_plugin_textdomain( DGWT_WCAS_DOMAIN, false, $lang_dir );
206
  }
207
 
208
  }
4
  * Plugin Name: Ajax Search for WooCommerce
5
  * Plugin URI: https://wordpress.org/plugins/ajax-search-for-woocommerce/
6
  * Description: The plugin allows you to display the WooCommerce AJAX search form anywhere on the page.
7
+ * Version: 1.1.1
8
  * Author: Damian Góra
9
  * Author URI: http://damiangora.com
10
  * Text Domain: ajax-search-for-woocommerce
84
  <div class="error">
85
  <p>
86
  <?php
87
+ _e( '<b>Ajax Search for WooCommerce</b>: You need PHP version at least 5.3 to run this plugin. You are currently using PHP version ', 'ajax-search-for-woocommerce' );
88
  echo PHP_VERSION . '.';
89
  ?>
90
  </p>
97
  */
98
  private function constants() {
99
 
100
+ $this->define( 'DGWT_WCAS_VERSION', '1.1.1' );
101
  $this->define( 'DGWT_WCAS_NAME', 'Ajax Search for WooCommerce' );
102
  $this->define( 'DGWT_WCAS_FILE', __FILE__ );
103
  $this->define( 'DGWT_WCAS_DIR', plugin_dir_path( __FILE__ ) );
104
  $this->define( 'DGWT_WCAS_URL', plugin_dir_url( __FILE__ ) );
 
105
 
106
  $this->define( 'DGWT_WCAS_SETTINGS_KEY', 'dgwt_wcas_settings' );
107
 
201
 
202
  private function load_textdomain() {
203
  $lang_dir = dirname( plugin_basename( DGWT_WCAS_FILE ) ) . '/languages/';
204
+ load_plugin_textdomain( 'ajax-search-for-woocommerce', false, $lang_dir );
205
  }
206
 
207
  }
assets/css/style.css CHANGED
@@ -512,6 +512,7 @@ input[type="text"].dgwt-cas-search-input {
512
  transition: none;
513
  -webkit-box-shadow: none;
514
  box-shadow: none;
 
515
  }
516
 
517
  .dgwt-wcas-pd-desc {
@@ -815,4 +816,4 @@ input[type="submit"].dgwt-wcas-search-submit, button.dgwt-wcas-search-submit{
815
 
816
  .dgwt-wcas-no-submit .dgwt-wcas-sf-wrapp input[type="search"].dgwt-wcas-search-input {
817
  padding: 10px 15px 10px 40px;
818
- }
512
  transition: none;
513
  -webkit-box-shadow: none;
514
  box-shadow: none;
515
+ margin: 0;
516
  }
517
 
518
  .dgwt-wcas-pd-desc {
816
 
817
  .dgwt-wcas-no-submit .dgwt-wcas-sf-wrapp input[type="search"].dgwt-wcas-search-input {
818
  padding: 10px 15px 10px 40px;
819
+ }
assets/js/jquery.dgwt-wcas.js CHANGED
@@ -1,5 +1,5 @@
1
  /**
2
- * Ajax Autocomplete for jQuery, version 1.2.24
3
  * (c) 2015 Tomas Kirda
4
  *
5
  * Ajax Autocomplete for jQuery is freely distributable under the terms of an MIT-style license.
@@ -8,12 +8,12 @@
8
  * Modified by Damian Góra: http://damiangora.com
9
  */
10
 
11
- /*jslint browser: true, white: true, plusplus: true, vars: true */
12
  /*global define, window, document, jQuery, exports, require */
13
 
14
  // Expose plugin as an AMD module if AMD loader is present:
15
  ( function ( factory ) {
16
- 'use strict';
17
  if ( typeof define === 'function' && define.amd ) {
18
  // AMD. Register as an anonymous module.
19
  define( [ 'jquery' ], factory );
@@ -30,7 +30,7 @@
30
  var utils = ( function () {
31
  return {
32
  escapeRegExChars: function ( value ) {
33
- return value.replace( /[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g, "\\$&" );
34
  },
35
  createNode: function ( containerClass ) {
36
  var div = document.createElement( 'div' );
@@ -52,7 +52,7 @@
52
  };
53
 
54
  function Autocomplete( el, options ) {
55
- var noop = function () { },
56
  that = this,
57
  defaults = {
58
  ajaxSettings: { },
@@ -148,6 +148,11 @@
148
  $.Autocomplete = Autocomplete;
149
 
150
  Autocomplete.formatResult = function ( suggestionValue, currentValue ) {
 
 
 
 
 
151
  var pattern = '(' + utils.escapeRegExChars( currentValue ) + ')';
152
 
153
  return suggestionValue
@@ -244,6 +249,7 @@
244
  // Listen for click close button:
245
  container.on( 'click.autocomplete', suggestionSelector, function () {
246
  that.select( $( this ).data( 'index' ) );
 
247
  } );
248
 
249
  that.fixPositionCapture = function () {
@@ -276,7 +282,7 @@
276
  onFocus: function () {
277
  var that = this;
278
  that.fixPosition();
279
- if ( that.options.minChars === 0 && that.el.val().length === 0 ) {
280
  that.onValueChange();
281
  }
282
  },
@@ -514,7 +520,14 @@
514
  that.stopKillSuggestions();
515
  that.intervalId = window.setInterval( function () {
516
  if ( that.visible ) {
517
- that.el.val( that.currentValue );
 
 
 
 
 
 
 
518
  that.hide();
519
  containerParent.removeClass( 'dgwt-wcas-open' );
520
  }
@@ -881,7 +894,7 @@
881
  that.signalHint( null );
882
  },
883
  suggest: function () {
884
- if ( this.suggestions.length === 0 ) {
885
  if ( this.options.showNoSuggestionNotice ) {
886
  this.noSuggestions();
887
  } else {
@@ -932,7 +945,7 @@
932
  }
933
 
934
  if ( typeof suggestion.post_id == 'undefined' ) {
935
- html += '<div class="' + className + ' dgwt-wcas-nores" data-index="0">';
936
  html += '<span class="dgwt-wcas-st">' + suggestion.value + '</span>';
937
  html += '</div>';
938
  } else {
@@ -1003,7 +1016,7 @@
1003
  container.html( html );
1004
 
1005
  if ( $.isFunction( beforeRender ) ) {
1006
- beforeRender.call( that.element, container );
1007
  }
1008
 
1009
  that.fixPosition();
@@ -1197,7 +1210,7 @@
1197
  // Cache results if cache is not disabled:
1198
  if ( !options.noCache ) {
1199
  that.cachedResponse[cacheKey] = result;
1200
- if ( options.preventBadQueries && result.suggestions.length === 0 ) {
1201
  that.badQueries.push( originalQuery );
1202
  }
1203
  }
@@ -1239,6 +1252,7 @@
1239
  var that = this;
1240
  that.hide();
1241
  that.onSelect( i );
 
1242
  },
1243
  moveUp: function () {
1244
  var that = this;
@@ -1374,7 +1388,7 @@
1374
  var dataKey = 'autocomplete';
1375
  // If function invoked without argument return
1376
  // instance of the first matched element:
1377
- if ( arguments.length === 0 ) {
1378
  return this.first().data( dataKey );
1379
  }
1380
 
1
  /**
2
+ * Ajax Autocomplete for jQuery, version 1.2.27
3
  * (c) 2015 Tomas Kirda
4
  *
5
  * Ajax Autocomplete for jQuery is freely distributable under the terms of an MIT-style license.
8
  * Modified by Damian Góra: http://damiangora.com
9
  */
10
 
11
+ /*jslint browser: true, white: true, single: true, this: true, multivar: true */
12
  /*global define, window, document, jQuery, exports, require */
13
 
14
  // Expose plugin as an AMD module if AMD loader is present:
15
  ( function ( factory ) {
16
+ "use strict";
17
  if ( typeof define === 'function' && define.amd ) {
18
  // AMD. Register as an anonymous module.
19
  define( [ 'jquery' ], factory );
30
  var utils = ( function () {
31
  return {
32
  escapeRegExChars: function ( value ) {
33
+ return value.replace( /[|\\{}()[\]^$+*?.]/g, "\\$&" );
34
  },
35
  createNode: function ( containerClass ) {
36
  var div = document.createElement( 'div' );
52
  };
53
 
54
  function Autocomplete( el, options ) {
55
+ var noop = $.noop,
56
  that = this,
57
  defaults = {
58
  ajaxSettings: { },
148
  $.Autocomplete = Autocomplete;
149
 
150
  Autocomplete.formatResult = function ( suggestionValue, currentValue ) {
151
+
152
+ // Do not replace anything if there current value is empty
153
+ if ( !currentValue ) {
154
+ return suggestionValue;
155
+ }
156
  var pattern = '(' + utils.escapeRegExChars( currentValue ) + ')';
157
 
158
  return suggestionValue
249
  // Listen for click close button:
250
  container.on( 'click.autocomplete', suggestionSelector, function () {
251
  that.select( $( this ).data( 'index' ) );
252
+ return false;
253
  } );
254
 
255
  that.fixPositionCapture = function () {
282
  onFocus: function () {
283
  var that = this;
284
  that.fixPosition();
285
+ if ( that.el.val().length >= that.options.minChars ) {
286
  that.onValueChange();
287
  }
288
  },
520
  that.stopKillSuggestions();
521
  that.intervalId = window.setInterval( function () {
522
  if ( that.visible ) {
523
+
524
+ // No need to restore value when
525
+ // preserveInput === true,
526
+ // because we did not change it
527
+ if ( !that.options.preserveInput ) {
528
+ that.el.val( that.currentValue );
529
+ }
530
+
531
  that.hide();
532
  containerParent.removeClass( 'dgwt-wcas-open' );
533
  }
894
  that.signalHint( null );
895
  },
896
  suggest: function () {
897
+ if (!this.suggestions.length) {
898
  if ( this.options.showNoSuggestionNotice ) {
899
  this.noSuggestions();
900
  } else {
945
  }
946
 
947
  if ( typeof suggestion.post_id == 'undefined' ) {
948
+ html += '<div class="' + className + ' dgwt-wcas-nores" data-index="'+i+'">';
949
  html += '<span class="dgwt-wcas-st">' + suggestion.value + '</span>';
950
  html += '</div>';
951
  } else {
1016
  container.html( html );
1017
 
1018
  if ( $.isFunction( beforeRender ) ) {
1019
+ beforeRender.call( that.element, container, that.suggestions );
1020
  }
1021
 
1022
  that.fixPosition();
1210
  // Cache results if cache is not disabled:
1211
  if ( !options.noCache ) {
1212
  that.cachedResponse[cacheKey] = result;
1213
+ if (options.preventBadQueries && !result.suggestions.length) {
1214
  that.badQueries.push( originalQuery );
1215
  }
1216
  }
1252
  var that = this;
1253
  that.hide();
1254
  that.onSelect( i );
1255
+ that.disableKillerFn();
1256
  },
1257
  moveUp: function () {
1258
  var that = this;
1388
  var dataKey = 'autocomplete';
1389
  // If function invoked without argument return
1390
  // instance of the first matched element:
1391
+ if (!arguments.length) {
1392
  return this.first().data( dataKey );
1393
  }
1394
 
assets/js/jquery.dgwt-wcas.min.js CHANGED
@@ -1,10 +1 @@
1
- /**
2
- * Ajax Autocomplete for jQuery
3
- * (c) 2015 Tomas Kirda
4
- *
5
- * Ajax Autocomplete for jQuery is freely distributable under the terms of an MIT-style license.
6
- * For details, see the web site: https://github.com/devbridge/jQuery-Autocomplete
7
- *
8
- * Modified by Damian Góra: http://damiangora.com
9
- */
10
- !function(e){"use strict";"function"==typeof define&&define.amd?define(["jquery"],e):e("object"==typeof exports&&"function"==typeof require?require("jquery"):jQuery)}(function(e){"use strict";function t(s,n){var i=function(){},o=this,a={ajaxSettings:{},autoSelectFirst:!1,appendTo:document.body,serviceUrl:null,lookup:null,onSelect:null,onMouseOver:null,onMouseLeave:null,width:"auto",containerDetailsWidth:"auto",showDetailsPanel:!1,showImage:!1,showPrice:!1,showSKU:!1,showDescription:!1,showSaleBadge:!1,showFeaturedBadge:!1,saleBadgeText:"sale",featuredBadgeText:"featured",minChars:1,maxHeight:1e3,deferRequestBy:0,params:{},formatResult:t.formatResult,delimiter:null,zIndex:9999,type:"GET",noCache:!1,is_rtl:!1,onSearchStart:i,onSearchComplete:i,onSearchError:i,preserveInput:!1,wrapperaClass:"dgwt-wcas-search-wrapp",containerClass:"dgwt-wcas-suggestions-wrapp",containerDetailsClass:"dgwt-wcas-details-wrapp",cointainerDetailsPos:"right",preloaderClass:"dgwt-wcas-preloader",closeTrigger:"dgwt-wcas-close",tabDisabled:!1,dataType:"text",currentRequest:null,triggerSelectOnValidInput:!0,preventBadQueries:!0,lookupFilter:function(e,t,s){return-1!==e.value.toLowerCase().indexOf(s)},paramName:"query",transformResult:function(t){return"string"==typeof t?e.parseJSON(t):t},showNoSuggestionNotice:!1,noSuggestionNotice:"No results",orientation:"bottom",forceFixPosition:!1};o.element=s,o.el=e(s),o.suggestions=[],o.badQueries=[],o.selectedIndex=-1,o.currentValue=o.element.value,o.intervalId=0,o.cachedResponse={},o.cachedDetails={},o.detailsRequestsSent=[],o.onChangeInterval=null,o.onChange=null,o.isLocal=!1,o.suggestionsContainer=null,o.detailsContainer=null,o.noSuggestionsContainer=null,o.options=e.extend({},a,n),o.classes={selected:"dgwt-wcas-suggestion-selected",suggestion:"dgwt-wcas-suggestion"},o.hint=null,o.hintValue="",o.selection=null,o.initialize(),o.setOptions(n)}var s=function(){return{escapeRegExChars:function(e){return e.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&")},createNode:function(e){var t=document.createElement("div");return t.className=e,t.style.position="absolute",t.style.display="none",t}}}(),n={ESC:27,TAB:9,RETURN:13,LEFT:37,UP:38,RIGHT:39,DOWN:40};t.utils=s,e.Autocomplete=t,t.formatResult=function(e,t){var n="("+s.escapeRegExChars(t)+")";return e.replace(new RegExp(n,"gi"),"<strong>$1</strong>").replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/&lt;(\/?strong)&gt;/g,"<$1>")},t.prototype={killerFn:null,initialize:function(){var s,n,i=this,o="."+i.classes.suggestion,a=(i.classes.selected,i.options),l="."+a.closeTrigger;i.element.setAttribute("autocomplete","off"),i.killerFn=function(t){0===e(t.target).closest("."+i.options.containerClass).length&&0===e(t.target).closest("."+i.options.containerDetailsClass).length&&(i.killSuggestions(),i.disableKillerFn())},i.noSuggestionsContainer=e('<div class="dgwt-wcas-no-suggestion"></div>').html(this.options.noSuggestionNotice).get(0),i.suggestionsContainer=t.utils.createNode(a.containerClass),s=e(i.suggestionsContainer),s.appendTo(i.el.closest("."+a.wrapperaClass)),a.showImage===!0&&s.addClass("dgwt-wcas-has-img"),a.showPrice===!0&&s.addClass("dgwt-wcas-has-price"),a.showDescription===!0&&s.addClass("dgwt-wcas-has-desc"),a.showSKU===!0&&s.addClass("dgwt-wcas-has-sku"),"auto"!==a.width&&s.width(a.width),a.showDetailsPanel===!0&&(i.detailsContainer=t.utils.createNode(a.containerDetailsClass),n=e(i.detailsContainer),n.appendTo(i.el.closest("."+a.wrapperaClass))),s.on("mouseover.autocomplete",o,function(){i.onMouseOver(e(this).data("index")),i.activate(e(this).data("index"))}),s.on("mouseout.autocomplete",function(){}),e(document).on("click.autocomplete",l,function(t){i.killerFn(t),i.clear(t),e(this).removeClass(a.closeTrigger),i.el.val("").focus()}),s.on("click.autocomplete",o,function(){i.select(e(this).data("index"))}),i.fixPositionCapture=function(){i.visible&&i.fixPosition()},e(window).on("resize.autocomplete",i.fixPositionCapture),i.el.on("keydown.autocomplete",function(e){i.onKeyPress(e)}),i.el.on("keyup.autocomplete",function(e){i.onKeyUp(e)}),i.el.on("blur.autocomplete",function(){i.onBlur()}),i.el.on("focus.autocomplete",function(){i.onFocus()}),i.el.on("change.autocomplete",function(e){i.onKeyUp(e)}),i.el.on("input.autocomplete",function(e){i.onKeyUp(e)})},onFocus:function(){var e=this;e.fixPosition(),0===e.options.minChars&&0===e.el.val().length&&e.onValueChange()},onBlur:function(){this.enableKillerFn()},abortAjax:function(){var e=this;e.currentRequest&&(e.currentRequest.abort(),e.currentRequest=null)},setOptions:function(t){var s=this,n=s.options;e.extend(n,t),s.isLocal=e.isArray(n.lookup),s.isLocal&&(n.lookup=s.verifySuggestionsFormat(n.lookup)),n.orientation=s.validateOrientation(n.orientation,"bottom"),e(s.suggestionsContainer).css({"max-height":n.maxHeight+"px",width:n.width+"px","z-index":n.zIndex}),n.showDetailsPanel===!0&&jQuery(s.suggestionsContainer).parent().addClass("dgwt-wcas-is-details"),s.options.onSearchComplete=function(){s.preloader("hide",e("."+n.preloaderClass),"dgwt-wcas-inner-preloader"),s.preloader("show",e("."+n.preloaderClass),n.closeTrigger)}},clearCache:function(){this.cachedResponse={},this.cachedDetails={},this.badQueries=[]},clear:function(){this.clearCache(),this.currentValue="",this.suggestions=[]},disable:function(){var e=this;e.disabled=!0,clearInterval(e.onChangeInterval),e.abortAjax()},enable:function(){this.disabled=!1},fixPosition:function(){var t=this,s=(t.options,e(t.suggestionsContainer)),n=(e(t.detailsContainer),s.parent().get(0));if(n===document.body||t.options.forceFixPosition){var i=t.options.orientation,o=s.outerHeight(),a=t.el.outerHeight(),l=t.el.offset(),r={top:l.top,left:l.left};if("auto"===i){var u=e(window).height(),c=e(window).scrollTop(),d=-c+l.top-o,g=c+u-(l.top+a+o);i=Math.max(d,g)===d?"top":"bottom"}if("top"===i?r.top+=-o:r.top+=a,n!==document.body){var h,p=s.css("opacity");t.visible||s.css("opacity",0).show(),h=s.offsetParent().offset(),r.top-=h.top,r.left-=h.left,t.visible||s.css("opacity",p).hide()}"auto"===t.options.width&&(r.width=t.el.outerWidth()-2+"px"),s.css(r)}},fixPositionDetailsBox:function(){var t=this,s=e(t.detailsContainer);if(0==s.length)return!1;var n=e(window).width(),i=s.parent(),o=s.prev(),a=s.width(),l=s.offset(),r=550;i.width()>=r||(n<l.left+a&&(i.removeClass("dgwt-wcas-details-right"),i.addClass("dgwt-wcas-details-left"),s.css("left","-"+s.outerWidth()+"px")),l.left<1&&(i.removeClass("dgwt-wcas-details-left"),i.addClass("dgwt-wcas-details-right"),s.css("left",o.outerWidth()+"px")))},fixHeight:function(t,s){var n=this,i=n.options;if(1!=i.showDetailsPanel)return!1;var s,o=e("."+i.containerClass),a=e("."+i.containerDetailsClass),l=0,r=0;e("."+i.containerClass+"> *").each(function(){l+=e(this).outerHeight()}),e("."+i.containerDetailsClass+"> *").each(function(){r+=e(this).outerHeight()}),s=l>=r?l:r,(s>l||s>r)&&(o.css("height",s+"px"),a.css("height",s+"px")),"undefined"==typeof t&&(t=0),5>t?setTimeout(function(){n.fixHeight(t+1,s)},30):t=0},enableKillerFn:function(){var t=this;e(document).on("click.autocomplete",t.killerFn)},disableKillerFn:function(){var t=this;e(document).off("click.autocomplete",t.killerFn)},killSuggestions:function(){var t=this,s=e(t.suggestionsContainer).parent();t.stopKillSuggestions(),t.intervalId=window.setInterval(function(){t.visible&&(t.el.val(t.currentValue),t.hide(),s.removeClass("dgwt-wcas-open")),t.stopKillSuggestions()},50)},stopKillSuggestions:function(){window.clearInterval(this.intervalId)},isCursorAtEnd:function(){var e,t=this,s=t.el.val().length,n=t.element.selectionStart;return"number"==typeof n?n===s:document.selection?(e=document.selection.createRange(),e.moveStart("character",-s),s===e.text.length):!0},onKeyPress:function(e){var t=this;if(!t.disabled&&!t.visible&&e.which===n.DOWN&&t.currentValue)return void t.suggest();if(!t.disabled&&t.visible){switch(e.which){case n.ESC:t.el.val(t.currentValue),t.hide();break;case n.RIGHT:if(t.hint&&t.options.onHint&&t.isCursorAtEnd()){t.selectHint();break}return;case n.TAB:if(t.hint&&t.options.onHint)return void t.selectHint();if(-1===t.selectedIndex)return void t.hide();if(t.select(t.selectedIndex),t.options.tabDisabled===!1)return;break;case n.RETURN:if(-1===t.selectedIndex)return void t.hide();t.select(t.selectedIndex);break;case n.UP:t.moveUp();break;case n.DOWN:t.moveDown();break;default:return}e.stopImmediatePropagation(),e.preventDefault()}},onKeyUp:function(e){var t=this;if(!t.disabled){switch(e.which){case n.UP:case n.DOWN:return}clearInterval(t.onChangeInterval),t.currentValue!==t.el.val()&&(t.findBestHint(),t.options.deferRequestBy>0?t.onChangeInterval=setInterval(function(){t.onValueChange()},t.options.deferRequestBy):t.onValueChange())}},onValueChange:function(){var t=this,s=t.options,n=t.el.val(),i=t.getQuery(n);return t.selection&&t.currentValue!==i&&(t.selection=null,(s.onInvalidateSelection||e.noop).call(t.element)),clearInterval(t.onChangeInterval),t.currentValue=n,t.selectedIndex=-1,s.triggerSelectOnValidInput&&t.isExactMatch(i)?void t.select(0):void(i.length<s.minChars?(e("."+t.options.closeTrigger).removeClass(t.options.closeTrigger),t.hide()):t.getSuggestions(i))},isExactMatch:function(e){var t=this.suggestions;return 1===t.length&&t[0].value.toLowerCase()===e.toLowerCase()},getQuery:function(t){var s,n=this.options.delimiter;return n?(s=t.split(n),e.trim(s[s.length-1])):t},getSuggestionsLocal:function(t){var s,n=this,i=n.options,o=t.toLowerCase(),a=i.lookupFilter,l=parseInt(i.lookupLimit,10);return s={suggestions:e.grep(i.lookup,function(e){return a(e,t,o)})},l&&s.suggestions.length>l&&(s.suggestions=s.suggestions.slice(0,l)),s},getSuggestions:function(t){var s,n,i,o,a=this,l=a.options,r=l.serviceUrl;if(l.params[l.paramName]=t,n=l.ignoreParams?null:l.params,a.preloader("show",e("."+l.preloaderClass),"dgwt-wcas-inner-preloader"),l.onSearchStart.call(a.element,l.params)!==!1){if(e.isFunction(l.lookup))return void l.lookup(t,function(e){a.suggestions=e.suggestions,a.suggest(),a.getDetails(e.suggestions[0]),l.onSearchComplete.call(a.element,t,e.suggestions)});a.isLocal?s=a.getSuggestionsLocal(t):(e.isFunction(r)&&(r=r.call(a.element,t)),i=r+"?"+e.param(n||{}),s=a.cachedResponse[i]),s&&e.isArray(s.suggestions)?(a.suggestions=s.suggestions,a.suggest(),a.getDetails(s.suggestions[0]),l.onSearchComplete.call(a.element,t,s.suggestions)):a.isBadQuery(t)?l.onSearchComplete.call(a.element,t,[]):(a.abortAjax(),o={url:r,data:n,type:l.type,dataType:l.dataType},e.extend(o,l.ajaxSettings),a.currentRequest=e.ajax(o).done(function(e){var s;a.currentRequest=null,s=l.transformResult(e,t),"undefined"!=typeof s.suggestions&&(a.processResponse(s,t,i),a.getDetails(s.suggestions[0])),l.onSearchComplete.call(a.element,t,s.suggestions)}).fail(function(e,s,n){l.onSearchError.call(a.element,t,e,s,n)}))}},getDetails:function(t){var s=this,n=s.options;if(1!=n.showDetailsPanel||e(window).width()<992||"ontouchend"in document)return!1;if(null!=t){var i,o,a=e("."+n.containerDetailsClass);s.fixHeight();var l={action:dgwt_wcas.action_result_details,post_id:null!=t.post_id?t.post_id:0,term_id:null!=t.term_id?t.term_id:0,taxonomy:null!=t.taxonomy?t.taxonomy:"",value:null!=t.value?t.value:""};if(i=l.action+l.post_id+l.term_id+l.taxonomy,o=s.cachedDetails[i],null!=o)a.html(o.details),s.fixHeight(),s.fixPositionDetailsBox();else{if(a.html(""),s.preloader("show",a,"",!0),-1!=e.inArray(i,s.detailsRequestsSent))return;s.detailsRequestsSent.push(i),e.ajax({data:l,type:"post",url:dgwt_wcas.ajax_details_endpoint,success:function(e){var t="string"==typeof e?jQuery.parseJSON(e):e;s.cachedDetails[i]=t,s.preloader("hide",a,"",!0),null!=t.details?a.html(t.details):a.html("@TODO BŁĄD"),s.fixPositionDetailsBox(),s.fixHeight()},error:function(e,t){s.preloader("hide",a,"",!0),a.html(e),s.fixPositionDetailsBox(),s.fixHeight()}})}}},isBadQuery:function(e){if(!this.options.preventBadQueries)return!1;for(var t=this.badQueries,s=t.length;s--;)if(0===e.indexOf(t[s]))return!0;return!1},hide:function(){var t=this,s=e(t.suggestionsContainer);e(t.detailsContainer);e.isFunction(t.options.onHide)&&t.visible&&t.options.onHide.call(t.element,s),t.visible=!1,t.selectedIndex=-1,clearInterval(t.onChangeInterval),e(t.suggestionsContainer).hide(),e(t.detailsContainer).hide(),t.signalHint(null)},suggest:function(){if(0===this.suggestions.length)return void(this.options.showNoSuggestionNotice?this.noSuggestions():this.hide());var t,s=this,n=s.options,i=n.groupBy,o=n.formatResult,a=s.getQuery(s.currentValue),l=s.classes.suggestion,r=s.classes.selected,u=e(s.suggestionsContainer),c=e(s.detailsContainer),d=e(s.noSuggestionsContainer),g=n.beforeRender,h="",p=function(e,s){var n=e.data[i];return t===n?"":(t=n,'<div class="autocomplete-group"><strong>'+t+"</strong></div>")};return n.triggerSelectOnValidInput&&s.isExactMatch(a)?void s.select(0):(e.each(s.suggestions,function(e,t){var s="",r="",u=!1;i&&(h+=p(t,a,e)),"undefined"==typeof t.post_id?(h+='<div class="'+l+' dgwt-wcas-nores" data-index="0">',h+='<span class="dgwt-wcas-st">'+t.value+"</span>",h+="</div>"):("undefined"!=typeof t.parents&&(s=t.parents),n.showImage===!0&&"undefined"!=typeof t.thumb_html&&(u=!0),r+="undefined"!=typeof t.post_id?'data-post-id="'+t.post_id+'" ':"",r+="undefined"!=typeof t.taxonomy?'data-taxonomy="'+t.taxonomy+'" ':"",r+="undefined"!=typeof t.term_id?'data-term-id="'+t.term_id+'" ':"",h+='<div class="'+l+'" data-index="'+e+'" '+r+">",u&&(h+='<span class="dgwt-wcas-si">'+t.thumb_html+"</span>"),h+=u?'<div class="dgwt-wcas-content-wrapp">':"",h+='<span class="dgwt-wcas-st">',h+="<span>"+o(t.value,a)+s+"</span>",n.showSKU===!0&&"undefined"!=typeof t.sku&&t.sku.length>0&&(h+='<span class="dgwt-wcas-sku">(SKU: '+o(t.sku,a)+")</span>"),h+="</span>",n.showPrice===!0&&"undefined"!=typeof t.price&&(h+='<span class="dgwt-wcas-sp">'+t.price+"</span>"),n.showDescription===!0&&"undefined"!=typeof t.desc&&(h+='<span class="dgwt-wcas-sd">'+o(t.desc,a)+"</span>"),n.showFeaturedBadge===!0&&t.on_sale===!0&&(h+='<span class="dgwt-wcas-badge dgwt-wcas-badge-os">'+n.saleBadgeText+"</span>"),n.showFeaturedBadge===!0&&t.featured===!0&&(h+='<span class="dgwt-wcas-badge dgwt-wcas-badge-f">'+n.featuredBadgeText+"</span>"),h+=u?"</div>":"",h+="</div>")}),this.adjustContainerWidth(),d.detach(),u.html(h),e.isFunction(g)&&g.call(s.element,u),s.fixPosition(),u.show(),u.parent().addClass("dgwt-wcas-open"),n.showDetailsPanel===!0&&c.show(),n.autoSelectFirst&&(s.selectedIndex=0,u.scrollTop(0),u.children("."+l).first().addClass(r)),s.visible=!0,void s.findBestHint())},noSuggestions:function(){var t=this,s=e(t.suggestionsContainer),n=e(t.noSuggestionsContainer);this.adjustContainerWidth(),n.detach(),s.empty(),s.append(n),t.fixPosition(),s.show(),t.visible=!0},adjustContainerWidth:function(){var t,s=this,n=s.options,i=e(s.suggestionsContainer).parent(),o=e(s.suggestionsContainer),a=e(s.detailsContainer),l=550;return"auto"===n.width&&(t=s.el.outerWidth(),o.css("width",t+"px")),i.width()>=l&&n.showDetailsPanel===!0?(i.addClass("dgwt-wcas-full-width"),o.outerWidth(300),a.innerWidth(i.width()-300),i.removeClass("dgwt-wcas-details-left"),i.removeClass("dgwt-wcas-details-right"),void(n.is_rtl===!0?(a.css("left","0"),o.css("right","0")):(a.css("right","0"),o.css("left","0")))):void("left"===n.cointainerDetailsPos?(a.parent().addClass("dgwt-wcas-details-left"),a.css("left","-"+a.outerWidth()+"px")):(a.parent().addClass("dgwt-wcas-details-right"),a.css("left",i.outerWidth()+"px")))},findBestHint:function(){var t=this,s=t.el.val().toLowerCase(),n=null;s&&(e.each(t.suggestions,function(e,t){var i=0===t.value.toLowerCase().indexOf(s);return i&&(n=t),!i}),t.signalHint(n))},signalHint:function(t){var s="",n=this;t&&(s=n.currentValue+t.value.substr(n.currentValue.length)),n.hintValue!==s&&(n.hintValue=s,n.hint=t,(this.options.onHint||e.noop)(s))},preloader:function(t,s,n,i){var o,a="dgwt-wcas-preloader-wrapp",l=null==n?a:a+" "+n;if(1==dgwt_wcas.show_preloader&&0!=s.length)return i!==!0?void("hide"===t?s.removeClass(n):s.addClass(n)):"hide"===t?void e(a).remove():void("show"===t&&(o='<div class="'+l+'"><div class="dgwt-wcas-default-preloader"></div></div>',s.html(o)))},verifySuggestionsFormat:function(t){return t.length&&"string"==typeof t[0]?e.map(t,function(e){return{value:e,data:null}}):t},validateOrientation:function(t,s){return t=e.trim(t||"").toLowerCase(),-1===e.inArray(t,["auto","bottom","top"])&&(t=s),t},processResponse:function(e,t,s){var n=this,i=n.options;e.suggestions=n.verifySuggestionsFormat(e.suggestions),i.noCache||(n.cachedResponse[s]=e,i.preventBadQueries&&0===e.suggestions.length&&n.badQueries.push(t)),t===n.getQuery(n.currentValue)&&(n.suggestions=e.suggestions,n.suggest())},activate:function(t){var s,n=this,i=n.classes.selected,o=e(n.suggestionsContainer),a=o.find("."+n.classes.suggestion);return o.find("."+i).removeClass(i),n.selectedIndex=t,-1!==n.selectedIndex&&a.length>n.selectedIndex?(s=a.get(n.selectedIndex),e(s).addClass(i),s):null},selectHint:function(){var t=this,s=e.inArray(t.hint,t.suggestions);t.select(s)},select:function(e){var t=this;t.hide(),t.onSelect(e)},moveUp:function(){var t=this;if(-1!==t.selectedIndex)return 0===t.selectedIndex?(e(t.suggestionsContainer).children().first().removeClass(t.classes.selected),t.selectedIndex=-1,t.el.val(t.currentValue),void t.findBestHint()):void t.adjustScroll(t.selectedIndex-1)},moveDown:function(){var e=this;e.selectedIndex!==e.suggestions.length-1&&e.adjustScroll(e.selectedIndex+1)},adjustScroll:function(t){var s=this,n=s.activate(t);if(n){var i,o,a,l=e(n).outerHeight();i=n.offsetTop,o=e(s.suggestionsContainer).scrollTop(),a=o+s.options.maxHeight-l,o>i?e(s.suggestionsContainer).scrollTop(i):i>a&&e(s.suggestionsContainer).scrollTop(i-s.options.maxHeight+l),s.options.preserveInput||s.el.val(s.getValue(s.suggestions[t].value)),s.signalHint(null)}},onSelect:function(t){var s=this,n=s.options.onSelect,i=s.suggestions[t];s.currentValue=s.getValue(i.value),s.currentValue===s.el.val()||s.options.preserveInput||s.el.val(s.currentValue),-1!=i.id&&(window.location.href=i.url),s.signalHint(null),s.suggestions=[],s.selection=i,e.isFunction(n)&&n.call(s.element,i)},onMouseOver:function(t){var s=this,n=s.options.onMouseOver,i=s.suggestions[t];s.selectedIndex!==t&&s.getDetails(i),e.isFunction(n)&&n.call(s.element,i)},onMouseLeave:function(t){var s=this,n=s.options.onMouseLeave,i=s.suggestions[t];e.isFunction(n)&&n.call(s.element,i)},getValue:function(e){var t,s,n=this,i=n.options.delimiter;return i?(t=n.currentValue,s=t.split(i),1===s.length?e:t.substr(0,t.length-s[s.length-1].length)+e):e},dispose:function(){var t=this;t.el.off(".autocomplete").removeData("autocomplete"),t.disableKillerFn(),e(window).off("resize.autocomplete",t.fixPositionCapture),e(t.suggestionsContainer).remove()}},e.fn.dgwtWcasAutocomplete=function(s,n){var i="autocomplete";return 0===arguments.length?this.first().data(i):this.each(function(){var o=e(this),a=o.data(i);"string"==typeof s?a&&"function"==typeof a[s]&&a[s](n):(a&&a.dispose&&a.dispose(),a=new t(this,s),o.data(i,a))})},function(){e(document).ready(function(){e(".dgwt-wcas-search-submit").length>0&&e(".dgwt-wcas-preloader").css("right",e(".dgwt-wcas-search-submit").outerWidth()+"px");var t=1==dgwt_wcas.show_details_box?!0:!1;(jQuery(window).width()<992||"ontouchend"in document)&&(t=!1),e(".dgwt-wcas-search-input").dgwtWcasAutocomplete({minChars:dgwt_wcas.min_chars,width:dgwt_wcas.sug_width,autoSelectFirst:!1,triggerSelectOnValidInput:!1,serviceUrl:dgwt_wcas.ajax_search_endpoint,paramName:"dgwt_wcas_keyword",showDetailsPanel:t,showImage:1==dgwt_wcas.show_images?!0:!1,showPrice:1==dgwt_wcas.show_price?!0:!1,showDescription:1==dgwt_wcas.show_desc?!0:!1,showSKU:1==dgwt_wcas.show_sku?!0:!1,showSaleBadge:1==dgwt_wcas.show_sale_badge?!0:!1,showFeaturedBadge:1==dgwt_wcas.show_featured_badge?!0:!1,saleBadgeText:dgwt_wcas.t.sale_badge,featuredBadgeText:dgwt_wcas.t.featured_badge,cointainerDetailsPos:dgwt_wcas.details_box_pos,is_rtl:1==dgwt_wcas.is_rtl?!0:!1})})}()});
1
+ !function(e){"use strict";"function"==typeof define&&define.amd?define(["jquery"],e):e("object"==typeof exports&&"function"==typeof require?require("jquery"):jQuery)}(function(e){"use strict";function t(s,n){var i=e.noop,o=this,a={ajaxSettings:{},autoSelectFirst:!1,appendTo:document.body,serviceUrl:null,lookup:null,onSelect:null,onMouseOver:null,onMouseLeave:null,width:"auto",containerDetailsWidth:"auto",showDetailsPanel:!1,showImage:!1,showPrice:!1,showSKU:!1,showDescription:!1,showSaleBadge:!1,showFeaturedBadge:!1,saleBadgeText:"sale",featuredBadgeText:"featured",minChars:1,maxHeight:1e3,deferRequestBy:0,params:{},formatResult:t.formatResult,delimiter:null,zIndex:9999,type:"GET",noCache:!1,is_rtl:!1,onSearchStart:i,onSearchComplete:i,onSearchError:i,preserveInput:!1,wrapperaClass:"dgwt-wcas-search-wrapp",containerClass:"dgwt-wcas-suggestions-wrapp",containerDetailsClass:"dgwt-wcas-details-wrapp",cointainerDetailsPos:"right",preloaderClass:"dgwt-wcas-preloader",closeTrigger:"dgwt-wcas-close",tabDisabled:!1,dataType:"text",currentRequest:null,triggerSelectOnValidInput:!0,preventBadQueries:!0,lookupFilter:function(e,t,s){return-1!==e.value.toLowerCase().indexOf(s)},paramName:"query",transformResult:function(t){return"string"==typeof t?e.parseJSON(t):t},showNoSuggestionNotice:!1,noSuggestionNotice:"No results",orientation:"bottom",forceFixPosition:!1};o.element=s,o.el=e(s),o.suggestions=[],o.badQueries=[],o.selectedIndex=-1,o.currentValue=o.element.value,o.intervalId=0,o.cachedResponse={},o.cachedDetails={},o.detailsRequestsSent=[],o.onChangeInterval=null,o.onChange=null,o.isLocal=!1,o.suggestionsContainer=null,o.detailsContainer=null,o.noSuggestionsContainer=null,o.options=e.extend({},a,n),o.classes={selected:"dgwt-wcas-suggestion-selected",suggestion:"dgwt-wcas-suggestion"},o.hint=null,o.hintValue="",o.selection=null,o.initialize(),o.setOptions(n)}var s=function(){return{escapeRegExChars:function(e){return e.replace(/[|\\{}()[\]^$+*?.]/g,"\\$&")},createNode:function(e){var t=document.createElement("div");return t.className=e,t.style.position="absolute",t.style.display="none",t}}}(),n={ESC:27,TAB:9,RETURN:13,LEFT:37,UP:38,RIGHT:39,DOWN:40};t.utils=s,e.Autocomplete=t,t.formatResult=function(e,t){if(!t)return e;var n="("+s.escapeRegExChars(t)+")";return e.replace(new RegExp(n,"gi"),"<strong>$1</strong>").replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/&lt;(\/?strong)&gt;/g,"<$1>")},t.prototype={killerFn:null,initialize:function(){var s,n=this,i="."+n.classes.suggestion,o=(n.classes.selected,n.options),a="."+o.closeTrigger;n.element.setAttribute("autocomplete","off"),n.killerFn=function(t){0===e(t.target).closest("."+n.options.containerClass).length&&0===e(t.target).closest("."+n.options.containerDetailsClass).length&&(n.killSuggestions(),n.disableKillerFn())},n.noSuggestionsContainer=e('<div class="dgwt-wcas-no-suggestion"></div>').html(this.options.noSuggestionNotice).get(0),n.suggestionsContainer=t.utils.createNode(o.containerClass),(s=e(n.suggestionsContainer)).appendTo(n.el.closest("."+o.wrapperaClass)),!0===o.showImage&&s.addClass("dgwt-wcas-has-img"),!0===o.showPrice&&s.addClass("dgwt-wcas-has-price"),!0===o.showDescription&&s.addClass("dgwt-wcas-has-desc"),!0===o.showSKU&&s.addClass("dgwt-wcas-has-sku"),"auto"!==o.width&&s.width(o.width),!0===o.showDetailsPanel&&(n.detailsContainer=t.utils.createNode(o.containerDetailsClass),e(n.detailsContainer).appendTo(n.el.closest("."+o.wrapperaClass))),s.on("mouseover.autocomplete",i,function(){n.onMouseOver(e(this).data("index")),n.activate(e(this).data("index"))}),s.on("mouseout.autocomplete",function(){}),e(document).on("click.autocomplete",a,function(t){n.killerFn(t),n.clear(t),e(this).removeClass(o.closeTrigger),n.el.val("").focus()}),s.on("click.autocomplete",i,function(){return n.select(e(this).data("index")),!1}),n.fixPositionCapture=function(){n.visible&&n.fixPosition()},e(window).on("resize.autocomplete",n.fixPositionCapture),n.el.on("keydown.autocomplete",function(e){n.onKeyPress(e)}),n.el.on("keyup.autocomplete",function(e){n.onKeyUp(e)}),n.el.on("blur.autocomplete",function(){n.onBlur()}),n.el.on("focus.autocomplete",function(){n.onFocus()}),n.el.on("change.autocomplete",function(e){n.onKeyUp(e)}),n.el.on("input.autocomplete",function(e){n.onKeyUp(e)})},onFocus:function(){var e=this;e.fixPosition(),e.el.val().length>=e.options.minChars&&e.onValueChange()},onBlur:function(){this.enableKillerFn()},abortAjax:function(){var e=this;e.currentRequest&&(e.currentRequest.abort(),e.currentRequest=null)},setOptions:function(t){var s=this,n=s.options;e.extend(n,t),s.isLocal=e.isArray(n.lookup),s.isLocal&&(n.lookup=s.verifySuggestionsFormat(n.lookup)),n.orientation=s.validateOrientation(n.orientation,"bottom"),e(s.suggestionsContainer).css({"max-height":n.maxHeight+"px",width:n.width+"px","z-index":n.zIndex}),!0===n.showDetailsPanel&&jQuery(s.suggestionsContainer).parent().addClass("dgwt-wcas-is-details"),s.options.onSearchComplete=function(){s.preloader("hide",e("."+n.preloaderClass),"dgwt-wcas-inner-preloader"),s.preloader("show",e("."+n.preloaderClass),n.closeTrigger)}},clearCache:function(){this.cachedResponse={},this.cachedDetails={},this.badQueries=[]},clear:function(){this.clearCache(),this.currentValue="",this.suggestions=[]},disable:function(){var e=this;e.disabled=!0,clearInterval(e.onChangeInterval),e.abortAjax()},enable:function(){this.disabled=!1},fixPosition:function(){var t=this,s=(t.options,e(t.suggestionsContainer)),n=(e(t.detailsContainer),s.parent().get(0));if(n===document.body||t.options.forceFixPosition){var i=t.options.orientation,o=s.outerHeight(),a=t.el.outerHeight(),l=t.el.offset(),r={top:l.top,left:l.left};if("auto"===i){var u=e(window).height(),c=e(window).scrollTop(),d=-c+l.top-o,g=c+u-(l.top+a+o);i=Math.max(d,g)===d?"top":"bottom"}if(r.top+="top"===i?-o:a,n!==document.body){var h,p=s.css("opacity");t.visible||s.css("opacity",0).show(),h=s.offsetParent().offset(),r.top-=h.top,r.left-=h.left,t.visible||s.css("opacity",p).hide()}"auto"===t.options.width&&(r.width=t.el.outerWidth()-2+"px"),s.css(r)}},fixPositionDetailsBox:function(){var t=e(this.detailsContainer);if(0==t.length)return!1;var s=e(window).width(),n=t.parent(),i=t.prev(),o=t.width(),a=t.offset();n.width()>=550||(s<a.left+o&&(n.removeClass("dgwt-wcas-details-right"),n.addClass("dgwt-wcas-details-left"),t.css("left","-"+t.outerWidth()+"px")),a.left<1&&(n.removeClass("dgwt-wcas-details-left"),n.addClass("dgwt-wcas-details-right"),t.css("left",i.outerWidth()+"px")))},fixHeight:function(t,s){var n=this,i=n.options;if(1!=i.showDetailsPanel)return!1;var s,o=e("."+i.containerClass),a=e("."+i.containerDetailsClass),l=0,r=0;e("."+i.containerClass+"> *").each(function(){l+=e(this).outerHeight()}),e("."+i.containerDetailsClass+"> *").each(function(){r+=e(this).outerHeight()}),((s=l>=r?l:r)>l||s>r)&&(o.css("height",s+"px"),a.css("height",s+"px")),void 0===t&&(t=0),t<5?setTimeout(function(){n.fixHeight(t+1,s)},30):t=0},enableKillerFn:function(){var t=this;e(document).on("click.autocomplete",t.killerFn)},disableKillerFn:function(){var t=this;e(document).off("click.autocomplete",t.killerFn)},killSuggestions:function(){var t=this,s=e(t.suggestionsContainer).parent();t.stopKillSuggestions(),t.intervalId=window.setInterval(function(){t.visible&&(t.options.preserveInput||t.el.val(t.currentValue),t.hide(),s.removeClass("dgwt-wcas-open")),t.stopKillSuggestions()},50)},stopKillSuggestions:function(){window.clearInterval(this.intervalId)},isCursorAtEnd:function(){var e,t=this,s=t.el.val().length,n=t.element.selectionStart;return"number"==typeof n?n===s:!document.selection||((e=document.selection.createRange()).moveStart("character",-s),s===e.text.length)},onKeyPress:function(e){var t=this;if(t.disabled||t.visible||e.which!==n.DOWN||!t.currentValue){if(!t.disabled&&t.visible){switch(e.which){case n.ESC:t.el.val(t.currentValue),t.hide();break;case n.RIGHT:if(t.hint&&t.options.onHint&&t.isCursorAtEnd()){t.selectHint();break}return;case n.TAB:if(t.hint&&t.options.onHint)return void t.selectHint();if(-1===t.selectedIndex)return void t.hide();if(t.select(t.selectedIndex),!1===t.options.tabDisabled)return;break;case n.RETURN:if(-1===t.selectedIndex)return void t.hide();t.select(t.selectedIndex);break;case n.UP:t.moveUp();break;case n.DOWN:t.moveDown();break;default:return}e.stopImmediatePropagation(),e.preventDefault()}}else t.suggest()},onKeyUp:function(e){var t=this;if(!t.disabled){switch(e.which){case n.UP:case n.DOWN:return}clearInterval(t.onChangeInterval),t.currentValue!==t.el.val()&&(t.findBestHint(),t.options.deferRequestBy>0?t.onChangeInterval=setInterval(function(){t.onValueChange()},t.options.deferRequestBy):t.onValueChange())}},onValueChange:function(){var t=this,s=t.options,n=t.el.val(),i=t.getQuery(n);t.selection&&t.currentValue!==i&&(t.selection=null,(s.onInvalidateSelection||e.noop).call(t.element)),clearInterval(t.onChangeInterval),t.currentValue=n,t.selectedIndex=-1,s.triggerSelectOnValidInput&&t.isExactMatch(i)?t.select(0):i.length<s.minChars?(e("."+t.options.closeTrigger).removeClass(t.options.closeTrigger),t.hide()):t.getSuggestions(i)},isExactMatch:function(e){var t=this.suggestions;return 1===t.length&&t[0].value.toLowerCase()===e.toLowerCase()},getQuery:function(t){var s,n=this.options.delimiter;return n?(s=t.split(n),e.trim(s[s.length-1])):t},getSuggestionsLocal:function(t){var s,n=this.options,i=t.toLowerCase(),o=n.lookupFilter,a=parseInt(n.lookupLimit,10);return s={suggestions:e.grep(n.lookup,function(e){return o(e,t,i)})},a&&s.suggestions.length>a&&(s.suggestions=s.suggestions.slice(0,a)),s},getSuggestions:function(t){var s,n,i,o,a=this,l=a.options,r=l.serviceUrl;l.params[l.paramName]=t,n=l.ignoreParams?null:l.params,a.preloader("show",e("."+l.preloaderClass),"dgwt-wcas-inner-preloader"),!1!==l.onSearchStart.call(a.element,l.params)&&(e.isFunction(l.lookup)?l.lookup(t,function(e){a.suggestions=e.suggestions,a.suggest(),a.getDetails(e.suggestions[0]),l.onSearchComplete.call(a.element,t,e.suggestions)}):(a.isLocal?s=a.getSuggestionsLocal(t):(e.isFunction(r)&&(r=r.call(a.element,t)),i=r+"?"+e.param(n||{}),s=a.cachedResponse[i]),s&&e.isArray(s.suggestions)?(a.suggestions=s.suggestions,a.suggest(),a.getDetails(s.suggestions[0]),l.onSearchComplete.call(a.element,t,s.suggestions)):a.isBadQuery(t)?l.onSearchComplete.call(a.element,t,[]):(a.abortAjax(),o={url:r,data:n,type:l.type,dataType:l.dataType},e.extend(o,l.ajaxSettings),a.currentRequest=e.ajax(o).done(function(e){var s;a.currentRequest=null,void 0!==(s=l.transformResult(e,t)).suggestions&&(a.processResponse(s,t,i),a.getDetails(s.suggestions[0])),l.onSearchComplete.call(a.element,t,s.suggestions)}).fail(function(e,s,n){l.onSearchError.call(a.element,t,e,s,n)}))))},getDetails:function(t){var s=this,n=s.options;if(1!=n.showDetailsPanel||e(window).width()<992||"ontouchend"in document)return!1;if(null!=t){var i,o,a=e("."+n.containerDetailsClass);s.fixHeight();var l={action:dgwt_wcas.action_result_details,post_id:null!=t.post_id?t.post_id:0,term_id:null!=t.term_id?t.term_id:0,taxonomy:null!=t.taxonomy?t.taxonomy:"",value:null!=t.value?t.value:""};if(i=l.action+l.post_id+l.term_id+l.taxonomy,null!=(o=s.cachedDetails[i]))a.html(o.details),s.fixHeight(),s.fixPositionDetailsBox();else{if(a.html(""),s.preloader("show",a,"",!0),-1!=e.inArray(i,s.detailsRequestsSent))return;s.detailsRequestsSent.push(i),e.ajax({data:l,type:"post",url:dgwt_wcas.ajax_details_endpoint,success:function(e){var t="string"==typeof e?jQuery.parseJSON(e):e;s.cachedDetails[i]=t,s.preloader("hide",a,"",!0),null!=t.details?a.html(t.details):a.html("@TODO BŁĄD"),s.fixPositionDetailsBox(),s.fixHeight()},error:function(e,t){s.preloader("hide",a,"",!0),a.html(e),s.fixPositionDetailsBox(),s.fixHeight()}})}}},isBadQuery:function(e){if(!this.options.preventBadQueries)return!1;for(var t=this.badQueries,s=t.length;s--;)if(0===e.indexOf(t[s]))return!0;return!1},hide:function(){var t=this,s=e(t.suggestionsContainer);e(t.detailsContainer);e.isFunction(t.options.onHide)&&t.visible&&t.options.onHide.call(t.element,s),t.visible=!1,t.selectedIndex=-1,clearInterval(t.onChangeInterval),e(t.suggestionsContainer).hide(),e(t.detailsContainer).hide(),t.signalHint(null)},suggest:function(){if(this.suggestions.length){var t,s=this,n=s.options,i=n.groupBy,o=n.formatResult,a=s.getQuery(s.currentValue),l=s.classes.suggestion,r=s.classes.selected,u=e(s.suggestionsContainer),c=e(s.detailsContainer),d=e(s.noSuggestionsContainer),g=n.beforeRender,h="",p=function(e,s){var n=e.data[i];return t===n?"":'<div class="autocomplete-group"><strong>'+(t=n)+"</strong></div>"};n.triggerSelectOnValidInput&&s.isExactMatch(a)?s.select(0):(e.each(s.suggestions,function(e,t){var s="",r="",u=!1;i&&(h+=p(t,0)),void 0===t.post_id?(h+='<div class="'+l+' dgwt-wcas-nores" data-index="'+e+'">',h+='<span class="dgwt-wcas-st">'+t.value+"</span>",h+="</div>"):(void 0!==t.parents&&(s=t.parents),!0===n.showImage&&void 0!==t.thumb_html&&(u=!0),r+=void 0!==t.post_id?'data-post-id="'+t.post_id+'" ':"",r+=void 0!==t.taxonomy?'data-taxonomy="'+t.taxonomy+'" ':"",r+=void 0!==t.term_id?'data-term-id="'+t.term_id+'" ':"",h+='<div class="'+l+'" data-index="'+e+'" '+r+">",u&&(h+='<span class="dgwt-wcas-si">'+t.thumb_html+"</span>"),h+=u?'<div class="dgwt-wcas-content-wrapp">':"",h+='<span class="dgwt-wcas-st">',h+="<span>"+o(t.value,a)+s+"</span>",!0===n.showSKU&&void 0!==t.sku&&t.sku.length>0&&(h+='<span class="dgwt-wcas-sku">(SKU: '+o(t.sku,a)+")</span>"),h+="</span>",!0===n.showPrice&&void 0!==t.price&&(h+='<span class="dgwt-wcas-sp">'+t.price+"</span>"),!0===n.showDescription&&void 0!==t.desc&&(h+='<span class="dgwt-wcas-sd">'+o(t.desc,a)+"</span>"),!0===n.showFeaturedBadge&&!0===t.on_sale&&(h+='<span class="dgwt-wcas-badge dgwt-wcas-badge-os">'+n.saleBadgeText+"</span>"),!0===n.showFeaturedBadge&&!0===t.featured&&(h+='<span class="dgwt-wcas-badge dgwt-wcas-badge-f">'+n.featuredBadgeText+"</span>"),h+=u?"</div>":"",h+="</div>")}),this.adjustContainerWidth(),d.detach(),u.html(h),e.isFunction(g)&&g.call(s.element,u,s.suggestions),s.fixPosition(),u.show(),u.parent().addClass("dgwt-wcas-open"),!0===n.showDetailsPanel&&c.show(),n.autoSelectFirst&&(s.selectedIndex=0,u.scrollTop(0),u.children("."+l).first().addClass(r)),s.visible=!0,s.findBestHint())}else this.options.showNoSuggestionNotice?this.noSuggestions():this.hide()},noSuggestions:function(){var t=this,s=e(t.suggestionsContainer),n=e(t.noSuggestionsContainer);this.adjustContainerWidth(),n.detach(),s.empty(),s.append(n),t.fixPosition(),s.show(),t.visible=!0},adjustContainerWidth:function(){var t,s=this,n=s.options,i=e(s.suggestionsContainer).parent(),o=e(s.suggestionsContainer),a=e(s.detailsContainer);if("auto"===n.width&&(t=s.el.outerWidth(),o.css("width",t+"px")),i.width()>=550&&!0===n.showDetailsPanel)return i.addClass("dgwt-wcas-full-width"),o.outerWidth(300),a.innerWidth(i.width()-300),i.removeClass("dgwt-wcas-details-left"),i.removeClass("dgwt-wcas-details-right"),void(!0===n.is_rtl?(a.css("left","0"),o.css("right","0")):(a.css("right","0"),o.css("left","0")));"left"===n.cointainerDetailsPos?(a.parent().addClass("dgwt-wcas-details-left"),a.css("left","-"+a.outerWidth()+"px")):(a.parent().addClass("dgwt-wcas-details-right"),a.css("left",i.outerWidth()+"px"))},findBestHint:function(){var t=this,s=t.el.val().toLowerCase(),n=null;s&&(e.each(t.suggestions,function(e,t){var i=0===t.value.toLowerCase().indexOf(s);return i&&(n=t),!i}),t.signalHint(n))},signalHint:function(t){var s="",n=this;t&&(s=n.currentValue+t.value.substr(n.currentValue.length)),n.hintValue!==s&&(n.hintValue=s,n.hint=t,(this.options.onHint||e.noop)(s))},preloader:function(t,s,n,i){var o,a="dgwt-wcas-preloader-wrapp",l=null==n?a:a+" "+n;1==dgwt_wcas.show_preloader&&0!=s.length&&(!0===i?"hide"!==t?"show"===t&&(o='<div class="'+l+'"><div class="dgwt-wcas-default-preloader"></div></div>',s.html(o)):e(a).remove():"hide"===t?s.removeClass(n):s.addClass(n))},verifySuggestionsFormat:function(t){return t.length&&"string"==typeof t[0]?e.map(t,function(e){return{value:e,data:null}}):t},validateOrientation:function(t,s){return t=e.trim(t||"").toLowerCase(),-1===e.inArray(t,["auto","bottom","top"])&&(t=s),t},processResponse:function(e,t,s){var n=this,i=n.options;e.suggestions=n.verifySuggestionsFormat(e.suggestions),i.noCache||(n.cachedResponse[s]=e,i.preventBadQueries&&!e.suggestions.length&&n.badQueries.push(t)),t===n.getQuery(n.currentValue)&&(n.suggestions=e.suggestions,n.suggest())},activate:function(t){var s,n=this,i=n.classes.selected,o=e(n.suggestionsContainer),a=o.find("."+n.classes.suggestion);return o.find("."+i).removeClass(i),n.selectedIndex=t,-1!==n.selectedIndex&&a.length>n.selectedIndex?(s=a.get(n.selectedIndex),e(s).addClass(i),s):null},selectHint:function(){var t=this,s=e.inArray(t.hint,t.suggestions);t.select(s)},select:function(e){var t=this;t.hide(),t.onSelect(e),t.disableKillerFn()},moveUp:function(){var t=this;if(-1!==t.selectedIndex)return 0===t.selectedIndex?(e(t.suggestionsContainer).children().first().removeClass(t.classes.selected),t.selectedIndex=-1,t.el.val(t.currentValue),void t.findBestHint()):void t.adjustScroll(t.selectedIndex-1)},moveDown:function(){var e=this;e.selectedIndex!==e.suggestions.length-1&&e.adjustScroll(e.selectedIndex+1)},adjustScroll:function(t){var s=this,n=s.activate(t);if(n){var i,o,a,l=e(n).outerHeight();i=n.offsetTop,a=(o=e(s.suggestionsContainer).scrollTop())+s.options.maxHeight-l,i<o?e(s.suggestionsContainer).scrollTop(i):i>a&&e(s.suggestionsContainer).scrollTop(i-s.options.maxHeight+l),s.options.preserveInput||s.el.val(s.getValue(s.suggestions[t].value)),s.signalHint(null)}},onSelect:function(t){var s=this,n=s.options.onSelect,i=s.suggestions[t];s.currentValue=s.getValue(i.value),s.currentValue===s.el.val()||s.options.preserveInput||s.el.val(s.currentValue),-1!=i.id&&(window.location.href=i.url),s.signalHint(null),s.suggestions=[],s.selection=i,e.isFunction(n)&&n.call(s.element,i)},onMouseOver:function(t){var s=this,n=s.options.onMouseOver,i=s.suggestions[t];s.selectedIndex!==t&&s.getDetails(i),e.isFunction(n)&&n.call(s.element,i)},onMouseLeave:function(t){var s=this,n=s.options.onMouseLeave,i=s.suggestions[t];e.isFunction(n)&&n.call(s.element,i)},getValue:function(e){var t,s,n=this,i=n.options.delimiter;return i?(t=n.currentValue,s=t.split(i),1===s.length?e:t.substr(0,t.length-s[s.length-1].length)+e):e},dispose:function(){var t=this;t.el.off(".autocomplete").removeData("autocomplete"),t.disableKillerFn(),e(window).off("resize.autocomplete",t.fixPositionCapture),e(t.suggestionsContainer).remove()}},e.fn.dgwtWcasAutocomplete=function(s,n){return arguments.length?this.each(function(){var i=e(this),o=i.data("autocomplete");"string"==typeof s?o&&"function"==typeof o[s]&&o[s](n):(o&&o.dispose&&o.dispose(),o=new t(this,s),i.data("autocomplete",o))}):this.first().data("autocomplete")},function(){e(document).ready(function(){e(".dgwt-wcas-search-submit").length>0&&e(".dgwt-wcas-preloader").css("right",e(".dgwt-wcas-search-submit").outerWidth()+"px");var t=1==dgwt_wcas.show_details_box;(jQuery(window).width()<992||"ontouchend"in document)&&(t=!1),e(".dgwt-wcas-search-input").dgwtWcasAutocomplete({minChars:dgwt_wcas.min_chars,width:dgwt_wcas.sug_width,autoSelectFirst:!1,triggerSelectOnValidInput:!1,serviceUrl:dgwt_wcas.ajax_search_endpoint,paramName:"dgwt_wcas_keyword",showDetailsPanel:t,showImage:1==dgwt_wcas.show_images,showPrice:1==dgwt_wcas.show_price,showDescription:1==dgwt_wcas.show_desc,showSKU:1==dgwt_wcas.show_sku,showSaleBadge:1==dgwt_wcas.show_sale_badge,showFeaturedBadge:1==dgwt_wcas.show_featured_badge,saleBadgeText:dgwt_wcas.t.sale_badge,featuredBadgeText:dgwt_wcas.t.featured_badge,cointainerDetailsPos:dgwt_wcas.details_box_pos,is_rtl:1==dgwt_wcas.is_rtl})})}()});
 
 
 
 
 
 
 
 
 
includes/admin/admin-menus.php CHANGED
@@ -20,7 +20,7 @@ class DGWT_WCAS_Admin_Menu {
20
  */
21
  public function add_menu() {
22
 
23
- add_menu_page( __( 'Ajax Search for WooCommerce', DGWT_WCAS_DOMAIN ), __( 'Woo Ajax Search', DGWT_WCAS_DOMAIN ), 'manage_options', 'dgwt_wcas_settings', array( $this, 'settings_page' ), DGWT_WCAS_URL . '/assets/img/admin-icon.svg', 56);
24
  }
25
 
26
  /**
20
  */
21
  public function add_menu() {
22
 
23
+ add_menu_page( __( 'Ajax Search for WooCommerce', 'ajax-search-for-woocommerce' ), __( 'Woo Ajax Search', 'ajax-search-for-woocommerce' ), 'manage_options', 'dgwt_wcas_settings', array( $this, 'settings_page' ), DGWT_WCAS_URL . '/assets/img/admin-icon.svg', 56);
24
  }
25
 
26
  /**
includes/admin/settings/class-settings.php CHANGED
@@ -66,23 +66,23 @@ class DGWT_WCAS_Settings {
66
  $sections = array(
67
  array(
68
  'id' => 'dgwt_wcas_basic',
69
- 'title' => __( 'Basic', DGWT_WCAS_DOMAIN )
70
  ),
71
  array(
72
  'id' => 'dgwt_wcas_advanced',
73
- 'title' => __( 'Advanced', DGWT_WCAS_DOMAIN )
74
  ),
75
  array(
76
  'id' => 'dgwt_wcas_details_box',
77
- 'title' => __( 'Extra Details', DGWT_WCAS_DOMAIN )
78
  ),
79
  array(
80
  'id' => 'dgwt_wcas_style',
81
- 'title' => __( 'Style', DGWT_WCAS_DOMAIN )
82
  ),
83
  // array(
84
  // 'id' => 'dgwt_wcas_performance',
85
- // 'title' => __( 'Performance', DGWT_WCAS_DOMAIN )
86
  // )
87
  );
88
  return apply_filters( 'dgwt_wcas_settings_sections', $sections );
@@ -97,136 +97,141 @@ class DGWT_WCAS_Settings {
97
  $settings_fields = array(
98
  'dgwt_wcas_basic' => apply_filters( 'dgwt_wcas_basic_settings', array(
99
  array(
100
- 'name' => 'how_to_use',
101
- 'label' => __( 'How to use?', DGWT_WCAS_DOMAIN ),
102
- 'type' => 'desc',
103
- 'desc' => dgwt_wcas_how_to_use_html(),
104
  ),
105
  array(
106
  'name' => 'suggestions_limit',
107
- 'label' => __( 'Suggestions limit', DGWT_WCAS_DOMAIN ),
108
  'type' => 'number',
109
  'size' => 'small',
110
- 'desc' => __( 'Maximum number of suggestions rows.', DGWT_WCAS_DOMAIN ),
111
  'default' => 10,
112
  ),
113
  array(
114
  'name' => 'min_chars',
115
- 'label' => __( 'Minimum characters', DGWT_WCAS_DOMAIN ),
116
  'type' => 'number',
117
  'size' => 'small',
118
- 'desc' => __( 'Minimum number of characters required to trigger autosuggest.', DGWT_WCAS_DOMAIN ),
119
  'default' => 3,
120
  ),
121
  array(
122
  'name' => 'show_submit_button',
123
- 'label' => __( 'Show submit button', DGWT_WCAS_DOMAIN ),
124
  'type' => 'checkbox',
125
  'size' => 'small',
126
  'default' => 'off',
127
  ),
128
  array(
129
  'name' => 'search_submit_text',
130
- 'label' => __( 'Search submit button text', DGWT_WCAS_DOMAIN ),
131
  'type' => 'text',
132
- 'desc' => __( 'To display a loupe icon leave this field empty.', DGWT_WCAS_DOMAIN ),
133
- 'default' => __( 'Search', DGWT_WCAS_DOMAIN ),
134
  ),
135
  array(
136
  'name' => 'search_placeholder',
137
- 'label' => __( 'Search input placeholder', DGWT_WCAS_DOMAIN ),
138
  'type' => 'text',
139
- 'default' => __( 'Search for products...', DGWT_WCAS_DOMAIN ),
140
  ),
141
  array(
142
  'name' => 'show_details_box',
143
- 'label' => __( 'Show details box', DGWT_WCAS_DOMAIN ),
144
  'type' => 'checkbox',
145
  'size' => 'small',
146
- 'desc' => __( 'The Details box is an additional container for extended information. The details are changed dynamically when you hover the mouse over one of the suggestions.', DGWT_WCAS_DOMAIN ),
147
  'default' => 'off',
148
  )
149
  ) ),
150
  'dgwt_wcas_advanced' => apply_filters( 'dgwt_wcas_advanced_settings', array(
151
  array(
152
  'name' => 'search_head',
153
- 'label' => '<h3>' . __( 'Search scope', DGWT_WCAS_DOMAIN ) . '</h3>',
154
  'type' => 'head',
155
  ),
156
  array(
157
  'name' => 'search_in_product_content',
158
- 'label' => __( 'Search in products content', DGWT_WCAS_DOMAIN ),
159
  'type' => 'checkbox',
160
  'default' => 'off',
161
  ),
162
  array(
163
  'name' => 'search_in_product_excerpt',
164
- 'label' => __( 'Search in products excerpt', DGWT_WCAS_DOMAIN ),
165
  'type' => 'checkbox',
166
  'default' => 'off',
167
  ),
168
  array(
169
- 'name' => 'search_in_woo_categories',
170
- 'label' => __( 'Search in products categories', DGWT_WCAS_DOMAIN ),
171
  'type' => 'checkbox',
172
- 'default' => 'on',
173
  ),
174
  array(
175
- 'name' => 'search_in_woo_tags',
176
- 'label' => __( 'Search in products tags', DGWT_WCAS_DOMAIN ),
177
  'type' => 'checkbox',
178
  'default' => 'off',
179
  ),
180
  array(
181
- 'name' => 'search_in_product_sku',
182
- 'label' => __( 'Search in products SKU', DGWT_WCAS_DOMAIN ),
 
 
 
 
 
183
  'type' => 'checkbox',
184
- 'default' => 'off',
185
  ),
186
  array(
187
- 'name' => 'exclude_out_of_stock',
188
- 'label' => __( "Exclude 'out of stock' products", DGWT_WCAS_DOMAIN ),
189
  'type' => 'checkbox',
190
  'default' => 'off',
191
  ),
192
  array(
193
  'name' => 'product_suggestion_head',
194
- 'label' => '<h3>' . __( 'Suggestions output', DGWT_WCAS_DOMAIN ) . '</h3>',
195
  'type' => 'head',
196
  ),
197
  array(
198
  'name' => 'show_product_image',
199
- 'label' => __( 'Show product image', DGWT_WCAS_DOMAIN ),
200
  'type' => 'checkbox',
201
  'default' => 'off',
202
  ),
203
  array(
204
  'name' => 'show_product_price',
205
- 'label' => __( 'Show price', DGWT_WCAS_DOMAIN ),
206
  'type' => 'checkbox',
207
  'default' => 'off',
208
  ),
209
  array(
210
  'name' => 'show_product_desc',
211
- 'label' => __( 'Show product description', DGWT_WCAS_DOMAIN ),
212
  'type' => 'checkbox',
213
  'default' => 'off',
214
  ),
215
  array(
216
  'name' => 'show_product_sku',
217
- 'label' => __( 'Show SKU', DGWT_WCAS_DOMAIN ),
218
  'type' => 'checkbox',
219
  'default' => 'off',
220
  ),
221
  // array(
222
  // 'name' => 'show_sale_badge',
223
- // 'label' => __( 'Show sale badge', DGWT_WCAS_DOMAIN ),
224
  // 'type' => 'checkbox',
225
  // 'default' => 'off',
226
  // ),
227
  // array(
228
  // 'name' => 'show_featured_badge',
229
- // 'label' => __( 'Show featured badge', DGWT_WCAS_DOMAIN ),
230
  // 'type' => 'checkbox',
231
  // 'default' => 'off',
232
  // ),
@@ -234,55 +239,55 @@ class DGWT_WCAS_Settings {
234
  'dgwt_wcas_details_box' => apply_filters( 'dgwt_wcas_details_box_settings', array(
235
  array(
236
  'name' => 'tax_details_tax_head',
237
- 'label' => '<h3>' . __( 'Category and tag details:', DGWT_WCAS_DOMAIN ) . '</h3>',
238
  'type' => 'head',
239
  ),
240
  array(
241
  'name' => 'show_for_tax',
242
- 'label' => __( 'Show', DGWT_WCAS_DOMAIN ),
243
  'type' => 'select',
244
  'options' => array(
245
- 'all' => __( 'All Product', DGWT_WCAS_DOMAIN ),
246
- 'featured' => __( 'Featured Products', DGWT_WCAS_DOMAIN ),
247
- 'onsale' => __( 'On-sale Products', DGWT_WCAS_DOMAIN ),
248
  ),
249
  'default' => 'on',
250
  ),
251
  array(
252
  'name' => 'orderby_for_tax',
253
- 'label' => __( 'Order by', DGWT_WCAS_DOMAIN ),
254
  'type' => 'select',
255
  'options' => array(
256
- 'date' => __( 'Date', DGWT_WCAS_DOMAIN ),
257
- 'price' => __( 'Price', DGWT_WCAS_DOMAIN ),
258
- 'rand' => __( 'Random', DGWT_WCAS_DOMAIN ),
259
- 'sales' => __( 'Sales', DGWT_WCAS_DOMAIN ),
260
  ),
261
  'default' => 'on',
262
  ),
263
  array(
264
  'name' => 'order_for_tax',
265
- 'label' => __( 'Order by', DGWT_WCAS_DOMAIN ),
266
  'type' => 'select',
267
  'options' => array(
268
- 'desc' => __( 'DESC', DGWT_WCAS_DOMAIN ),
269
- 'asc' => __( 'ASC', DGWT_WCAS_DOMAIN ),
270
  ),
271
  'default' => 'desc',
272
  ),
273
  array(
274
  'name' => 'tax_details_product_other',
275
- 'label' => '<h3>' . __( 'Other', DGWT_WCAS_DOMAIN ) . '</h3>',
276
  'type' => 'head',
277
  ),
278
  array(
279
  'name' => 'details_box_position',
280
- 'label' => __( 'Details box position', DGWT_WCAS_DOMAIN ),
281
  'type' => 'select',
282
- 'desc' => __( 'If your search form is very close to the right window screen, then select left.', DGWT_WCAS_DOMAIN ),
283
  'options' => array(
284
- 'left' => __( 'Left', DGWT_WCAS_DOMAIN ),
285
- 'right' => __( 'Right', DGWT_WCAS_DOMAIN ),
286
  ),
287
  'default' => 'right',
288
  )
@@ -290,96 +295,96 @@ class DGWT_WCAS_Settings {
290
  'dgwt_wcas_style' => apply_filters( 'dgwt_wcas_style_settings', array(
291
  array(
292
  'name' => 'search_form',
293
- 'label' => '<h3>' . __( 'Search form', DGWT_WCAS_DOMAIN ) . '</h3>',
294
  'type' => 'head',
295
  ),
296
  array(
297
  'name' => 'bg_input_color',
298
- 'label' => __( 'Search input background', DGWT_WCAS_DOMAIN ),
299
  'type' => 'color',
300
  'default' => '',
301
  ),
302
  array(
303
  'name' => 'text_input_color',
304
- 'label' => __( 'Search input text', DGWT_WCAS_DOMAIN ),
305
  'type' => 'color',
306
  'default' => '',
307
  ),
308
  array(
309
  'name' => 'border_input_color',
310
- 'label' => __( 'Search input border', DGWT_WCAS_DOMAIN ),
311
  'type' => 'color',
312
  'default' => '',
313
  ),
314
  array(
315
  'name' => 'bg_submit_color',
316
- 'label' => __( 'Search submit background', DGWT_WCAS_DOMAIN ),
317
  'type' => 'color',
318
  'default' => '',
319
  ),
320
  array(
321
  'name' => 'text_submit_color',
322
- 'label' => __( 'Search submit text', DGWT_WCAS_DOMAIN ),
323
  'type' => 'color',
324
  'default' => '',
325
  ),
326
  array(
327
  'name' => 'syggestions_style_head',
328
- 'label' => '<h3>' . __( 'Suggestions', DGWT_WCAS_DOMAIN ) . '</h3>',
329
  'type' => 'head',
330
  ),
331
  array(
332
  'name' => 'sug_bg_color',
333
- 'label' => __( 'Suggestion background', DGWT_WCAS_DOMAIN ),
334
  'type' => 'color',
335
  'default' => '',
336
  ),
337
  array(
338
  'name' => 'sug_hover_color',
339
- 'label' => __( 'Suggestion selected', DGWT_WCAS_DOMAIN ),
340
  'type' => 'color',
341
  'default' => '',
342
  ),
343
  array(
344
  'name' => 'sug_text_color',
345
- 'label' => __( 'Text color', DGWT_WCAS_DOMAIN ),
346
  'type' => 'color',
347
  'default' => '',
348
  ),
349
  array(
350
  'name' => 'sug_highlight_color',
351
- 'label' => __( 'Highlight color', DGWT_WCAS_DOMAIN ),
352
  'type' => 'color',
353
  'default' => '',
354
  ),
355
  array(
356
  'name' => 'sug_border_color',
357
- 'label' => __( 'Border color', DGWT_WCAS_DOMAIN ),
358
  'type' => 'color',
359
  'default' => '',
360
  ),
361
  array(
362
  'name' => 'sug_width',
363
- 'label' => __( 'Suggestions width', DGWT_WCAS_DOMAIN ),
364
  'type' => 'number',
365
  'size' => 'small',
366
- 'desc' => ' px. ' . __( 'Overvrite the suggestions container width. Leave this field empty to adjust the suggestions container width to the search input width.', DGWT_WCAS_DOMAIN ),
367
  'default' => '',
368
  ),
369
  array(
370
  'name' => 'preloader',
371
- 'label' => '<h3>' . __( 'Preloader', DGWT_WCAS_DOMAIN ) . '</h3>',
372
  'type' => 'head',
373
  ),
374
  array(
375
  'name' => 'show_preloader',
376
- 'label' => __( 'Show preloader', DGWT_WCAS_DOMAIN ),
377
  'type' => 'checkbox',
378
  'default' => 'on',
379
  ),
380
  array(
381
  'name' => 'preloader_url',
382
- 'label' => __( 'Upload preloader image', DGWT_WCAS_DOMAIN ),
383
  'type' => 'file',
384
  'default' => '',
385
  ),
@@ -404,10 +409,10 @@ class DGWT_WCAS_Settings {
404
  $value = '';
405
 
406
  if ( is_string( $option_key ) && !empty( $option_key ) ) {
407
-
408
  $settings = get_option( $this->setting_slug );
409
 
410
- if ( is_array($settings) && array_key_exists( $option_key, $settings ) ) {
411
  $value = $settings[ $option_key ];
412
  } else {
413
 
@@ -449,15 +454,14 @@ add_filter( 'dgwt_wcas_settings_sections', 'dgwt_wcas_hide_settings_detials_tab'
449
  function dgwt_wcas_hide_settings_detials_tab( $sections ) {
450
 
451
  if ( DGWT_WCAS()->settings->get_opt( 'show_details_box' ) !== 'on' && is_array( $sections ) ) {
452
-
453
  $i = 0;
454
  foreach ( $sections as $section ) {
455
 
456
  if ( isset( $section[ 'id' ] ) && $section[ 'id' ] === 'dgwt_wcas_details_box' ) {
457
  unset( $sections[ $i ] );
458
-
459
  }
460
-
461
  $i++;
462
  }
463
  }
66
  $sections = array(
67
  array(
68
  'id' => 'dgwt_wcas_basic',
69
+ 'title' => __( 'Basic', 'ajax-search-for-woocommerce' )
70
  ),
71
  array(
72
  'id' => 'dgwt_wcas_advanced',
73
+ 'title' => __( 'Advanced', 'ajax-search-for-woocommerce' )
74
  ),
75
  array(
76
  'id' => 'dgwt_wcas_details_box',
77
+ 'title' => __( 'Extra Details', 'ajax-search-for-woocommerce' )
78
  ),
79
  array(
80
  'id' => 'dgwt_wcas_style',
81
+ 'title' => __( 'Style', 'ajax-search-for-woocommerce' )
82
  ),
83
  // array(
84
  // 'id' => 'dgwt_wcas_performance',
85
+ // 'title' => __( 'Performance', 'ajax-search-for-woocommerce' )
86
  // )
87
  );
88
  return apply_filters( 'dgwt_wcas_settings_sections', $sections );
97
  $settings_fields = array(
98
  'dgwt_wcas_basic' => apply_filters( 'dgwt_wcas_basic_settings', array(
99
  array(
100
+ 'name' => 'how_to_use',
101
+ 'label' => __( 'How to use?', 'ajax-search-for-woocommerce' ),
102
+ 'type' => 'desc',
103
+ 'desc' => dgwt_wcas_how_to_use_html(),
104
  ),
105
  array(
106
  'name' => 'suggestions_limit',
107
+ 'label' => __( 'Suggestions limit', 'ajax-search-for-woocommerce' ),
108
  'type' => 'number',
109
  'size' => 'small',
110
+ 'desc' => __( 'Maximum number of suggestions rows.', 'ajax-search-for-woocommerce' ),
111
  'default' => 10,
112
  ),
113
  array(
114
  'name' => 'min_chars',
115
+ 'label' => __( 'Minimum characters', 'ajax-search-for-woocommerce' ),
116
  'type' => 'number',
117
  'size' => 'small',
118
+ 'desc' => __( 'Minimum number of characters required to trigger autosuggest.', 'ajax-search-for-woocommerce' ),
119
  'default' => 3,
120
  ),
121
  array(
122
  'name' => 'show_submit_button',
123
+ 'label' => __( 'Show submit button', 'ajax-search-for-woocommerce' ),
124
  'type' => 'checkbox',
125
  'size' => 'small',
126
  'default' => 'off',
127
  ),
128
  array(
129
  'name' => 'search_submit_text',
130
+ 'label' => __( 'Search submit button text', 'ajax-search-for-woocommerce' ),
131
  'type' => 'text',
132
+ 'desc' => __( 'To display a loupe icon leave this field empty.', 'ajax-search-for-woocommerce' ),
133
+ 'default' => __( 'Search', 'ajax-search-for-woocommerce' ),
134
  ),
135
  array(
136
  'name' => 'search_placeholder',
137
+ 'label' => __( 'Search input placeholder', 'ajax-search-for-woocommerce' ),
138
  'type' => 'text',
139
+ 'default' => __( 'Search for products...', 'ajax-search-for-woocommerce' ),
140
  ),
141
  array(
142
  'name' => 'show_details_box',
143
+ 'label' => __( 'Show details box', 'ajax-search-for-woocommerce' ),
144
  'type' => 'checkbox',
145
  'size' => 'small',
146
+ 'desc' => __( 'The Details box is an additional container for extended information. The details are changed dynamically when you hover the mouse over one of the suggestions.', 'ajax-search-for-woocommerce' ),
147
  'default' => 'off',
148
  )
149
  ) ),
150
  'dgwt_wcas_advanced' => apply_filters( 'dgwt_wcas_advanced_settings', array(
151
  array(
152
  'name' => 'search_head',
153
+ 'label' => '<h3>' . __( 'Product search', 'ajax-search-for-woocommerce' ) . '</h3>',
154
  'type' => 'head',
155
  ),
156
  array(
157
  'name' => 'search_in_product_content',
158
+ 'label' => __( 'Search in products content', 'ajax-search-for-woocommerce' ),
159
  'type' => 'checkbox',
160
  'default' => 'off',
161
  ),
162
  array(
163
  'name' => 'search_in_product_excerpt',
164
+ 'label' => __( 'Search in products excerpt', 'ajax-search-for-woocommerce' ),
165
  'type' => 'checkbox',
166
  'default' => 'off',
167
  ),
168
  array(
169
+ 'name' => 'search_in_product_sku',
170
+ 'label' => __( 'Search in products SKU', 'ajax-search-for-woocommerce' ),
171
  'type' => 'checkbox',
172
+ 'default' => 'off',
173
  ),
174
  array(
175
+ 'name' => 'exclude_out_of_stock',
176
+ 'label' => __( "Exclude 'out of stock' products", 'ajax-search-for-woocommerce' ),
177
  'type' => 'checkbox',
178
  'default' => 'off',
179
  ),
180
  array(
181
+ 'name' => 'search_in_taxonomy_head',
182
+ 'label' => '<h3>' . __( 'Taxonomy search', 'ajax-search-for-woocommerce' ) . '</h3>',
183
+ 'type' => 'head',
184
+ ),
185
+ array(
186
+ 'name' => 'show_matching_categories',
187
+ 'label' => __( 'Show matching categories', 'ajax-search-for-woocommerce' ),
188
  'type' => 'checkbox',
189
+ 'default' => 'on',
190
  ),
191
  array(
192
+ 'name' => 'show_matching_tags',
193
+ 'label' => __( 'Show matching tags', 'ajax-search-for-woocommerce' ),
194
  'type' => 'checkbox',
195
  'default' => 'off',
196
  ),
197
  array(
198
  'name' => 'product_suggestion_head',
199
+ 'label' => '<h3>' . __( 'Suggestions output', 'ajax-search-for-woocommerce' ) . '</h3>',
200
  'type' => 'head',
201
  ),
202
  array(
203
  'name' => 'show_product_image',
204
+ 'label' => __( 'Show product image', 'ajax-search-for-woocommerce' ),
205
  'type' => 'checkbox',
206
  'default' => 'off',
207
  ),
208
  array(
209
  'name' => 'show_product_price',
210
+ 'label' => __( 'Show price', 'ajax-search-for-woocommerce' ),
211
  'type' => 'checkbox',
212
  'default' => 'off',
213
  ),
214
  array(
215
  'name' => 'show_product_desc',
216
+ 'label' => __( 'Show product description', 'ajax-search-for-woocommerce' ),
217
  'type' => 'checkbox',
218
  'default' => 'off',
219
  ),
220
  array(
221
  'name' => 'show_product_sku',
222
+ 'label' => __( 'Show SKU', 'ajax-search-for-woocommerce' ),
223
  'type' => 'checkbox',
224
  'default' => 'off',
225
  ),
226
  // array(
227
  // 'name' => 'show_sale_badge',
228
+ // 'label' => __( 'Show sale badge', 'ajax-search-for-woocommerce' ),
229
  // 'type' => 'checkbox',
230
  // 'default' => 'off',
231
  // ),
232
  // array(
233
  // 'name' => 'show_featured_badge',
234
+ // 'label' => __( 'Show featured badge', 'ajax-search-for-woocommerce' ),
235
  // 'type' => 'checkbox',
236
  // 'default' => 'off',
237
  // ),
239
  'dgwt_wcas_details_box' => apply_filters( 'dgwt_wcas_details_box_settings', array(
240
  array(
241
  'name' => 'tax_details_tax_head',
242
+ 'label' => '<h3>' . __( 'Category and tag details:', 'ajax-search-for-woocommerce' ) . '</h3>',
243
  'type' => 'head',
244
  ),
245
  array(
246
  'name' => 'show_for_tax',
247
+ 'label' => __( 'Show', 'ajax-search-for-woocommerce' ),
248
  'type' => 'select',
249
  'options' => array(
250
+ 'all' => __( 'All Product', 'ajax-search-for-woocommerce' ),
251
+ 'featured' => __( 'Featured Products', 'ajax-search-for-woocommerce' ),
252
+ 'onsale' => __( 'On-sale Products', 'ajax-search-for-woocommerce' ),
253
  ),
254
  'default' => 'on',
255
  ),
256
  array(
257
  'name' => 'orderby_for_tax',
258
+ 'label' => __( 'Order by', 'ajax-search-for-woocommerce' ),
259
  'type' => 'select',
260
  'options' => array(
261
+ 'date' => __( 'Date', 'ajax-search-for-woocommerce' ),
262
+ 'price' => __( 'Price', 'ajax-search-for-woocommerce' ),
263
+ 'rand' => __( 'Random', 'ajax-search-for-woocommerce' ),
264
+ 'sales' => __( 'Sales', 'ajax-search-for-woocommerce' ),
265
  ),
266
  'default' => 'on',
267
  ),
268
  array(
269
  'name' => 'order_for_tax',
270
+ 'label' => __( 'Order by', 'ajax-search-for-woocommerce' ),
271
  'type' => 'select',
272
  'options' => array(
273
+ 'desc' => __( 'DESC', 'ajax-search-for-woocommerce' ),
274
+ 'asc' => __( 'ASC', 'ajax-search-for-woocommerce' ),
275
  ),
276
  'default' => 'desc',
277
  ),
278
  array(
279
  'name' => 'tax_details_product_other',
280
+ 'label' => '<h3>' . __( 'Other', 'ajax-search-for-woocommerce' ) . '</h3>',
281
  'type' => 'head',
282
  ),
283
  array(
284
  'name' => 'details_box_position',
285
+ 'label' => __( 'Details box position', 'ajax-search-for-woocommerce' ),
286
  'type' => 'select',
287
+ 'desc' => __( 'If your search form is very close to the right window screen, then select left.', 'ajax-search-for-woocommerce' ),
288
  'options' => array(
289
+ 'left' => __( 'Left', 'ajax-search-for-woocommerce' ),
290
+ 'right' => __( 'Right', 'ajax-search-for-woocommerce' ),
291
  ),
292
  'default' => 'right',
293
  )
295
  'dgwt_wcas_style' => apply_filters( 'dgwt_wcas_style_settings', array(
296
  array(
297
  'name' => 'search_form',
298
+ 'label' => '<h3>' . __( 'Search form', 'ajax-search-for-woocommerce' ) . '</h3>',
299
  'type' => 'head',
300
  ),
301
  array(
302
  'name' => 'bg_input_color',
303
+ 'label' => __( 'Search input background', 'ajax-search-for-woocommerce' ),
304
  'type' => 'color',
305
  'default' => '',
306
  ),
307
  array(
308
  'name' => 'text_input_color',
309
+ 'label' => __( 'Search input text', 'ajax-search-for-woocommerce' ),
310
  'type' => 'color',
311
  'default' => '',
312
  ),
313
  array(
314
  'name' => 'border_input_color',
315
+ 'label' => __( 'Search input border', 'ajax-search-for-woocommerce' ),
316
  'type' => 'color',
317
  'default' => '',
318
  ),
319
  array(
320
  'name' => 'bg_submit_color',
321
+ 'label' => __( 'Search submit background', 'ajax-search-for-woocommerce' ),
322
  'type' => 'color',
323
  'default' => '',
324
  ),
325
  array(
326
  'name' => 'text_submit_color',
327
+ 'label' => __( 'Search submit text', 'ajax-search-for-woocommerce' ),
328
  'type' => 'color',
329
  'default' => '',
330
  ),
331
  array(
332
  'name' => 'syggestions_style_head',
333
+ 'label' => '<h3>' . __( 'Suggestions', 'ajax-search-for-woocommerce' ) . '</h3>',
334
  'type' => 'head',
335
  ),
336
  array(
337
  'name' => 'sug_bg_color',
338
+ 'label' => __( 'Suggestion background', 'ajax-search-for-woocommerce' ),
339
  'type' => 'color',
340
  'default' => '',
341
  ),
342
  array(
343
  'name' => 'sug_hover_color',
344
+ 'label' => __( 'Suggestion selected', 'ajax-search-for-woocommerce' ),
345
  'type' => 'color',
346
  'default' => '',
347
  ),
348
  array(
349
  'name' => 'sug_text_color',
350
+ 'label' => __( 'Text color', 'ajax-search-for-woocommerce' ),
351
  'type' => 'color',
352
  'default' => '',
353
  ),
354
  array(
355
  'name' => 'sug_highlight_color',
356
+ 'label' => __( 'Highlight color', 'ajax-search-for-woocommerce' ),
357
  'type' => 'color',
358
  'default' => '',
359
  ),
360
  array(
361
  'name' => 'sug_border_color',
362
+ 'label' => __( 'Border color', 'ajax-search-for-woocommerce' ),
363
  'type' => 'color',
364
  'default' => '',
365
  ),
366
  array(
367
  'name' => 'sug_width',
368
+ 'label' => __( 'Suggestions width', 'ajax-search-for-woocommerce' ),
369
  'type' => 'number',
370
  'size' => 'small',
371
+ 'desc' => ' px. ' . __( 'Overvrite the suggestions container width. Leave this field empty to adjust the suggestions container width to the search input width.', 'ajax-search-for-woocommerce' ),
372
  'default' => '',
373
  ),
374
  array(
375
  'name' => 'preloader',
376
+ 'label' => '<h3>' . __( 'Preloader', 'ajax-search-for-woocommerce' ) . '</h3>',
377
  'type' => 'head',
378
  ),
379
  array(
380
  'name' => 'show_preloader',
381
+ 'label' => __( 'Show preloader', 'ajax-search-for-woocommerce' ),
382
  'type' => 'checkbox',
383
  'default' => 'on',
384
  ),
385
  array(
386
  'name' => 'preloader_url',
387
+ 'label' => __( 'Upload preloader image', 'ajax-search-for-woocommerce' ),
388
  'type' => 'file',
389
  'default' => '',
390
  ),
409
  $value = '';
410
 
411
  if ( is_string( $option_key ) && !empty( $option_key ) ) {
412
+
413
  $settings = get_option( $this->setting_slug );
414
 
415
+ if ( is_array( $settings ) && array_key_exists( $option_key, $settings ) ) {
416
  $value = $settings[ $option_key ];
417
  } else {
418
 
454
  function dgwt_wcas_hide_settings_detials_tab( $sections ) {
455
 
456
  if ( DGWT_WCAS()->settings->get_opt( 'show_details_box' ) !== 'on' && is_array( $sections ) ) {
457
+
458
  $i = 0;
459
  foreach ( $sections as $section ) {
460
 
461
  if ( isset( $section[ 'id' ] ) && $section[ 'id' ] === 'dgwt_wcas_details_box' ) {
462
  unset( $sections[ $i ] );
 
463
  }
464
+
465
  $i++;
466
  }
467
  }
includes/admin/views/how-to-use.php CHANGED
@@ -1,4 +1,4 @@
1
 
2
- <h4><?php _e( 'There are two easy ways to display the search form', DGWT_WCAS_DOMAIN ); ?>: </h4>
3
- <p>1. <?php printf(__( 'Use shorcode %s', DGWT_WCAS_DOMAIN ), '<code>[wcas-search-form]</code>'); ?></p>
4
- <p>2. <?php printf(__( 'Go to the %s and choose "Woo Ajax Search"', DGWT_WCAS_DOMAIN ), '<a href="'. admin_url('widgets.php').'">' . __( 'Widgets Screen', DGWT_WCAS_DOMAIN ) . '</a>') ?>
1
 
2
+ <h4><?php _e( 'There are two easy ways to display the search form', 'ajax-search-for-woocommerce' ); ?>: </h4>
3
+ <p>1. <?php printf(__( 'Use a shortcode %s', 'ajax-search-for-woocommerce' ), '<code>[wcas-search-form]</code>'); ?></p>
4
+ <p>2. <?php printf(__( 'Go to the %s and choose "Woo Ajax Search"', 'ajax-search-for-woocommerce' ), '<a href="'. admin_url('widgets.php').'">' . __( 'Widgets Screen', 'ajax-search-for-woocommerce' ) . '</a>') ?>
includes/admin/views/settings.php CHANGED
@@ -6,7 +6,7 @@ if ( !defined( 'ABSPATH' ) )
6
 
7
  <div class="wrap">
8
 
9
- <h2><?php _e( 'Ajax Search for WooCommerce', DGWT_WCAS_DOMAIN ); ?></h2>
10
 
11
  <?php $settings->show_navigation(); ?>
12
  <?php $settings->show_forms(); ?>
6
 
7
  <div class="wrap">
8
 
9
+ <h2><?php _e( 'Ajax Search for WooCommerce', 'ajax-search-for-woocommerce' ); ?></h2>
10
 
11
  <?php $settings->show_navigation(); ?>
12
  <?php $settings->show_forms(); ?>
includes/class-result-details.php CHANGED
@@ -144,9 +144,9 @@ class DGWT_WCAS_Result_Details {
144
  $title .= '<span class="dgwt-wcas-datails-title">';
145
  $title .= '<span class="dgwt-wcas-details-title-tax">';
146
  if ( DGWT_WCAS_WOO_PRODUCT_CATEGORY === $taxonomy ) {
147
- $title .= __( 'Category', DGWT_WCAS_DOMAIN ) . ': ';
148
  } else {
149
- $title .= __( 'Tag', DGWT_WCAS_DOMAIN ) . ': ';
150
  }
151
  $title .= '</span>';
152
  $title .= $suggestion;
144
  $title .= '<span class="dgwt-wcas-datails-title">';
145
  $title .= '<span class="dgwt-wcas-details-title-tax">';
146
  if ( DGWT_WCAS_WOO_PRODUCT_CATEGORY === $taxonomy ) {
147
+ $title .= __( 'Category', 'ajax-search-for-woocommerce' ) . ': ';
148
  } else {
149
+ $title .= __( 'Tag', 'ajax-search-for-woocommerce' ) . ': ';
150
  }
151
  $title .= '</span>';
152
  $title .= $suggestion;
includes/class-search.php CHANGED
@@ -63,7 +63,7 @@ class DGWT_WCAS_Search {
63
  //@todo Get results from cache
64
 
65
  /* SEARCH IN WOO CATEGORIES */
66
- if ( DGWT_WCAS()->settings->get_opt( 'search_in_woo_categories' ) === 'on' ) {
67
 
68
  $results = array_merge( $this->get_categories( $keyword ), $results );
69
 
@@ -75,7 +75,7 @@ class DGWT_WCAS_Search {
75
  /* SEARCH IN WOO TAGS */
76
  if ( $this->slots > 0 ) {
77
 
78
- if ( DGWT_WCAS()->settings->get_opt( 'search_in_woo_tags' ) === 'on' ) {
79
 
80
  $results = array_merge( $this->get_tags( $keyword ), $results );
81
 
@@ -109,7 +109,7 @@ class DGWT_WCAS_Search {
109
  $product = wc_get_product( $post );
110
 
111
  $r = array(
112
- 'post_id' => $product->id,
113
  'value' => strip_tags( $product->get_title() ),
114
  'url' => $product->get_permalink(),
115
  );
@@ -129,7 +129,7 @@ class DGWT_WCAS_Search {
129
  if ( DGWT_WCAS()->settings->get_opt( 'show_details_box' ) === 'on' ) {
130
  $this->desc_limit = 60;
131
  }
132
- $r[ 'desc' ] = dgwt_wcas_get_product_desc( $product->id, $this->desc_limit );
133
  }
134
 
135
  // Get SKU
@@ -160,7 +160,7 @@ class DGWT_WCAS_Search {
160
  if ( empty( $results ) ) {
161
 
162
  $results[] = array(
163
- 'value' => __( 'No results', DGWT_WCAS_DOMAIN ),
164
  );
165
  }
166
 
@@ -179,28 +179,33 @@ class DGWT_WCAS_Search {
179
  */
180
 
181
  private function get_meta_query() {
182
-
183
- $meta_query = array(
184
- 'relation' => 'AND',
185
- 1 => array(
186
- 'key' => '_visibility',
187
- 'value' => array( 'search', 'visible' ),
188
- 'compare' => 'IN'
189
- ),
190
- 2 => array(
191
- 'relation' => 'OR',
192
- array(
193
  'key' => '_visibility',
194
  'value' => array( 'search', 'visible' ),
195
  'compare' => 'IN'
 
 
 
 
 
 
 
 
196
  )
197
- )
198
- );
199
 
200
 
201
  // Exclude out of stock products from suggestions
202
  if ( DGWT_WCAS()->settings->get_opt( 'exclude_out_of_stock' ) === 'on' ) {
203
- $meta_query[ 2 ] = array(
204
  'key' => '_stock_status',
205
  'value' => 'outofstock',
206
  'compare' => 'NOT IN'
@@ -251,7 +256,7 @@ class DGWT_WCAS_Search {
251
 
252
  if ( !empty( $parents ) ) {
253
 
254
- $results[ $i ][ 'parents' ] = sprintf( ' <em>%s <b>%s</b></em>', __( 'in', DGWT_WCAS_DOMAIN ), mb_substr( $parents, 0, -3 ) );
255
  }
256
  }
257
  }
@@ -302,7 +307,7 @@ class DGWT_WCAS_Search {
302
 
303
  if ( !empty( $parents ) ) {
304
 
305
- $results[ $i ][ 'parents' ] = sprintf( ' <em>%s <b>%s</b></em>', __( 'in', DGWT_WCAS_DOMAIN ), mb_substr( $parents, 0, -3 ) );
306
  }
307
  }
308
  }
@@ -331,12 +336,11 @@ class DGWT_WCAS_Search {
331
  * Search only in products titles
332
  *
333
  * @param string $search SQL
334
- * @param object $wp_query
335
  *
336
  * @return string prepared SQL
337
  */
338
 
339
- public function search_filters( $search, &$wp_query ) {
340
  global $wpdb;
341
 
342
  if ( empty( $search ) || is_admin() ) {
@@ -345,43 +349,44 @@ class DGWT_WCAS_Search {
345
 
346
  if ( defined( 'DGWT_WCAS_AJAX' ) || is_search() ) {
347
 
348
-
349
  $q = $wp_query->query_vars;
350
 
351
  if ( $q[ 'post_type' ] !== DGWT_WCAS_WOO_PRODUCT_POST_TYPE ) {
352
- return $search; // skip processing - on Woo products
353
  }
354
 
355
  $n = !empty( $q[ 'exact' ] ) ? '' : '%';
356
 
357
  $search = $searchand = '';
358
 
359
- foreach ( (array) $q[ 'search_terms' ] as $term ) {
360
- $term = esc_sql( $wpdb->esc_like( $term ) );
 
361
 
362
- $search .= "{$searchand} (";
363
 
364
- // Search in title
365
- $search .= "($wpdb->posts.post_title LIKE '{$n}{$term}{$n}')";
366
 
367
- // Search in content
368
- if ( DGWT_WCAS()->settings->get_opt( 'search_in_product_content' ) === 'on' ) {
369
- $search .= " OR ($wpdb->posts.post_content LIKE '{$n}{$term}{$n}')";
370
- }
371
 
372
- // Search in excerpt
373
- if ( DGWT_WCAS()->settings->get_opt( 'search_in_product_excerpt' ) === 'on' ) {
374
- $search .= " OR ($wpdb->posts.post_excerpt LIKE '{$n}{$term}{$n}')";
375
- }
376
 
377
- // Search in SKU
378
- if ( DGWT_WCAS()->settings->get_opt( 'search_in_product_sku' ) === 'on' ) {
379
- $search .= " OR (dgwt_wcasmsku.meta_key='_sku' AND dgwt_wcasmsku.meta_value LIKE '{$n}{$term}{$n}')";
380
- }
381
 
382
- $search .= ")";
383
 
384
- $searchand = ' AND ';
 
385
  }
386
 
387
  if ( !empty( $search ) ) {
@@ -400,15 +405,19 @@ class DGWT_WCAS_Search {
400
 
401
  public function search_filters_join( $join, $query ) {
402
  global $wpdb;
403
-
404
-
405
- if ( (defined( 'DGWT_WCAS_AJAX' ) || is_search()) && !is_admin()) {
 
 
 
406
 
407
  if ( DGWT_WCAS()->settings->get_opt( 'search_in_product_sku' ) === 'on' ) {
408
  $join .= " INNER JOIN $wpdb->postmeta AS dgwt_wcasmsku ON ( $wpdb->posts.ID = dgwt_wcasmsku.post_id )";
409
  }
410
  }
411
 
 
412
  return $join;
413
  }
414
 
@@ -459,15 +468,13 @@ class DGWT_WCAS_Search {
459
  public function set_search_results_query( $query ) {
460
 
461
  if ( !defined( 'DGWT_WCAS_AJAX' ) && $query->is_search ) {
462
-
463
- if(!empty($_GET['dgwt_wcas']) && !empty($_GET['s'])){
464
-
465
  $query->query_vars[ 'post_type' ] = DGWT_WCAS_WOO_PRODUCT_POST_TYPE;
466
-
467
- $query->query_vars[ 'meta_query' ] = $this->get_meta_query();
468
 
 
469
  }
470
-
471
  }
472
 
473
  return $query;
63
  //@todo Get results from cache
64
 
65
  /* SEARCH IN WOO CATEGORIES */
66
+ if ( DGWT_WCAS()->settings->get_opt( 'show_matching_categories' ) === 'on' ) {
67
 
68
  $results = array_merge( $this->get_categories( $keyword ), $results );
69
 
75
  /* SEARCH IN WOO TAGS */
76
  if ( $this->slots > 0 ) {
77
 
78
+ if ( DGWT_WCAS()->settings->get_opt( 'show_matching_tags' ) === 'on' ) {
79
 
80
  $results = array_merge( $this->get_tags( $keyword ), $results );
81
 
109
  $product = wc_get_product( $post );
110
 
111
  $r = array(
112
+ 'post_id' => $product->get_id(),
113
  'value' => strip_tags( $product->get_title() ),
114
  'url' => $product->get_permalink(),
115
  );
129
  if ( DGWT_WCAS()->settings->get_opt( 'show_details_box' ) === 'on' ) {
130
  $this->desc_limit = 60;
131
  }
132
+ $r[ 'desc' ] = dgwt_wcas_get_product_desc( $product->get_id(), $this->desc_limit );
133
  }
134
 
135
  // Get SKU
160
  if ( empty( $results ) ) {
161
 
162
  $results[] = array(
163
+ 'value' => __( 'No results', 'ajax-search-for-woocommerce' ),
164
  );
165
  }
166
 
179
  */
180
 
181
  private function get_meta_query() {
182
+
183
+ $meta_query = array();
184
+
185
+ // Backward compatibility WC < 3.0
186
+ if ( dgwt_wcas_compare_wc_version( '3.0', '<' ) ) {
187
+ $meta_query = array(
188
+ 'relation' => 'AND',
189
+ 1 => array(
 
 
 
190
  'key' => '_visibility',
191
  'value' => array( 'search', 'visible' ),
192
  'compare' => 'IN'
193
+ ),
194
+ 2 => array(
195
+ 'relation' => 'OR',
196
+ array(
197
+ 'key' => '_visibility',
198
+ 'value' => array( 'search', 'visible' ),
199
+ 'compare' => 'IN'
200
+ )
201
  )
202
+ );
203
+ }
204
 
205
 
206
  // Exclude out of stock products from suggestions
207
  if ( DGWT_WCAS()->settings->get_opt( 'exclude_out_of_stock' ) === 'on' ) {
208
+ $meta_query[] = array(
209
  'key' => '_stock_status',
210
  'value' => 'outofstock',
211
  'compare' => 'NOT IN'
256
 
257
  if ( !empty( $parents ) ) {
258
 
259
+ $results[ $i ][ 'parents' ] = sprintf( ' <em>%s <b>%s</b></em>', __( 'in', 'ajax-search-for-woocommerce' ), mb_substr( $parents, 0, -3 ) );
260
  }
261
  }
262
  }
307
 
308
  if ( !empty( $parents ) ) {
309
 
310
+ $results[ $i ][ 'parents' ] = sprintf( ' <em>%s <b>%s</b></em>', __( 'in', 'ajax-search-for-woocommerce' ), mb_substr( $parents, 0, -3 ) );
311
  }
312
  }
313
  }
336
  * Search only in products titles
337
  *
338
  * @param string $search SQL
 
339
  *
340
  * @return string prepared SQL
341
  */
342
 
343
+ public function search_filters( $search, $wp_query ) {
344
  global $wpdb;
345
 
346
  if ( empty( $search ) || is_admin() ) {
349
 
350
  if ( defined( 'DGWT_WCAS_AJAX' ) || is_search() ) {
351
 
 
352
  $q = $wp_query->query_vars;
353
 
354
  if ( $q[ 'post_type' ] !== DGWT_WCAS_WOO_PRODUCT_POST_TYPE ) {
355
+ return $search; // skip processing
356
  }
357
 
358
  $n = !empty( $q[ 'exact' ] ) ? '' : '%';
359
 
360
  $search = $searchand = '';
361
 
362
+ if ( !empty( $q[ 'search_terms' ] ) ) {
363
+ foreach ( (array) $q[ 'search_terms' ] as $term ) {
364
+ $term = esc_sql( $wpdb->esc_like( $term ) );
365
 
366
+ $search .= "{$searchand} (";
367
 
368
+ // Search in title
369
+ $search .= "($wpdb->posts.post_title LIKE '{$n}{$term}{$n}')";
370
 
371
+ // Search in content
372
+ if ( DGWT_WCAS()->settings->get_opt( 'search_in_product_content' ) === 'on' ) {
373
+ $search .= " OR ($wpdb->posts.post_content LIKE '{$n}{$term}{$n}')";
374
+ }
375
 
376
+ // Search in excerpt
377
+ if ( DGWT_WCAS()->settings->get_opt( 'search_in_product_excerpt' ) === 'on' ) {
378
+ $search .= " OR ($wpdb->posts.post_excerpt LIKE '{$n}{$term}{$n}')";
379
+ }
380
 
381
+ // Search in SKU
382
+ if ( DGWT_WCAS()->settings->get_opt( 'search_in_product_sku' ) === 'on' ) {
383
+ $search .= " OR (dgwt_wcasmsku.meta_key='_sku' AND dgwt_wcasmsku.meta_value LIKE '{$n}{$term}{$n}')";
384
+ }
385
 
386
+ $search .= ")";
387
 
388
+ $searchand = ' AND ';
389
+ }
390
  }
391
 
392
  if ( !empty( $search ) ) {
405
 
406
  public function search_filters_join( $join, $query ) {
407
  global $wpdb;
408
+
409
+ if ( empty( $query->query_vars[ 'post_type' ] ) || $query->query_vars[ 'post_type' ] !== 'product' ) {
410
+ return $join; // skip processing
411
+ }
412
+
413
+ if ( (defined( 'DGWT_WCAS_AJAX' ) || is_search()) && !is_admin() ) {
414
 
415
  if ( DGWT_WCAS()->settings->get_opt( 'search_in_product_sku' ) === 'on' ) {
416
  $join .= " INNER JOIN $wpdb->postmeta AS dgwt_wcasmsku ON ( $wpdb->posts.ID = dgwt_wcasmsku.post_id )";
417
  }
418
  }
419
 
420
+
421
  return $join;
422
  }
423
 
468
  public function set_search_results_query( $query ) {
469
 
470
  if ( !defined( 'DGWT_WCAS_AJAX' ) && $query->is_search ) {
471
+
472
+ if ( !empty( $_GET[ 'dgwt_wcas' ] ) && !empty( $_GET[ 's' ] ) ) {
473
+
474
  $query->query_vars[ 'post_type' ] = DGWT_WCAS_WOO_PRODUCT_POST_TYPE;
 
 
475
 
476
+ $query->query_vars[ 'meta_query' ] = $this->get_meta_query();
477
  }
 
478
  }
479
 
480
  return $query;
includes/functions.php CHANGED
@@ -260,3 +260,10 @@ function dgwt_wcas_minify_css( $input ) {
260
  ' '
261
  ), $input );
262
  }
 
 
 
 
 
 
 
260
  ' '
261
  ), $input );
262
  }
263
+
264
+ function dgwt_wcas_compare_wc_version($version, $op) {
265
+ if ( function_exists( 'WC' ) && ( version_compare( WC()->version, $version, $op )) ) {
266
+ return true;
267
+ }
268
+ return false;
269
+ }
includes/register-scripts.php CHANGED
@@ -25,8 +25,8 @@ class DGWT_WCAS_Scripts {
25
 
26
  //Strings translation
27
  $t = array(
28
- 'sale_badge' => _x( 'sale', 'For product badge: on sale', DGWT_WCAS_DOMAIN ),
29
- 'featured_badge' => _x( 'featured', 'For product badge: featured', DGWT_WCAS_DOMAIN ),
30
  );
31
 
32
  // Main JS
25
 
26
  //Strings translation
27
  $t = array(
28
+ 'sale_badge' => _x( 'sale', 'For product badge: on sale', 'ajax-search-for-woocommerce' ),
29
+ 'featured_badge' => _x( 'featured', 'For product badge: featured', 'ajax-search-for-woocommerce' ),
30
  );
31
 
32
  // Main JS
includes/tmpl/search-form.php CHANGED
@@ -16,7 +16,7 @@ $has_submit = DGWT_WCAS()->settings->get_opt( 'show_submit_button' );
16
  dgwt_wcas_print_ico_loupe();
17
  }
18
  ?>
19
- <label class="screen-reader-text" for="dgwt-wcas-search"><?php _e( 'Products search', DGWT_WCAS_DOMAIN ) ?></label>
20
 
21
  <input
22
  type="search"
@@ -24,7 +24,7 @@ $has_submit = DGWT_WCAS()->settings->get_opt( 'show_submit_button' );
24
  class="dgwt-wcas-search-input"
25
  name="s"
26
  value="<?php echo get_search_query() ?>"
27
- placeholder="<?php echo DGWT_WCAS()->settings->get_opt( 'search_placeholder', __( 'Search for products...', DGWT_WCAS_DOMAIN ) ) ?>"
28
  />
29
  <div class="dgwt-wcas-preloader"></div>
30
 
16
  dgwt_wcas_print_ico_loupe();
17
  }
18
  ?>
19
+ <label class="screen-reader-text" for="dgwt-wcas-search"><?php _e( 'Products search', 'ajax-search-for-woocommerce' ) ?></label>
20
 
21
  <input
22
  type="search"
24
  class="dgwt-wcas-search-input"
25
  name="s"
26
  value="<?php echo get_search_query() ?>"
27
+ placeholder="<?php echo DGWT_WCAS()->settings->get_opt( 'search_placeholder', __( 'Search for products...', 'ajax-search-for-woocommerce' ) ) ?>"
28
  />
29
  <div class="dgwt-wcas-preloader"></div>
30
 
includes/widget.php CHANGED
@@ -16,14 +16,14 @@ if ( class_exists( 'WC_Widget' ) ) {
16
 
17
 
18
  $this->widget_cssclass = 'woocommerce widget_search dgwt_wcas_ajax_search';
19
- $this->widget_description = __( 'Ajax (live) search form for WooCommerce', DGWT_WCAS_DOMAIN );
20
  $this->widget_id = 'dgwt_wcas_ajax_search';
21
- $this->widget_name = __( 'Woo Ajax Search', DGWT_WCAS_DOMAIN );
22
  $this->settings = array(
23
  'title' => array(
24
  'type' => 'text',
25
  'std' => '',
26
- 'label' => __( 'Title', DGWT_WCAS_DOMAIN )
27
  )
28
  );
29
 
16
 
17
 
18
  $this->widget_cssclass = 'woocommerce widget_search dgwt_wcas_ajax_search';
19
+ $this->widget_description = __( 'Ajax (live) search form for WooCommerce', 'ajax-search-for-woocommerce' );
20
  $this->widget_id = 'dgwt_wcas_ajax_search';
21
+ $this->widget_name = __( 'Woo Ajax Search', 'ajax-search-for-woocommerce' );
22
  $this->settings = array(
23
  'title' => array(
24
  'type' => 'text',
25
  'std' => '',
26
+ 'label' => __( 'Title', 'ajax-search-for-woocommerce' )
27
  )
28
  );
29
 
languages/ajax-search-for-woocommerce-pl_PL.mo ADDED
Binary file
languages/ajax-search-for-woocommerce-pl_PL.po ADDED
@@ -0,0 +1,371 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ msgid ""
2
+ msgstr ""
3
+ "Project-Id-Version: Ajax Search for WooCommerce\n"
4
+ "Report-Msgid-Bugs-To: \n"
5
+ "POT-Creation-Date: 2017-06-06 22:09+0000\n"
6
+ "PO-Revision-Date: 2017-06-06 22:14+0000\n"
7
+ "Last-Translator: Damian Góra <wp@damiangora.com>\n"
8
+ "Language-Team: Polish\n"
9
+ "Language: pl-PL\n"
10
+ "Plural-Forms: nplurals=3; plural=(n==1 ? 0 : n%10 >= 2 && n%10<=4 "
11
+ "&&(n%100<10||n%100 >= 20)? 1 : 2)\n"
12
+ "MIME-Version: 1.0\n"
13
+ "Content-Type: text/plain; charset=UTF-8\n"
14
+ "Content-Transfer-Encoding: 8bit\n"
15
+ "X-Generator: Loco - https://localise.biz/"
16
+
17
+ #: ajax-search-for-woocommerce.php:87
18
+ msgid ""
19
+ "<b>Ajax Search for WooCommerce</b>: You need PHP version at least 5.3 to run "
20
+ "this plugin. You are currently using PHP version "
21
+ msgstr ""
22
+ "<b>Ajax Search for WooCommerce</b>: Wymagana wersja PHP do uruchomienia "
23
+ "wtyczki to 5.3 lub wyższa. Aktualnie używasz wersji "
24
+
25
+ #: includes/class-result-details.php:147
26
+ msgid "Category"
27
+ msgstr "Kategoria"
28
+
29
+ #: includes/class-result-details.php:149
30
+ msgid "Tag"
31
+ msgstr "Tag"
32
+
33
+ #: includes/class-search.php:163
34
+ msgid "No results"
35
+ msgstr "Brak wyników"
36
+
37
+ #: includes/class-search.php:259 includes/class-search.php:310
38
+ msgid "in"
39
+ msgstr "w"
40
+
41
+ #: includes/widget.php:19
42
+ msgid "Ajax (live) search form for WooCommerce"
43
+ msgstr "Ajaxowa wyszukiwarka produktów dla WooCommerce"
44
+
45
+ #: includes/widget.php:21 includes/admin/admin-menus.php:23
46
+ msgid "Woo Ajax Search"
47
+ msgstr ""
48
+
49
+ #: includes/widget.php:26
50
+ msgid "Title"
51
+ msgstr "Tytuł"
52
+
53
+ #: includes/register-scripts.php:28
54
+ msgctxt "For product badge: on sale"
55
+ msgid "sale"
56
+ msgstr "sprzedaż"
57
+
58
+ #: includes/register-scripts.php:29
59
+ msgctxt "For product badge: featured"
60
+ msgid "featured"
61
+ msgstr "wyróżniony"
62
+
63
+ #: includes/tmpl/search-form.php:19
64
+ msgid "Products search"
65
+ msgstr "Wyszukiwarka produktów"
66
+
67
+ #: includes/tmpl/search-form.php:27
68
+ #: includes/admin/settings/class-settings.php:139
69
+ msgid "Search for products..."
70
+ msgstr "Szukaj produktów"
71
+
72
+ #. Name of the plugin
73
+ #: includes/admin/admin-menus.php:23 includes/admin/views/settings.php:9
74
+ msgid "Ajax Search for WooCommerce"
75
+ msgstr ""
76
+
77
+ #: includes/admin/settings/class-settings.php:69
78
+ msgid "Basic"
79
+ msgstr "Podstawowe"
80
+
81
+ #: includes/admin/settings/class-settings.php:73
82
+ msgid "Advanced"
83
+ msgstr "Zaawansowane"
84
+
85
+ #: includes/admin/settings/class-settings.php:77
86
+ msgid "Extra Details"
87
+ msgstr "Dodatkowe szczegóły"
88
+
89
+ #: includes/admin/settings/class-settings.php:81
90
+ msgid "Style"
91
+ msgstr "Styl"
92
+
93
+ #: includes/admin/settings/class-settings.php:101
94
+ msgid "How to use?"
95
+ msgstr "Jak używać?"
96
+
97
+ #: includes/admin/settings/class-settings.php:107
98
+ msgid "Suggestions limit"
99
+ msgstr "Limit podpowiedzi"
100
+
101
+ #: includes/admin/settings/class-settings.php:110
102
+ msgid "Maximum number of suggestions rows."
103
+ msgstr ""
104
+
105
+ #: includes/admin/settings/class-settings.php:115
106
+ msgid "Minimum characters"
107
+ msgstr ""
108
+
109
+ #: includes/admin/settings/class-settings.php:118
110
+ msgid "Minimum number of characters required to trigger autosuggest."
111
+ msgstr ""
112
+
113
+ #: includes/admin/settings/class-settings.php:123
114
+ msgid "Show submit button"
115
+ msgstr ""
116
+
117
+ #: includes/admin/settings/class-settings.php:130
118
+ msgid "Search submit button text"
119
+ msgstr ""
120
+
121
+ #: includes/admin/settings/class-settings.php:132
122
+ msgid "To display a loupe icon leave this field empty."
123
+ msgstr ""
124
+
125
+ #: includes/admin/settings/class-settings.php:133
126
+ msgid "Search"
127
+ msgstr ""
128
+
129
+ #: includes/admin/settings/class-settings.php:137
130
+ msgid "Search input placeholder"
131
+ msgstr ""
132
+
133
+ #: includes/admin/settings/class-settings.php:143
134
+ msgid "Show details box"
135
+ msgstr ""
136
+
137
+ #: includes/admin/settings/class-settings.php:146
138
+ msgid ""
139
+ "The Details box is an additional container for extended information. The "
140
+ "details are changed dynamically when you hover the mouse over one of the "
141
+ "suggestions."
142
+ msgstr ""
143
+
144
+ #: includes/admin/settings/class-settings.php:153
145
+ msgid "Product search"
146
+ msgstr ""
147
+
148
+ #: includes/admin/settings/class-settings.php:158
149
+ msgid "Search in products content"
150
+ msgstr ""
151
+
152
+ #: includes/admin/settings/class-settings.php:164
153
+ msgid "Search in products excerpt"
154
+ msgstr ""
155
+
156
+ #: includes/admin/settings/class-settings.php:170
157
+ msgid "Search in products SKU"
158
+ msgstr ""
159
+
160
+ #: includes/admin/settings/class-settings.php:176
161
+ msgid "Exclude 'out of stock' products"
162
+ msgstr ""
163
+
164
+ #: includes/admin/settings/class-settings.php:182
165
+ msgid "Taxonomy search"
166
+ msgstr ""
167
+
168
+ #: includes/admin/settings/class-settings.php:187
169
+ msgid "Show matching categories"
170
+ msgstr ""
171
+
172
+ #: includes/admin/settings/class-settings.php:193
173
+ msgid "Show matching tags"
174
+ msgstr ""
175
+
176
+ #: includes/admin/settings/class-settings.php:199
177
+ msgid "Suggestions output"
178
+ msgstr ""
179
+
180
+ #: includes/admin/settings/class-settings.php:204
181
+ msgid "Show product image"
182
+ msgstr ""
183
+
184
+ #: includes/admin/settings/class-settings.php:210
185
+ msgid "Show price"
186
+ msgstr ""
187
+
188
+ #: includes/admin/settings/class-settings.php:216
189
+ msgid "Show product description"
190
+ msgstr ""
191
+
192
+ #: includes/admin/settings/class-settings.php:222
193
+ msgid "Show SKU"
194
+ msgstr ""
195
+
196
+ #: includes/admin/settings/class-settings.php:242
197
+ msgid "Category and tag details:"
198
+ msgstr ""
199
+
200
+ #: includes/admin/settings/class-settings.php:247
201
+ msgid "Show"
202
+ msgstr ""
203
+
204
+ #: includes/admin/settings/class-settings.php:250
205
+ msgid "All Product"
206
+ msgstr ""
207
+
208
+ #: includes/admin/settings/class-settings.php:251
209
+ msgid "Featured Products"
210
+ msgstr ""
211
+
212
+ #: includes/admin/settings/class-settings.php:252
213
+ msgid "On-sale Products"
214
+ msgstr ""
215
+
216
+ #: includes/admin/settings/class-settings.php:258
217
+ #: includes/admin/settings/class-settings.php:270
218
+ msgid "Order by"
219
+ msgstr ""
220
+
221
+ #: includes/admin/settings/class-settings.php:261
222
+ msgid "Date"
223
+ msgstr ""
224
+
225
+ #: includes/admin/settings/class-settings.php:262
226
+ msgid "Price"
227
+ msgstr ""
228
+
229
+ #: includes/admin/settings/class-settings.php:263
230
+ msgid "Random"
231
+ msgstr ""
232
+
233
+ #: includes/admin/settings/class-settings.php:264
234
+ msgid "Sales"
235
+ msgstr ""
236
+
237
+ #: includes/admin/settings/class-settings.php:273
238
+ msgid "DESC"
239
+ msgstr ""
240
+
241
+ #: includes/admin/settings/class-settings.php:274
242
+ msgid "ASC"
243
+ msgstr ""
244
+
245
+ #: includes/admin/settings/class-settings.php:280
246
+ msgid "Other"
247
+ msgstr ""
248
+
249
+ #: includes/admin/settings/class-settings.php:285
250
+ msgid "Details box position"
251
+ msgstr ""
252
+
253
+ #: includes/admin/settings/class-settings.php:287
254
+ msgid ""
255
+ "If your search form is very close to the right window screen, then select "
256
+ "left."
257
+ msgstr ""
258
+
259
+ #: includes/admin/settings/class-settings.php:289
260
+ msgid "Left"
261
+ msgstr ""
262
+
263
+ #: includes/admin/settings/class-settings.php:290
264
+ msgid "Right"
265
+ msgstr ""
266
+
267
+ #: includes/admin/settings/class-settings.php:298
268
+ msgid "Search form"
269
+ msgstr ""
270
+
271
+ #: includes/admin/settings/class-settings.php:303
272
+ msgid "Search input background"
273
+ msgstr ""
274
+
275
+ #: includes/admin/settings/class-settings.php:309
276
+ msgid "Search input text"
277
+ msgstr ""
278
+
279
+ #: includes/admin/settings/class-settings.php:315
280
+ msgid "Search input border"
281
+ msgstr ""
282
+
283
+ #: includes/admin/settings/class-settings.php:321
284
+ msgid "Search submit background"
285
+ msgstr ""
286
+
287
+ #: includes/admin/settings/class-settings.php:327
288
+ msgid "Search submit text"
289
+ msgstr ""
290
+
291
+ #: includes/admin/settings/class-settings.php:333
292
+ msgid "Suggestions"
293
+ msgstr ""
294
+
295
+ #: includes/admin/settings/class-settings.php:338
296
+ msgid "Suggestion background"
297
+ msgstr ""
298
+
299
+ #: includes/admin/settings/class-settings.php:344
300
+ msgid "Suggestion selected"
301
+ msgstr ""
302
+
303
+ #: includes/admin/settings/class-settings.php:350
304
+ msgid "Text color"
305
+ msgstr ""
306
+
307
+ #: includes/admin/settings/class-settings.php:356
308
+ msgid "Highlight color"
309
+ msgstr ""
310
+
311
+ #: includes/admin/settings/class-settings.php:362
312
+ msgid "Border color"
313
+ msgstr ""
314
+
315
+ #: includes/admin/settings/class-settings.php:368
316
+ msgid "Suggestions width"
317
+ msgstr ""
318
+
319
+ #: includes/admin/settings/class-settings.php:371
320
+ msgid ""
321
+ "Overvrite the suggestions container width. Leave this field empty to adjust "
322
+ "the suggestions container width to the search input width."
323
+ msgstr ""
324
+
325
+ #: includes/admin/settings/class-settings.php:376
326
+ msgid "Preloader"
327
+ msgstr ""
328
+
329
+ #: includes/admin/settings/class-settings.php:381
330
+ msgid "Show preloader"
331
+ msgstr ""
332
+
333
+ #: includes/admin/settings/class-settings.php:387
334
+ msgid "Upload preloader image"
335
+ msgstr ""
336
+
337
+ #: includes/admin/views/how-to-use.php:2
338
+ msgid "There are two easy ways to display the search form"
339
+ msgstr ""
340
+
341
+ #: includes/admin/views/how-to-use.php:3
342
+ #, php-format
343
+ msgid "Use a shortcode %s"
344
+ msgstr ""
345
+
346
+ #: includes/admin/views/how-to-use.php:4
347
+ #, php-format
348
+ msgid "Go to the %s and choose \"Woo Ajax Search\""
349
+ msgstr ""
350
+
351
+ #: includes/admin/views/how-to-use.php:4
352
+ msgid "Widgets Screen"
353
+ msgstr ""
354
+
355
+ #. Description of the plugin
356
+ msgid ""
357
+ "The plugin allows you to display the WooCommerce AJAX search form anywhere "
358
+ "on the page."
359
+ msgstr ""
360
+
361
+ #. URI of the plugin
362
+ msgid "https://wordpress.org/plugins/ajax-search-for-woocommerce/"
363
+ msgstr ""
364
+
365
+ #. Author of the plugin
366
+ msgid "Damian Góra"
367
+ msgstr ""
368
+
369
+ #. Author URI of the plugin
370
+ msgid "http://damiangora.com"
371
+ msgstr ""
languages/ajax-search-for-woocommerce.pot ADDED
@@ -0,0 +1,369 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ #, fuzzy
2
+ msgid ""
3
+ msgstr ""
4
+ "Project-Id-Version: PACKAGE VERSION\n"
5
+ "Report-Msgid-Bugs-To: \n"
6
+ "POT-Creation-Date: 2017-06-06 22:09+0000\n"
7
+ "PO-Revision-Date: 1017-06-06 HO:MI+ZONE\n"
8
+ "Last-Translator: Damian Góra <wp@damiangora.com>\n"
9
+ "Language-Team: \n"
10
+ "Language: \n"
11
+ "Plural-Forms: nplurals=INTEGER; plural=EXPRESSION\n"
12
+ "MIME-Version: 1.0\n"
13
+ "Content-Type: text/plain; charset=UTF-8\n"
14
+ "Content-Transfer-Encoding: 8bit\n"
15
+ "X-Generator: Loco - https://localise.biz/"
16
+
17
+ #: ajax-search-for-woocommerce.php:87
18
+ msgid ""
19
+ "<b>Ajax Search for WooCommerce</b>: You need PHP version at least 5.3 to run "
20
+ "this plugin. You are currently using PHP version "
21
+ msgstr ""
22
+
23
+ #: includes/class-result-details.php:147
24
+ msgid "Category"
25
+ msgstr ""
26
+
27
+ #: includes/class-result-details.php:149
28
+ msgid "Tag"
29
+ msgstr ""
30
+
31
+ #: includes/class-search.php:163
32
+ msgid "No results"
33
+ msgstr ""
34
+
35
+ #: includes/class-search.php:259 includes/class-search.php:310
36
+ msgid "in"
37
+ msgstr ""
38
+
39
+ #: includes/widget.php:19
40
+ msgid "Ajax (live) search form for WooCommerce"
41
+ msgstr ""
42
+
43
+ #: includes/widget.php:21 includes/admin/admin-menus.php:23
44
+ msgid "Woo Ajax Search"
45
+ msgstr ""
46
+
47
+ #: includes/widget.php:26
48
+ msgid "Title"
49
+ msgstr ""
50
+
51
+ #: includes/register-scripts.php:28
52
+ msgctxt "For product badge: on sale"
53
+ msgid "sale"
54
+ msgstr ""
55
+
56
+ #: includes/register-scripts.php:29
57
+ msgctxt "For product badge: featured"
58
+ msgid "featured"
59
+ msgstr ""
60
+
61
+ #: includes/tmpl/search-form.php:19
62
+ msgid "Products search"
63
+ msgstr ""
64
+
65
+ #: includes/tmpl/search-form.php:27
66
+ #: includes/admin/settings/class-settings.php:139
67
+ msgid "Search for products..."
68
+ msgstr ""
69
+
70
+ #. Name of the plugin
71
+ #: includes/admin/admin-menus.php:23 includes/admin/views/settings.php:9
72
+ msgid "Ajax Search for WooCommerce"
73
+ msgstr ""
74
+
75
+ #: includes/admin/settings/class-settings.php:69
76
+ msgid "Basic"
77
+ msgstr ""
78
+
79
+ #: includes/admin/settings/class-settings.php:73
80
+ msgid "Advanced"
81
+ msgstr ""
82
+
83
+ #: includes/admin/settings/class-settings.php:77
84
+ msgid "Extra Details"
85
+ msgstr ""
86
+
87
+ #: includes/admin/settings/class-settings.php:81
88
+ msgid "Style"
89
+ msgstr ""
90
+
91
+ #: includes/admin/settings/class-settings.php:101
92
+ msgid "How to use?"
93
+ msgstr ""
94
+
95
+ #: includes/admin/settings/class-settings.php:107
96
+ msgid "Suggestions limit"
97
+ msgstr ""
98
+
99
+ #: includes/admin/settings/class-settings.php:110
100
+ msgid "Maximum number of suggestions rows."
101
+ msgstr ""
102
+
103
+ #: includes/admin/settings/class-settings.php:115
104
+ msgid "Minimum characters"
105
+ msgstr ""
106
+
107
+ #: includes/admin/settings/class-settings.php:118
108
+ msgid "Minimum number of characters required to trigger autosuggest."
109
+ msgstr ""
110
+
111
+ #: includes/admin/settings/class-settings.php:123
112
+ msgid "Show submit button"
113
+ msgstr ""
114
+
115
+ #: includes/admin/settings/class-settings.php:130
116
+ msgid "Search submit button text"
117
+ msgstr ""
118
+
119
+ #: includes/admin/settings/class-settings.php:132
120
+ msgid "To display a loupe icon leave this field empty."
121
+ msgstr ""
122
+
123
+ #: includes/admin/settings/class-settings.php:133
124
+ msgid "Search"
125
+ msgstr ""
126
+
127
+ #: includes/admin/settings/class-settings.php:137
128
+ msgid "Search input placeholder"
129
+ msgstr ""
130
+
131
+ #: includes/admin/settings/class-settings.php:143
132
+ msgid "Show details box"
133
+ msgstr ""
134
+
135
+ #: includes/admin/settings/class-settings.php:146
136
+ msgid ""
137
+ "The Details box is an additional container for extended information. The "
138
+ "details are changed dynamically when you hover the mouse over one of the "
139
+ "suggestions."
140
+ msgstr ""
141
+
142
+ #: includes/admin/settings/class-settings.php:153
143
+ msgid "Product search"
144
+ msgstr ""
145
+
146
+ #: includes/admin/settings/class-settings.php:158
147
+ msgid "Search in products content"
148
+ msgstr ""
149
+
150
+ #: includes/admin/settings/class-settings.php:164
151
+ msgid "Search in products excerpt"
152
+ msgstr ""
153
+
154
+ #: includes/admin/settings/class-settings.php:170
155
+ msgid "Search in products SKU"
156
+ msgstr ""
157
+
158
+ #: includes/admin/settings/class-settings.php:176
159
+ msgid "Exclude 'out of stock' products"
160
+ msgstr ""
161
+
162
+ #: includes/admin/settings/class-settings.php:182
163
+ msgid "Taxonomy search"
164
+ msgstr ""
165
+
166
+ #: includes/admin/settings/class-settings.php:187
167
+ msgid "Show matching categories"
168
+ msgstr ""
169
+
170
+ #: includes/admin/settings/class-settings.php:193
171
+ msgid "Show matching tags"
172
+ msgstr ""
173
+
174
+ #: includes/admin/settings/class-settings.php:199
175
+ msgid "Suggestions output"
176
+ msgstr ""
177
+
178
+ #: includes/admin/settings/class-settings.php:204
179
+ msgid "Show product image"
180
+ msgstr ""
181
+
182
+ #: includes/admin/settings/class-settings.php:210
183
+ msgid "Show price"
184
+ msgstr ""
185
+
186
+ #: includes/admin/settings/class-settings.php:216
187
+ msgid "Show product description"
188
+ msgstr ""
189
+
190
+ #: includes/admin/settings/class-settings.php:222
191
+ msgid "Show SKU"
192
+ msgstr ""
193
+
194
+ #: includes/admin/settings/class-settings.php:242
195
+ msgid "Category and tag details:"
196
+ msgstr ""
197
+
198
+ #: includes/admin/settings/class-settings.php:247
199
+ msgid "Show"
200
+ msgstr ""
201
+
202
+ #: includes/admin/settings/class-settings.php:250
203
+ msgid "All Product"
204
+ msgstr ""
205
+
206
+ #: includes/admin/settings/class-settings.php:251
207
+ msgid "Featured Products"
208
+ msgstr ""
209
+
210
+ #: includes/admin/settings/class-settings.php:252
211
+ msgid "On-sale Products"
212
+ msgstr ""
213
+
214
+ #: includes/admin/settings/class-settings.php:258
215
+ #: includes/admin/settings/class-settings.php:270
216
+ msgid "Order by"
217
+ msgstr ""
218
+
219
+ #: includes/admin/settings/class-settings.php:261
220
+ msgid "Date"
221
+ msgstr ""
222
+
223
+ #: includes/admin/settings/class-settings.php:262
224
+ msgid "Price"
225
+ msgstr ""
226
+
227
+ #: includes/admin/settings/class-settings.php:263
228
+ msgid "Random"
229
+ msgstr ""
230
+
231
+ #: includes/admin/settings/class-settings.php:264
232
+ msgid "Sales"
233
+ msgstr ""
234
+
235
+ #: includes/admin/settings/class-settings.php:273
236
+ msgid "DESC"
237
+ msgstr ""
238
+
239
+ #: includes/admin/settings/class-settings.php:274
240
+ msgid "ASC"
241
+ msgstr ""
242
+
243
+ #: includes/admin/settings/class-settings.php:280
244
+ msgid "Other"
245
+ msgstr ""
246
+
247
+ #: includes/admin/settings/class-settings.php:285
248
+ msgid "Details box position"
249
+ msgstr ""
250
+
251
+ #: includes/admin/settings/class-settings.php:287
252
+ msgid ""
253
+ "If your search form is very close to the right window screen, then select "
254
+ "left."
255
+ msgstr ""
256
+
257
+ #: includes/admin/settings/class-settings.php:289
258
+ msgid "Left"
259
+ msgstr ""
260
+
261
+ #: includes/admin/settings/class-settings.php:290
262
+ msgid "Right"
263
+ msgstr ""
264
+
265
+ #: includes/admin/settings/class-settings.php:298
266
+ msgid "Search form"
267
+ msgstr ""
268
+
269
+ #: includes/admin/settings/class-settings.php:303
270
+ msgid "Search input background"
271
+ msgstr ""
272
+
273
+ #: includes/admin/settings/class-settings.php:309
274
+ msgid "Search input text"
275
+ msgstr ""
276
+
277
+ #: includes/admin/settings/class-settings.php:315
278
+ msgid "Search input border"
279
+ msgstr ""
280
+
281
+ #: includes/admin/settings/class-settings.php:321
282
+ msgid "Search submit background"
283
+ msgstr ""
284
+
285
+ #: includes/admin/settings/class-settings.php:327
286
+ msgid "Search submit text"
287
+ msgstr ""
288
+
289
+ #: includes/admin/settings/class-settings.php:333
290
+ msgid "Suggestions"
291
+ msgstr ""
292
+
293
+ #: includes/admin/settings/class-settings.php:338
294
+ msgid "Suggestion background"
295
+ msgstr ""
296
+
297
+ #: includes/admin/settings/class-settings.php:344
298
+ msgid "Suggestion selected"
299
+ msgstr ""
300
+
301
+ #: includes/admin/settings/class-settings.php:350
302
+ msgid "Text color"
303
+ msgstr ""
304
+
305
+ #: includes/admin/settings/class-settings.php:356
306
+ msgid "Highlight color"
307
+ msgstr ""
308
+
309
+ #: includes/admin/settings/class-settings.php:362
310
+ msgid "Border color"
311
+ msgstr ""
312
+
313
+ #: includes/admin/settings/class-settings.php:368
314
+ msgid "Suggestions width"
315
+ msgstr ""
316
+
317
+ #: includes/admin/settings/class-settings.php:371
318
+ msgid ""
319
+ "Overvrite the suggestions container width. Leave this field empty to adjust "
320
+ "the suggestions container width to the search input width."
321
+ msgstr ""
322
+
323
+ #: includes/admin/settings/class-settings.php:376
324
+ msgid "Preloader"
325
+ msgstr ""
326
+
327
+ #: includes/admin/settings/class-settings.php:381
328
+ msgid "Show preloader"
329
+ msgstr ""
330
+
331
+ #: includes/admin/settings/class-settings.php:387
332
+ msgid "Upload preloader image"
333
+ msgstr ""
334
+
335
+ #: includes/admin/views/how-to-use.php:2
336
+ msgid "There are two easy ways to display the search form"
337
+ msgstr ""
338
+
339
+ #: includes/admin/views/how-to-use.php:3
340
+ #, php-format
341
+ msgid "Use a shortcode %s"
342
+ msgstr ""
343
+
344
+ #: includes/admin/views/how-to-use.php:4
345
+ #, php-format
346
+ msgid "Go to the %s and choose \"Woo Ajax Search\""
347
+ msgstr ""
348
+
349
+ #: includes/admin/views/how-to-use.php:4
350
+ msgid "Widgets Screen"
351
+ msgstr ""
352
+
353
+ #. Description of the plugin
354
+ msgid ""
355
+ "The plugin allows you to display the WooCommerce AJAX search form anywhere "
356
+ "on the page."
357
+ msgstr ""
358
+
359
+ #. URI of the plugin
360
+ msgid "https://wordpress.org/plugins/ajax-search-for-woocommerce/"
361
+ msgstr ""
362
+
363
+ #. Author of the plugin
364
+ msgid "Damian Góra"
365
+ msgstr ""
366
+
367
+ #. Author URI of the plugin
368
+ msgid "http://damiangora.com"
369
+ msgstr ""
readme.txt CHANGED
@@ -3,8 +3,8 @@ Contributors: damian-gora
3
  Donate link: https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=LD2ALVRLXPZPC
4
  Tags: AJAX, ajax search, autocomplete, category search, custom search, ecommerce, instant search, sive search, product search, products, search, search by sku, search highlight, search plugin, shop, woocommerce, woocommerce live search, WooCommerce Plugin, woocommerce product search, woocommerce search, wordpress search, wp ajax search, wp search, wp search plugin, wp tao
5
  Requires at least: 3.8
6
- Tested up to: 4.6.1
7
- Stable tag: 1.1
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
@@ -67,6 +67,13 @@ Any suggestions or comments are welcome. Feel free to contact me using this [con
67
 
68
  == Changelog ==
69
 
 
 
 
 
 
 
 
70
  = 1.1, October 5, 2016 =
71
  * NEW: Add WPML compatibility
72
  * FIX: Repeating search results for products in a admin dashboard
3
  Donate link: https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=LD2ALVRLXPZPC
4
  Tags: AJAX, ajax search, autocomplete, category search, custom search, ecommerce, instant search, sive search, product search, products, search, search by sku, search highlight, search plugin, shop, woocommerce, woocommerce live search, WooCommerce Plugin, woocommerce product search, woocommerce search, wordpress search, wp ajax search, wp search, wp search plugin, wp tao
5
  Requires at least: 3.8
6
+ Tested up to: 4.7.5
7
+ Stable tag: 1.1.1
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
67
 
68
  == Changelog ==
69
 
70
+ = 1.1.1, June 6, 2017 =
71
+ * ADD: Added Portable Object Template file
72
+ * ADD: Added partial polish translation
73
+ * FIX: WooCommerce 3.0 compatible
74
+ * FIX: Menu items repeated in a search page
75
+ * FIX: Other minor bugs
76
+
77
  = 1.1, October 5, 2016 =
78
  * NEW: Add WPML compatibility
79
  * FIX: Repeating search results for products in a admin dashboard