Ajax Search for WooCommerce - Version 1.2.1

Version Description

Download this release

Release Info

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

Code changes from version 1.2.0 to 1.2.1

ajax-search-for-woocommerce.php CHANGED
@@ -4,13 +4,13 @@
4
  * Plugin Name: AJAX Search for WooCommerce
5
  * Plugin URI: https://wordpress.org/plugins/ajax-search-for-woocommerce/
6
  * Description: Allows your customers to search products easily and quickly. It will display the results instantly while typing in an inputbox.
7
- * Version: 1.2.0
8
  * Author: Damian Góra
9
  * Author URI: http://damiangora.com
10
  * Text Domain: ajax-search-for-woocommerce
11
  * Domain Path: /languages/
12
- * WC requires at least: 3.0
13
- * WC tested up to: 3.4
14
  *
15
  */
16
  // Exit if accessed directly
@@ -71,6 +71,7 @@ if ( ! class_exists( 'DGWT_WC_Ajax_Search' ) && ! function_exists( 'dgora_asfw_f
71
 
72
  new \DgoraWcas\Personalization;
73
  new \DgoraWcas\Scripts;
 
74
  new \DgoraWcas\Integrations\WpTao;
75
 
76
  \DgoraWcas\Shortcode::register();
@@ -257,10 +258,6 @@ if ( ! class_exists( 'DGWT_WC_Ajax_Search' ) && ! function_exists( 'dgora_asfw_f
257
 
258
  require_once DGWT_WCAS_DIR . 'widget.php';
259
 
260
- // @TODO Storefront integrations. Create tis as a option
261
- //require_once DGWT_WCAS_DIR . 'includes/Integrations/Storefront.php';
262
-
263
-
264
  }
265
 
266
  /**
4
  * Plugin Name: AJAX Search for WooCommerce
5
  * Plugin URI: https://wordpress.org/plugins/ajax-search-for-woocommerce/
6
  * Description: Allows your customers to search products easily and quickly. It will display the results instantly while typing in an inputbox.
7
+ * Version: 1.2.1
8
  * Author: Damian Góra
9
  * Author URI: http://damiangora.com
10
  * Text Domain: ajax-search-for-woocommerce
11
  * Domain Path: /languages/
12
+ * WC requires at least: 3.0.0
13
+ * WC tested up to: 3.5.0
14
  *
15
  */
16
  // Exit if accessed directly
71
 
72
  new \DgoraWcas\Personalization;
73
  new \DgoraWcas\Scripts;
74
+ new \DgoraWcas\Integrations\Themes\ThemesCompatibility;
75
  new \DgoraWcas\Integrations\WpTao;
76
 
77
  \DgoraWcas\Shortcode::register();
258
 
259
  require_once DGWT_WCAS_DIR . 'widget.php';
260
 
 
 
 
 
261
  }
262
 
263
  /**
assets/css/style.css CHANGED
@@ -1,29 +1,33 @@
 
 
 
 
1
  .dgwt-wcas-search-wrapp {
2
  position: relative;
3
  display: block;
4
  color: #444;
5
- min-width: 300px;
6
  width: 100%;
7
  text-align: left;
8
  margin: 0 auto;
9
  }
10
 
11
-
12
- .dgwt-wcas-search-wrapp .product-title{
13
  color: #333;
14
  display: block;
15
  line-height: 110%;
16
  margin: 0;
17
  }
18
- .dgwt-wcas-tpd-image img{
19
- margin: 0 15px 0 0!important;
 
20
  display: block;
21
  }
 
22
  .rtl .dgwt-wcas-tpd-image img {
23
- margin: 0 0 0 15px!important;
24
  }
25
 
26
-
27
  .dgwt-wcas-default-preloader * {
28
  box-sizing: border-box;
29
  -o-box-sizing: border-box;
@@ -37,7 +41,7 @@
37
  height: 1em;
38
  font-size: 169px;
39
  position: relative;
40
- display:block;
41
  margin: 56px auto;
42
  }
43
 
@@ -63,13 +67,15 @@
63
  -webkit-animation: dgwt-wcas-spin 0.8s infinite;
64
  -moz-animation: dgwt-wcas-spin 0.8s infinite;
65
  }
 
66
  .dgwt-wcas-default-preloader:after {
67
  left: 0;
68
- border-left-color: rgba(0,0,0,0.05);
69
  }
 
70
  .dgwt-wcas-default-preloader:before {
71
  right: 0;
72
- border-right-color: rgba(0,0,0,0.02);
73
  animation-delay: -0.2025s;
74
  -o-animation-delay: -0.2025s;
75
  -ms-animation-delay: -0.2025s;
@@ -106,6 +112,7 @@
106
  -moz-transform: rotate(360deg);
107
  }
108
  }
 
109
  .dgwt-wcas-preloader-wrapp img {
110
  margin: 10px auto 0 auto;
111
  display: block;
@@ -122,17 +129,16 @@
122
  box-sizing: border-box;
123
  overflow-y: auto;
124
  }
125
-
126
- .dgwt-wcas-suggestions-fixed {
127
- position: fixed!important;
128
- border-top: 1px solid #ddd;
129
  border-bottom: none;
130
  }
131
 
132
  .dgwt-wcas-is-detail-box .dgwt-wcas-suggestions-wrapp {
133
  max-width: 550px;
134
  }
135
- .dgwt-wcas-full-width.dgwt-wcas-is-detail-box .dgwt-wcas-suggestion{
 
136
  padding: 8px 15px;
137
  }
138
 
@@ -146,7 +152,6 @@
146
  border-right-color: #eee;
147
  }
148
 
149
-
150
  .dgwt-wcas-suggestion {
151
  cursor: pointer;
152
  font-size: 12px;
@@ -160,9 +165,11 @@
160
  justify-content: center;
161
  resize: vertical;
162
  }
 
163
  .dgwt-wcas-suggestion.dgwt-wcas-suggestion-no-border-bottom {
164
  border-bottom: none;
165
  }
 
166
  .dgwt-wcas-suggestion:after {
167
  clear: both;
168
  display: block;
@@ -174,7 +181,6 @@
174
  opacity: 0.5;
175
  }
176
 
177
-
178
  .dgwt-wcas-has-img .dgwt-wcas-suggestion.dgwt-wcas-suggestion-product {
179
  padding: 12px 0;
180
  }
@@ -206,7 +212,7 @@
206
  padding-left: 80px;
207
  }
208
 
209
- .dgwt-wcas-has-img .dgwt-wcas-content-wrapp{
210
  padding-left: 60px;
211
  }
212
 
@@ -224,6 +230,7 @@
224
  font-size: 80%;
225
  margin-left: 6px;
226
  }
 
227
  .dgwt-wcas-st > span {
228
  display: inline-block;
229
  vertical-align: middle;
@@ -257,12 +264,13 @@
257
  height: auto;
258
  width: auto;
259
  max-height: 90%;
 
260
  }
 
261
  .dgwt-wcas-content-wrapp {
262
  padding-left: 60px;
263
  }
264
 
265
-
266
  .dgwt-wcas-sp {
267
  color: #555;
268
  font-size: 14px;
@@ -297,6 +305,7 @@
297
  padding-right: 60px;
298
  margin-top: 5px;
299
  }
 
300
  .rtl .dgwt-wcas-sd {
301
  padding-left: 60px;
302
  padding-right: 0;
@@ -305,8 +314,9 @@
305
  .dgwt-wcas-suggestion-selected {
306
  background-color: #eeeeee;
307
  }
 
308
  .dgwt-wcas-suggestion-selected:first-child {
309
- border-top:none;
310
  }
311
 
312
  .rtl .dgwt-wcas-suggestion {
@@ -338,6 +348,7 @@
338
  margin-top: -1px;
339
  border-top: 1px solid #ddd;
340
  }
 
341
  .dgwt-wcas-details-outside.dgwt-wcas-is-details .dgwt-wcas-suggestions-wrapp {
342
  margin-top: -1px;
343
  border-top: 1px solid #ddd;
@@ -355,13 +366,14 @@
355
  border-radius: 5px 0 0 5px;
356
  }
357
 
358
- .dgwt-wcas-details-notfit .dgwt-wcas-details-wrapp{
359
  display: none;
360
  }
361
 
362
  .dgwt-wcas-full-width .dgwt-wcas-suggestions-wrapp {
363
  border-radius: 0 0 0 5px;
364
  }
 
365
  .dgwt-wcas-full-width .dgwt-wcas-details-wrapp {
366
  border-radius: 0 0 5px 0;
367
  }
@@ -369,6 +381,7 @@
369
  .rtl.dgwt-wcas-full-width .dgwt-wcas-suggestions-wrapp {
370
  border-radius: 0 0 5px 0;
371
  }
 
372
  .rtl.dgwt-wcas-full-width .dgwt-wcas-details-wrapp {
373
  border-radius: 0 0 0 5px;
374
  }
@@ -378,26 +391,27 @@
378
  height: 100%;
379
  }
380
 
381
-
382
  .woocommerce .dgwt-wcas-pd-rating .star-rating {
383
  float: left;
384
  margin-right: 5px;
385
  font-size: 12px;
386
  color: #CCAE72;
387
  }
 
388
  .rtl .dgwt-wcas-pd-rating .star-rating {
389
  float: right;
390
  margin-left: 5px;
391
  margin-right: 0;
392
  }
393
 
394
- .dgwt-wcas-datails-title{
395
  border-bottom: 1px dashed #eee;
396
  display: block;
397
  margin-bottom: 15px;
398
  padding-bottom: 5px;
399
  font-size: 14px;
400
  }
 
401
  .dgwt-wcas-pd-title {
402
  border-bottom: 1px dashed #eee;
403
  margin-bottom: 15px;
@@ -406,6 +420,7 @@
406
  color: #202020;
407
  text-decoration: none;
408
  }
 
409
  .dgwt-wcas-pd-title .product-title {
410
  font-weight: 900;
411
  color: #202020;
@@ -414,7 +429,6 @@
414
  margin: 0;
415
  }
416
 
417
-
418
  .dgwt-wcas-details-title-tax {
419
  text-transform: uppercase;
420
  font-weight: 900;
@@ -424,8 +438,10 @@
424
 
425
  .dgwt-wcas-tax-product-details {
426
  margin-bottom: 15px;
427
- display: block;
428
  text-decoration: none;
 
 
 
429
  }
430
 
431
  .dgwt-wcas-tax-product-details:after {
@@ -437,24 +453,21 @@
437
  .dgwt-wcas-details-wrapp .dgwt-wcas-pd-title {
438
  margin-bottom: 8px;
439
  }
440
- .dgwt-wcas-pd-rest {
441
- display: flex;
442
- flex-direction: column;
443
- float: left;
444
- justify-content: center;
445
- width: calc(100% - 95px);
446
- }
447
  .dgwt-wcas-tpd-image {
448
- float: left;
449
  width: 60px;
450
  margin-right: 15px;
451
  }
 
 
 
 
 
452
  .dgwt-wcas-tpd-rest {
453
- float: left;
454
  max-width: 200px;
455
  }
456
 
457
- .dgwt-wcas-tpd-rest .product-title{
458
  display: block;
459
  line-height: 13px;
460
  font-size: 13px;
@@ -469,7 +482,7 @@
469
  }
470
 
471
  .dgwt-wcas-suggestion-nores {
472
- pointer-events: none;
473
  opacity: 0.45;
474
  }
475
 
@@ -492,14 +505,17 @@
492
  font-size: 90%;
493
  opacity: 0.6;
494
  }
 
495
  .dgwt-wcas-pd-price ins {
496
  background: transparent;
497
  text-decoration: none;
498
  }
 
499
  .dgwt-wcas-pd-rating {
500
  font-size: 13px;
501
  line-height: 13px;
502
  }
 
503
  .dgwt-wcas-pd-rating:after {
504
  content: '';
505
  clear: both;
@@ -512,12 +528,13 @@
512
  line-height: 11px;
513
  }
514
 
515
- .dgwt-wcas-datails-title{
516
  border-bottom: 1px dashed #eee;
517
  display: block;
518
- margin:5px 0 15px 0;
519
  padding-bottom: 5px;
520
  }
 
521
  .dgwt-wcas-pd-title {
522
  border-bottom: 1px dashed #eee;
523
  margin-bottom: 15px;
@@ -526,6 +543,7 @@
526
 
527
  text-decoration: none;
528
  }
 
529
  .dgwt-wcas-pd-title .product-title {
530
  font-weight: 900;
531
 
@@ -533,7 +551,6 @@
533
  letter-spacing: -1px;
534
  }
535
 
536
-
537
  .dgwt-wcas-details-title-tax {
538
  text-transform: uppercase;
539
  font-weight: 900;
@@ -541,36 +558,28 @@
541
  margin-right: 3px;
542
 
543
  }
 
544
  .rtl .dgwt-wcas-details-title-tax {
545
  margin: 0 0 0 3px;
546
  float: right;
547
  }
548
 
549
- .dgwt-wcas-tax-product-details {
550
- margin-bottom: 15px;
551
- display: block;
552
- }
553
-
554
- .dgwt-wcas-tax-product-details:after, .dgwt-wcas-pd-details:after {
555
- content: '';
556
- clear: both;
557
- display: block;
558
- }
559
-
560
  .dgwt-wcas-tpd-image, .dgwt-wcas-pd-image {
561
  float: left;
562
  width: 70px;
563
  margin-right: 15px;
564
  padding: 4px;
565
  background-color: #fff;
566
- border:1px solid #e8e8e8;
567
  border-radius: 4px;
568
  }
569
- .dgwt-wcas-tpd-image img, .dgwt-wcas-pd-image img{
 
570
  display: block;
 
571
  }
572
 
573
- .rtl .dgwt-wcas-tpd-image, .rtl .dgwt-wcas-pd-image{
574
  float: right;
575
  margin-right: 0;
576
  margin-left: 15px;
@@ -582,7 +591,7 @@
582
  }
583
 
584
  input[type="search"].dgwt-wcas-search-input,
585
- input[type="text"].dgwt-cas-search-input {
586
  -webkit-transition: none;
587
  -moz-transition: none;
588
  -ms-transition: none;
@@ -592,6 +601,7 @@ input[type="text"].dgwt-cas-search-input {
592
  box-shadow: none;
593
  margin: 0;
594
  }
 
595
  .dgwt-wcas-search-input::-ms-clear {
596
  display: none;
597
  }
@@ -605,20 +615,23 @@ input[type="text"].dgwt-cas-search-input {
605
  .dgwt-wcas-pd-addtc {
606
  margin: 10px 0;
607
  display: flex;
 
 
608
  }
 
609
  .dgwt-wcas-pd-addtc > .quantity {
610
- margin-right: 10px;
611
- }
612
- .dgwt-wcas-pd-addtc a {
613
- margin-bottom: 5px;
614
  }
615
 
 
 
 
 
616
 
617
- input[type="submit"].dgwt-wcas-search-submit, button.dgwt-wcas-search-submit{
618
  position: relative;
619
  }
620
 
621
-
622
  .dgwt-wcas-ico-magnifier {
623
  bottom: 0;
624
  left: 0;
@@ -629,6 +642,7 @@ input[type="submit"].dgwt-wcas-search-submit, button.dgwt-wcas-search-submit{
629
  height: 65%;
630
  display: block;
631
  }
 
632
  .dgwt-wcas-preloader {
633
  height: 100%;
634
  position: absolute;
@@ -643,7 +657,7 @@ input[type="submit"].dgwt-wcas-search-submit, button.dgwt-wcas-search-submit{
643
 
644
  .rtl .dgwt-wcas-preloader {
645
  right: auto;
646
- left:35px;
647
  }
648
 
649
  .dgwt-wcas-inner-preloader {
@@ -652,13 +666,14 @@ input[type="submit"].dgwt-wcas-search-submit, button.dgwt-wcas-search-submit{
652
  background-position: right 13px center;
653
  background-size: auto 22px;
654
  }
 
655
  @media all and (-ms-high-contrast: none), (-ms-high-contrast: active) {
656
  .dgwt-wcas-inner-preloader {
657
  background-image: url('../img/preloader.gif');
658
  }
659
  }
660
 
661
- .dgwt-wcas-close:not(.dgwt-wcas-inner-preloader){
662
  cursor: pointer;
663
  background-image: url('../img/close.png');
664
  background-repeat: no-repeat;
@@ -682,7 +697,7 @@ input[type="submit"].dgwt-wcas-search-submit, button.dgwt-wcas-search-submit{
682
  }
683
  }
684
 
685
- .dgwt-wcas-suggestion strong{
686
  font-weight: bold;
687
  }
688
 
@@ -693,33 +708,37 @@ input[type="submit"].dgwt-wcas-search-submit, button.dgwt-wcas-search-submit{
693
  position: absolute !important;
694
  width: 1px;
695
  }
 
696
  .dgwt-wcas-sf-wrapp:before, .dgwt-wcas-sf-wrapp:after {
697
- content:"";
698
- display:table;
699
  }
 
700
  .dgwt-wcas-sf-wrapp:after {
701
- clear:both;
702
  }
 
703
  .dgwt-wcas-sf-wrapp {
704
- zoom:1;
705
  width: 100%;
706
  margin: 0;
707
  position: relative;
708
  background: none;
709
  }
710
 
711
- .dgwt-wcas-sf-wrapp input[type="search"].dgwt-wcas-search-input{
712
  width: 100%;
713
  height: 40px;
714
  font-size: 14px;
715
  line-height: 100%;
716
  padding: 10px 15px;
717
  background: #fff;
718
- border:1px solid #ddd;
719
  border-radius: 3px;
720
- -webkit-border-radius:3px;
721
  -webkit-appearance: none;
722
  }
 
723
  .dgwt-wcas-open .dgwt-wcas-sf-wrapp input[type="search"].dgwt-wcas-search-input {
724
  border-radius: 3px 3px 0 0;
725
  }
@@ -727,7 +746,7 @@ input[type="submit"].dgwt-wcas-search-submit, button.dgwt-wcas-search-submit{
727
  .dgwt-wcas-sf-wrapp input[type="search"].dgwt-wcas-search-input:focus {
728
  outline: 0;
729
  background: #fff;
730
- box-shadow: 0 0 9px 1px rgba(0,0,0,0.06);
731
  }
732
 
733
  .dgwt-wcas-sf-wrapp input[type="search"].dgwt-wcas-search-input::-webkit-input-placeholder {
@@ -735,6 +754,7 @@ input[type="submit"].dgwt-wcas-search-submit, button.dgwt-wcas-search-submit{
735
  font-weight: normal;
736
  font-style: italic;
737
  }
 
738
  .dgwt-wcas-sf-wrapp input[type="search"].dgwt-wcas-search-input:-moz-placeholder {
739
  color: #999;
740
  font-weight: normal;
@@ -775,8 +795,8 @@ input[type="submit"].dgwt-wcas-search-submit, button.dgwt-wcas-search-submit{
775
  text-transform: uppercase;
776
  background-color: #96588A;
777
  border-radius: 0 2px 2px 0;
778
- -webkit-border-radius:0 2px 2px 0;
779
- text-shadow: 0 -1px 0 rgba(0, 0 ,0, .3);
780
  -webkit-box-shadow: none;
781
  box-shadow: none;
782
  -webkit-appearance: none;
@@ -787,16 +807,16 @@ input[type="submit"].dgwt-wcas-search-submit, button.dgwt-wcas-search-submit{
787
  right: auto;
788
  }
789
 
790
- .dgwt-wcas-open .dgwt-wcas-sf-wrapp .dgwt-wcas-search-submit{
791
  border-radius: 0 2px 0 0;
792
  }
793
 
794
- .dgwt-wcas-sf-wrapp .dgwt-wcas-search-submit:hover{
795
  opacity: 0.7;
796
  }
797
 
798
  .dgwt-wcas-sf-wrapp .dgwt-wcas-search-submit:active,
799
- .dgwt-wcas-sf-wrapp .dgwt-wcas-search-submit:focus{
800
  opacity: 0.7;
801
  outline: 0;
802
  }
@@ -815,6 +835,7 @@ input[type="submit"].dgwt-wcas-search-submit, button.dgwt-wcas-search-submit{
815
  -o-transition: all 250ms ease-in-out;
816
  transition: all 250ms ease-in-out;
817
  }
 
818
  .rtl .dgwt-wcas-sf-wrapp .dgwt-wcas-search-submit:before {
819
  left: auto;
820
  right: -6px;
@@ -822,12 +843,12 @@ input[type="submit"].dgwt-wcas-search-submit, button.dgwt-wcas-search-submit{
822
  border-style: solid none solid solid;
823
  }
824
 
825
- .dgwt-wcas-sf-wrapp .dgwt-wcas-search-submit:hover:before{
826
  border-right-color: #96588A;
827
  }
828
 
829
  .dgwt-wcas-sf-wrapp .dgwt-wcas-search-submit:focus:before,
830
- .dgwt-wcas-sf-wrapp .dgwt-wcas-search-submit:active:before{
831
  border-right-color: #96588A;
832
  }
833
 
@@ -837,12 +858,13 @@ input[type="submit"].dgwt-wcas-search-submit, button.dgwt-wcas-search-submit{
837
  }
838
 
839
  .dgwt-wcas-ico-magnifier {
840
- fill:#fff;
841
  }
842
 
843
  .dgwt-wcas-has-img .dgwt-wcas-suggestion.dgwt-wcas-suggestion-product {
844
  min-height: 60px;
845
  }
 
846
  .dgwt-wcas-details-inner .added_to_cart {
847
  display: block;
848
  }
@@ -851,18 +873,19 @@ input[type="submit"].dgwt-wcas-search-submit, button.dgwt-wcas-search-submit{
851
  Has image
852
  ---------------------------------------------------------*/
853
  .dgwt-wcas-has-img .dgwt-wcas-sp > *,
854
- .dgwt-wcas-has-desc .dgwt-wcas-sp > *{
855
  display: block;
856
  }
 
857
  .dgwt-wcas-has-img .dgwt-wcas-sp,
858
- .dgwt-wcas-has-desc .dgwt-wcas-sp{
859
  top: 12px;
860
  }
861
 
862
  /*------------------------------------------------------
863
  Specific styles for details box
864
  ---------------------------------------------------------*/
865
- .dgwt-wcas-is-details .dgwt-wcas-content-wrapp{
866
  display: flex;
867
  flex-direction: column;
868
  height: 100%;
@@ -874,22 +897,29 @@ input[type="submit"].dgwt-wcas-search-submit, button.dgwt-wcas-search-submit{
874
  .dgwt-wcas-is-details .dgwt-wcas-suggestions-wrapp {
875
  min-height: 340px;
876
  }
 
877
  body:not(.dgwt-wcas-is-details) .dgwt-wcas-suggestion:last-child {
878
- border-bottom: none;
879
  }
880
 
881
  .dgwt-wcas-is-details .dgwt-wcas-has-img .dgwt-wcas-suggestion {
882
  min-height: 40px;
883
  }
 
884
  .dgwt-wcas-is-details .dgwt-wcas-has-img .dgwt-wcas-content-wrapp {
885
  padding-left: 40px;
886
  }
 
887
  .dgwt-wcas-is-details .dgwt-wcas-suggestions-wrapp {
888
  overflow: visible;
889
  }
890
- .dgwt-wcas-is-details .dgwt-wcas-si{
 
891
  min-height: 40px;
892
  width: 30px;
 
 
 
893
  }
894
 
895
  .dgwt-wcas-is-details .dgwt-wcas-sp {
@@ -900,17 +930,20 @@ border-bottom: none;
900
  justify-content: center;
901
  resize: vertical;
902
  }
 
903
  .dgwt-wcas-is-details .dgwt-wcas-sd {
904
  font-size: 11px;
905
  line-height: 100%;
906
  }
 
907
  .dgwt-wcas-has-img .dgwt-wcas-suggestion[data-taxonomy='product_cat'],
908
- .dgwt-wcas-has-img .dgwt-wcas-suggestion[data-taxonomy='product_tag']{
909
  padding-left: 15px;
910
  min-height: 0;
911
  }
 
912
  .dgwt-wcas-has-img .dgwt-wcas-suggestion[data-taxonomy='product_cat'] .dgwt-wcas-st,
913
- .dgwt-wcas-has-img .dgwt-wcas-suggestion[data-taxonomy='product_tag'] .dgwt-wcas-st{
914
  padding-left: 0;
915
  }
916
 
@@ -922,9 +955,15 @@ border-bottom: none;
922
  left: 12px;
923
  right: auto;
924
  opacity: 0.5;
925
- fill:#000;
926
  }
927
 
928
  .dgwt-wcas-no-submit .dgwt-wcas-sf-wrapp input[type="search"].dgwt-wcas-search-input {
929
  padding: 10px 15px 10px 40px;
 
 
 
 
 
 
930
  }
1
+ .dgwt-wcas-block-scroll {
2
+ overflow: hidden;
3
+ }
4
+
5
  .dgwt-wcas-search-wrapp {
6
  position: relative;
7
  display: block;
8
  color: #444;
9
+ min-width: 230px;
10
  width: 100%;
11
  text-align: left;
12
  margin: 0 auto;
13
  }
14
 
15
+ .dgwt-wcas-search-wrapp .product-title {
 
16
  color: #333;
17
  display: block;
18
  line-height: 110%;
19
  margin: 0;
20
  }
21
+
22
+ .dgwt-wcas-tpd-image img {
23
+ margin: 0 15px 0 0 !important;
24
  display: block;
25
  }
26
+
27
  .rtl .dgwt-wcas-tpd-image img {
28
+ margin: 0 0 0 15px !important;
29
  }
30
 
 
31
  .dgwt-wcas-default-preloader * {
32
  box-sizing: border-box;
33
  -o-box-sizing: border-box;
41
  height: 1em;
42
  font-size: 169px;
43
  position: relative;
44
+ display: block;
45
  margin: 56px auto;
46
  }
47
 
67
  -webkit-animation: dgwt-wcas-spin 0.8s infinite;
68
  -moz-animation: dgwt-wcas-spin 0.8s infinite;
69
  }
70
+
71
  .dgwt-wcas-default-preloader:after {
72
  left: 0;
73
+ border-left-color: rgba(0, 0, 0, 0.05);
74
  }
75
+
76
  .dgwt-wcas-default-preloader:before {
77
  right: 0;
78
+ border-right-color: rgba(0, 0, 0, 0.02);
79
  animation-delay: -0.2025s;
80
  -o-animation-delay: -0.2025s;
81
  -ms-animation-delay: -0.2025s;
112
  -moz-transform: rotate(360deg);
113
  }
114
  }
115
+
116
  .dgwt-wcas-preloader-wrapp img {
117
  margin: 10px auto 0 auto;
118
  display: block;
129
  box-sizing: border-box;
130
  overflow-y: auto;
131
  }
132
+ .dgwt-wcas-suggestions-wrapp.dgwt-wcas-suggestions-wrapp--top {
133
+ border: 1px solid #ddd;
 
 
134
  border-bottom: none;
135
  }
136
 
137
  .dgwt-wcas-is-detail-box .dgwt-wcas-suggestions-wrapp {
138
  max-width: 550px;
139
  }
140
+
141
+ .dgwt-wcas-full-width.dgwt-wcas-is-detail-box .dgwt-wcas-suggestion {
142
  padding: 8px 15px;
143
  }
144
 
152
  border-right-color: #eee;
153
  }
154
 
 
155
  .dgwt-wcas-suggestion {
156
  cursor: pointer;
157
  font-size: 12px;
165
  justify-content: center;
166
  resize: vertical;
167
  }
168
+
169
  .dgwt-wcas-suggestion.dgwt-wcas-suggestion-no-border-bottom {
170
  border-bottom: none;
171
  }
172
+
173
  .dgwt-wcas-suggestion:after {
174
  clear: both;
175
  display: block;
181
  opacity: 0.5;
182
  }
183
 
 
184
  .dgwt-wcas-has-img .dgwt-wcas-suggestion.dgwt-wcas-suggestion-product {
185
  padding: 12px 0;
186
  }
212
  padding-left: 80px;
213
  }
214
 
215
+ .dgwt-wcas-has-img .dgwt-wcas-content-wrapp {
216
  padding-left: 60px;
217
  }
218
 
230
  font-size: 80%;
231
  margin-left: 6px;
232
  }
233
+
234
  .dgwt-wcas-st > span {
235
  display: inline-block;
236
  vertical-align: middle;
264
  height: auto;
265
  width: auto;
266
  max-height: 90%;
267
+ max-width: 100%;
268
  }
269
+
270
  .dgwt-wcas-content-wrapp {
271
  padding-left: 60px;
272
  }
273
 
 
274
  .dgwt-wcas-sp {
275
  color: #555;
276
  font-size: 14px;
305
  padding-right: 60px;
306
  margin-top: 5px;
307
  }
308
+
309
  .rtl .dgwt-wcas-sd {
310
  padding-left: 60px;
311
  padding-right: 0;
314
  .dgwt-wcas-suggestion-selected {
315
  background-color: #eeeeee;
316
  }
317
+
318
  .dgwt-wcas-suggestion-selected:first-child {
319
+ border-top: none;
320
  }
321
 
322
  .rtl .dgwt-wcas-suggestion {
348
  margin-top: -1px;
349
  border-top: 1px solid #ddd;
350
  }
351
+
352
  .dgwt-wcas-details-outside.dgwt-wcas-is-details .dgwt-wcas-suggestions-wrapp {
353
  margin-top: -1px;
354
  border-top: 1px solid #ddd;
366
  border-radius: 5px 0 0 5px;
367
  }
368
 
369
+ .dgwt-wcas-details-notfit .dgwt-wcas-details-wrapp {
370
  display: none;
371
  }
372
 
373
  .dgwt-wcas-full-width .dgwt-wcas-suggestions-wrapp {
374
  border-radius: 0 0 0 5px;
375
  }
376
+
377
  .dgwt-wcas-full-width .dgwt-wcas-details-wrapp {
378
  border-radius: 0 0 5px 0;
379
  }
381
  .rtl.dgwt-wcas-full-width .dgwt-wcas-suggestions-wrapp {
382
  border-radius: 0 0 5px 0;
383
  }
384
+
385
  .rtl.dgwt-wcas-full-width .dgwt-wcas-details-wrapp {
386
  border-radius: 0 0 0 5px;
387
  }
391
  height: 100%;
392
  }
393
 
 
394
  .woocommerce .dgwt-wcas-pd-rating .star-rating {
395
  float: left;
396
  margin-right: 5px;
397
  font-size: 12px;
398
  color: #CCAE72;
399
  }
400
+
401
  .rtl .dgwt-wcas-pd-rating .star-rating {
402
  float: right;
403
  margin-left: 5px;
404
  margin-right: 0;
405
  }
406
 
407
+ .dgwt-wcas-datails-title {
408
  border-bottom: 1px dashed #eee;
409
  display: block;
410
  margin-bottom: 15px;
411
  padding-bottom: 5px;
412
  font-size: 14px;
413
  }
414
+
415
  .dgwt-wcas-pd-title {
416
  border-bottom: 1px dashed #eee;
417
  margin-bottom: 15px;
420
  color: #202020;
421
  text-decoration: none;
422
  }
423
+
424
  .dgwt-wcas-pd-title .product-title {
425
  font-weight: 900;
426
  color: #202020;
429
  margin: 0;
430
  }
431
 
 
432
  .dgwt-wcas-details-title-tax {
433
  text-transform: uppercase;
434
  font-weight: 900;
438
 
439
  .dgwt-wcas-tax-product-details {
440
  margin-bottom: 15px;
 
441
  text-decoration: none;
442
+ display: flex;
443
+ align-items: center;
444
+ justify-content: left;
445
  }
446
 
447
  .dgwt-wcas-tax-product-details:after {
453
  .dgwt-wcas-details-wrapp .dgwt-wcas-pd-title {
454
  margin-bottom: 8px;
455
  }
456
+
 
 
 
 
 
 
457
  .dgwt-wcas-tpd-image {
 
458
  width: 60px;
459
  margin-right: 15px;
460
  }
461
+
462
+ .dgwt-wcas-pd-rest {
463
+ justify-content: center;
464
+ }
465
+
466
  .dgwt-wcas-tpd-rest {
 
467
  max-width: 200px;
468
  }
469
 
470
+ .dgwt-wcas-tpd-rest .product-title {
471
  display: block;
472
  line-height: 13px;
473
  font-size: 13px;
482
  }
483
 
484
  .dgwt-wcas-suggestion-nores {
485
+ pointer-events: none;
486
  opacity: 0.45;
487
  }
488
 
505
  font-size: 90%;
506
  opacity: 0.6;
507
  }
508
+
509
  .dgwt-wcas-pd-price ins {
510
  background: transparent;
511
  text-decoration: none;
512
  }
513
+
514
  .dgwt-wcas-pd-rating {
515
  font-size: 13px;
516
  line-height: 13px;
517
  }
518
+
519
  .dgwt-wcas-pd-rating:after {
520
  content: '';
521
  clear: both;
528
  line-height: 11px;
529
  }
530
 
531
+ .dgwt-wcas-datails-title {
532
  border-bottom: 1px dashed #eee;
533
  display: block;
534
+ margin: 5px 0 15px 0;
535
  padding-bottom: 5px;
536
  }
537
+
538
  .dgwt-wcas-pd-title {
539
  border-bottom: 1px dashed #eee;
540
  margin-bottom: 15px;
543
 
544
  text-decoration: none;
545
  }
546
+
547
  .dgwt-wcas-pd-title .product-title {
548
  font-weight: 900;
549
 
551
  letter-spacing: -1px;
552
  }
553
 
 
554
  .dgwt-wcas-details-title-tax {
555
  text-transform: uppercase;
556
  font-weight: 900;
558
  margin-right: 3px;
559
 
560
  }
561
+
562
  .rtl .dgwt-wcas-details-title-tax {
563
  margin: 0 0 0 3px;
564
  float: right;
565
  }
566
 
 
 
 
 
 
 
 
 
 
 
 
567
  .dgwt-wcas-tpd-image, .dgwt-wcas-pd-image {
568
  float: left;
569
  width: 70px;
570
  margin-right: 15px;
571
  padding: 4px;
572
  background-color: #fff;
573
+ border: 1px solid #e8e8e8;
574
  border-radius: 4px;
575
  }
576
+
577
+ .dgwt-wcas-tpd-image img, .dgwt-wcas-pd-image img {
578
  display: block;
579
+ max-width: 100%;
580
  }
581
 
582
+ .rtl .dgwt-wcas-tpd-image, .rtl .dgwt-wcas-pd-image {
583
  float: right;
584
  margin-right: 0;
585
  margin-left: 15px;
591
  }
592
 
593
  input[type="search"].dgwt-wcas-search-input,
594
+ input[type="text"].dgwt-cas-search-input {
595
  -webkit-transition: none;
596
  -moz-transition: none;
597
  -ms-transition: none;
601
  box-shadow: none;
602
  margin: 0;
603
  }
604
+
605
  .dgwt-wcas-search-input::-ms-clear {
606
  display: none;
607
  }
615
  .dgwt-wcas-pd-addtc {
616
  margin: 10px 0;
617
  display: flex;
618
+ align-items: center;
619
+ justify-content: flex-end;
620
  }
621
+
622
  .dgwt-wcas-pd-addtc > .quantity {
623
+ margin-right: 10px;
 
 
 
624
  }
625
 
626
+ .dgwt-wcas-pd-addtc .add_to_cart_inline,
627
+ .dgwt-wcas-pd-addtc .add_to_cart_button{
628
+ margin: 0;
629
+ }
630
 
631
+ input[type="submit"].dgwt-wcas-search-submit, button.dgwt-wcas-search-submit {
632
  position: relative;
633
  }
634
 
 
635
  .dgwt-wcas-ico-magnifier {
636
  bottom: 0;
637
  left: 0;
642
  height: 65%;
643
  display: block;
644
  }
645
+
646
  .dgwt-wcas-preloader {
647
  height: 100%;
648
  position: absolute;
657
 
658
  .rtl .dgwt-wcas-preloader {
659
  right: auto;
660
+ left: 35px;
661
  }
662
 
663
  .dgwt-wcas-inner-preloader {
666
  background-position: right 13px center;
667
  background-size: auto 22px;
668
  }
669
+
670
  @media all and (-ms-high-contrast: none), (-ms-high-contrast: active) {
671
  .dgwt-wcas-inner-preloader {
672
  background-image: url('../img/preloader.gif');
673
  }
674
  }
675
 
676
+ .dgwt-wcas-close:not(.dgwt-wcas-inner-preloader) {
677
  cursor: pointer;
678
  background-image: url('../img/close.png');
679
  background-repeat: no-repeat;
697
  }
698
  }
699
 
700
+ .dgwt-wcas-suggestion strong {
701
  font-weight: bold;
702
  }
703
 
708
  position: absolute !important;
709
  width: 1px;
710
  }
711
+
712
  .dgwt-wcas-sf-wrapp:before, .dgwt-wcas-sf-wrapp:after {
713
+ content: "";
714
+ display: table;
715
  }
716
+
717
  .dgwt-wcas-sf-wrapp:after {
718
+ clear: both;
719
  }
720
+
721
  .dgwt-wcas-sf-wrapp {
722
+ zoom: 1;
723
  width: 100%;
724
  margin: 0;
725
  position: relative;
726
  background: none;
727
  }
728
 
729
+ .dgwt-wcas-sf-wrapp input[type="search"].dgwt-wcas-search-input {
730
  width: 100%;
731
  height: 40px;
732
  font-size: 14px;
733
  line-height: 100%;
734
  padding: 10px 15px;
735
  background: #fff;
736
+ border: 1px solid #ddd;
737
  border-radius: 3px;
738
+ -webkit-border-radius: 3px;
739
  -webkit-appearance: none;
740
  }
741
+
742
  .dgwt-wcas-open .dgwt-wcas-sf-wrapp input[type="search"].dgwt-wcas-search-input {
743
  border-radius: 3px 3px 0 0;
744
  }
746
  .dgwt-wcas-sf-wrapp input[type="search"].dgwt-wcas-search-input:focus {
747
  outline: 0;
748
  background: #fff;
749
+ box-shadow: 0 0 9px 1px rgba(0, 0, 0, 0.06);
750
  }
751
 
752
  .dgwt-wcas-sf-wrapp input[type="search"].dgwt-wcas-search-input::-webkit-input-placeholder {
754
  font-weight: normal;
755
  font-style: italic;
756
  }
757
+
758
  .dgwt-wcas-sf-wrapp input[type="search"].dgwt-wcas-search-input:-moz-placeholder {
759
  color: #999;
760
  font-weight: normal;
795
  text-transform: uppercase;
796
  background-color: #96588A;
797
  border-radius: 0 2px 2px 0;
798
+ -webkit-border-radius: 0 2px 2px 0;
799
+ text-shadow: 0 -1px 0 rgba(0, 0, 0, .3);
800
  -webkit-box-shadow: none;
801
  box-shadow: none;
802
  -webkit-appearance: none;
807
  right: auto;
808
  }
809
 
810
+ .dgwt-wcas-open .dgwt-wcas-sf-wrapp .dgwt-wcas-search-submit {
811
  border-radius: 0 2px 0 0;
812
  }
813
 
814
+ .dgwt-wcas-sf-wrapp .dgwt-wcas-search-submit:hover {
815
  opacity: 0.7;
816
  }
817
 
818
  .dgwt-wcas-sf-wrapp .dgwt-wcas-search-submit:active,
819
+ .dgwt-wcas-sf-wrapp .dgwt-wcas-search-submit:focus {
820
  opacity: 0.7;
821
  outline: 0;
822
  }
835
  -o-transition: all 250ms ease-in-out;
836
  transition: all 250ms ease-in-out;
837
  }
838
+
839
  .rtl .dgwt-wcas-sf-wrapp .dgwt-wcas-search-submit:before {
840
  left: auto;
841
  right: -6px;
843
  border-style: solid none solid solid;
844
  }
845
 
846
+ .dgwt-wcas-sf-wrapp .dgwt-wcas-search-submit:hover:before {
847
  border-right-color: #96588A;
848
  }
849
 
850
  .dgwt-wcas-sf-wrapp .dgwt-wcas-search-submit:focus:before,
851
+ .dgwt-wcas-sf-wrapp .dgwt-wcas-search-submit:active:before {
852
  border-right-color: #96588A;
853
  }
854
 
858
  }
859
 
860
  .dgwt-wcas-ico-magnifier {
861
+ fill: #fff;
862
  }
863
 
864
  .dgwt-wcas-has-img .dgwt-wcas-suggestion.dgwt-wcas-suggestion-product {
865
  min-height: 60px;
866
  }
867
+
868
  .dgwt-wcas-details-inner .added_to_cart {
869
  display: block;
870
  }
873
  Has image
874
  ---------------------------------------------------------*/
875
  .dgwt-wcas-has-img .dgwt-wcas-sp > *,
876
+ .dgwt-wcas-has-desc .dgwt-wcas-sp > * {
877
  display: block;
878
  }
879
+
880
  .dgwt-wcas-has-img .dgwt-wcas-sp,
881
+ .dgwt-wcas-has-desc .dgwt-wcas-sp {
882
  top: 12px;
883
  }
884
 
885
  /*------------------------------------------------------
886
  Specific styles for details box
887
  ---------------------------------------------------------*/
888
+ .dgwt-wcas-is-details .dgwt-wcas-content-wrapp {
889
  display: flex;
890
  flex-direction: column;
891
  height: 100%;
897
  .dgwt-wcas-is-details .dgwt-wcas-suggestions-wrapp {
898
  min-height: 340px;
899
  }
900
+
901
  body:not(.dgwt-wcas-is-details) .dgwt-wcas-suggestion:last-child {
902
+ border-bottom: none;
903
  }
904
 
905
  .dgwt-wcas-is-details .dgwt-wcas-has-img .dgwt-wcas-suggestion {
906
  min-height: 40px;
907
  }
908
+
909
  .dgwt-wcas-is-details .dgwt-wcas-has-img .dgwt-wcas-content-wrapp {
910
  padding-left: 40px;
911
  }
912
+
913
  .dgwt-wcas-is-details .dgwt-wcas-suggestions-wrapp {
914
  overflow: visible;
915
  }
916
+
917
+ .dgwt-wcas-is-details .dgwt-wcas-si {
918
  min-height: 40px;
919
  width: 30px;
920
+ max-width: 100%;
921
+ max-width: 100%;
922
+ box-sizing: border-box;
923
  }
924
 
925
  .dgwt-wcas-is-details .dgwt-wcas-sp {
930
  justify-content: center;
931
  resize: vertical;
932
  }
933
+
934
  .dgwt-wcas-is-details .dgwt-wcas-sd {
935
  font-size: 11px;
936
  line-height: 100%;
937
  }
938
+
939
  .dgwt-wcas-has-img .dgwt-wcas-suggestion[data-taxonomy='product_cat'],
940
+ .dgwt-wcas-has-img .dgwt-wcas-suggestion[data-taxonomy='product_tag'] {
941
  padding-left: 15px;
942
  min-height: 0;
943
  }
944
+
945
  .dgwt-wcas-has-img .dgwt-wcas-suggestion[data-taxonomy='product_cat'] .dgwt-wcas-st,
946
+ .dgwt-wcas-has-img .dgwt-wcas-suggestion[data-taxonomy='product_tag'] .dgwt-wcas-st {
947
  padding-left: 0;
948
  }
949
 
955
  left: 12px;
956
  right: auto;
957
  opacity: 0.5;
958
+ fill: #000;
959
  }
960
 
961
  .dgwt-wcas-no-submit .dgwt-wcas-sf-wrapp input[type="search"].dgwt-wcas-search-input {
962
  padding: 10px 15px 10px 40px;
963
+ }
964
+
965
+ /* compatibility with external plugins and themes */
966
+ body .dgwt-wcas-content-wrapp .zwave,
967
+ body .dgwt-wcas-content-wrapp .rood {
968
+ display: none;
969
  }
assets/css/style.min.css CHANGED
@@ -1 +1 @@
1
- .dgwt-wcas-search-wrapp{position:relative;display:block;color:#444;min-width:300px;width:100%;text-align:left;margin:0 auto}.dgwt-wcas-search-wrapp .product-title{color:#333;display:block;line-height:110%;margin:0}.dgwt-wcas-tpd-image img{margin:0 15px 0 0!important;display:block}.rtl .dgwt-wcas-tpd-image img{margin:0 0 0 15px!important}.dgwt-wcas-default-preloader *{box-sizing:border-box;-o-box-sizing:border-box;-ms-box-sizing:border-box;-webkit-box-sizing:border-box;-moz-box-sizing:border-box}.dgwt-wcas-default-preloader{width:1em;height:1em;font-size:169px;position:relative;display:block;margin:56px auto}.dgwt-wcas-default-preloader:after,.dgwt-wcas-default-preloader:before{content:"";top:0;display:block;width:1em;height:1em;position:absolute;border-width:.503em;border-style:double;border-color:transparent;border-radius:1em;box-sizing:border-box;-o-box-sizing:border-box;-ms-box-sizing:border-box;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;animation:dgwt-wcas-spin .8s infinite;-o-animation:dgwt-wcas-spin .8s infinite;-ms-animation:dgwt-wcas-spin .8s infinite;-webkit-animation:dgwt-wcas-spin .8s infinite;-moz-animation:dgwt-wcas-spin .8s infinite}.dgwt-wcas-default-preloader:after{left:0;border-left-color:rgba(0,0,0,.05)}.dgwt-wcas-default-preloader:before{right:0;border-right-color:rgba(0,0,0,.02);animation-delay:-.2025s;-o-animation-delay:-.2025s;-ms-animation-delay:-.2025s;-webkit-animation-delay:-.2025s;-moz-animation-delay:-.2025s}@keyframes dgwt-wcas-spin{from{transform:rotate(360deg)}}@-o-keyframes dgwt-wcas-spin{from{-o-transform:rotate(360deg)}}@-ms-keyframes dgwt-wcas-spin{from{-ms-transform:rotate(360deg)}}@-webkit-keyframes dgwt-wcas-spin{from{-webkit-transform:rotate(360deg)}}@-moz-keyframes dgwt-wcas-spin{from{-moz-transform:rotate(360deg)}}.dgwt-wcas-preloader-wrapp img{margin:10px auto 0;display:block;max-width:200px}.dgwt-wcas-suggestions-wrapp{background:#fff;border:1px solid #ddd;border-top:none;padding:0;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;overflow-y:auto}.dgwt-wcas-suggestions-fixed{position:fixed!important;border-top:1px solid #ddd;border-bottom:none}.dgwt-wcas-is-detail-box .dgwt-wcas-suggestions-wrapp{max-width:550px}.dgwt-wcas-full-width.dgwt-wcas-is-detail-box .dgwt-wcas-suggestion{padding:8px 15px}.dgwt-wcas-details-left .dgwt-wcas-suggestions-wrapp{border-radius:0 0 5px;border-left-color:#eee}.dgwt-wcas-details-right .dgwt-wcas-suggestions-wrapp{border-radius:0 0 0 5px;border-right-color:#eee}.dgwt-wcas-suggestion{cursor:pointer;font-size:12px;line-height:110%;text-align:left;padding:7px 0;position:relative;border-bottom:1px solid #dfdfdf;display:flex;flex-direction:column;justify-content:center;resize:vertical}.dgwt-wcas-si,.dgwt-wcas-si img{position:absolute;display:block}.dgwt-wcas-suggestion.dgwt-wcas-suggestion-no-border-bottom{border-bottom:none}.dgwt-wcas-suggestion:after{clear:both;display:block;content:''}.dgwt-wcas-suggestion.dgwt-wcas-nores{cursor:default;opacity:.5}.dgwt-wcas-has-img .dgwt-wcas-suggestion.dgwt-wcas-suggestion-product{padding:12px 0}.dgwt-wcas-st{padding-left:10px;display:block;color:#444;font-size:15px}.dgwt-wcas-st>span.dgwt-wcas-st--tax{display:block;font-style:italic;font-size:10px;text-transform:uppercase;opacity:.4;line-height:10px;margin-bottom:1px;letter-spacing:2px}.dgwt-wcas-has-price .dgwt-wcas-st{padding-right:80px}.rtl .dgwt-wcas-has-price .dgwt-wcas-st{padding-right:0;padding-left:80px}.dgwt-wcas-has-img .dgwt-wcas-content-wrapp{padding-left:60px}.rtl .dgwt-wcas-has-img .dgwt-wcas-content-wrapp{padding-right:70px;padding-left:0}.rtl.dgwt-wcas-is-details .dgwt-wcas-has-img .dgwt-wcas-content-wrapp{padding-right:50px;padding-left:0}.dgwt-wcas-sku{font-size:80%;margin-left:6px}.dgwt-wcas-st>span{display:inline-block;vertical-align:middle}.dgwt-wcas-si{left:10px;top:0;width:50px;height:100%;min-height:50px}.rtl .dgwt-wcas-si{left:auto;right:10px}.dgwt-wcas-si img{background:#fff;border:1px solid #e8e8e8;border-radius:3px;bottom:0;margin:auto;padding:2px;top:0;height:auto;width:auto;max-height:90%}.dgwt-wcas-content-wrapp{padding-left:60px}.dgwt-wcas-sp{color:#555;font-size:14px;position:absolute;right:10px;top:5px;vertical-align:middle;line-height:120%;text-align:right}.rtl .dgwt-wcas-sp{right:auto;left:10px}.dgwt-wcas-search-form{margin:0;padding:0}.dgwt-wcas-sp del{opacity:.5;font-size:12px}.dgwt-wcas-sd{color:#777;display:block;padding-left:11px;line-height:14px;padding-right:60px;margin-top:5px}.rtl .dgwt-wcas-sd{padding-left:60px;padding-right:0}.dgwt-wcas-suggestion-selected{background-color:#eee}.dgwt-wcas-suggestion-selected:first-child{border-top:none}.rtl .dgwt-wcas-suggestion{padding-left:0;padding-right:15px;text-align:right}.dgwt-wcas-details-wrapp{background:#fff;border:1px solid #ddd;border-top:none;border-left:none;padding:0;width:300px;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;z-index:100;min-height:340px}.rtl .dgwt-wcas-details-wrapp{border-left:1px solid #ddd;border-right:none}.dgwt-wcas-details-outside .dgwt-wcas-details-wrapp,.dgwt-wcas-details-outside.dgwt-wcas-is-details .dgwt-wcas-suggestions-wrapp{margin-top:-1px;border-top:1px solid #ddd}.dgwt-wcas-details-right .dgwt-wcas-details-wrapp{border-left:none;border-right:1px solid #ddd;border-radius:0 5px 5px 0}.dgwt-wcas-details-left .dgwt-wcas-details-wrapp{border-right:none;border-left:1px solid #ddd;border-radius:5px 0 0 5px}.dgwt-wcas-details-notfit .dgwt-wcas-details-wrapp{display:none}.dgwt-wcas-full-width .dgwt-wcas-suggestions-wrapp{border-radius:0 0 0 5px}.dgwt-wcas-full-width .dgwt-wcas-details-wrapp,.rtl.dgwt-wcas-full-width .dgwt-wcas-suggestions-wrapp{border-radius:0 0 5px}.rtl.dgwt-wcas-full-width .dgwt-wcas-details-wrapp{border-radius:0 0 0 5px}.dgwt-wcas-details-inner{padding:15px 10px;height:100%}.dgwt-wcas-datails-title,.dgwt-wcas-pd-title{border-bottom:1px dashed #eee;padding-bottom:5px}.woocommerce .dgwt-wcas-pd-rating .star-rating{float:left;margin-right:5px;font-size:12px;color:#CCAE72}.rtl .dgwt-wcas-pd-rating .star-rating{float:right;margin-left:5px;margin-right:0}.dgwt-wcas-datails-title{margin-bottom:15px;font-size:14px}.dgwt-wcas-pd-title{color:#202020}.dgwt-wcas-pd-title .product-title{color:#202020;margin:0}.dgwt-wcas-details-wrapp .dgwt-wcas-pd-title{margin-bottom:8px}.dgwt-wcas-pd-rest{display:flex;flex-direction:column;float:left;justify-content:center;width:calc(100% - 95px)}.dgwt-wcas-pd-price,.dgwt-wcas-tpd-rest .product-title{text-overflow:ellipsis;white-space:nowrap;width:145px;line-height:13px;overflow:hidden}.dgwt-wcas-tpd-rest{float:left;max-width:200px}.dgwt-wcas-tpd-rest .product-title{display:block;font-size:13px;font-weight:500;letter-spacing:0;margin:0 0 8px;text-transform:uppercase}.dgwt-wcas-suggestion-nores{pointer-events:none;opacity:.45}.dgwt-wcas-pd-price{font-size:14px;color:#777;margin-top:5px;font-weight:lighter}.dgwt-wcas-pd-price del .amount{font-weight:lighter;background:0 0;font-size:90%;opacity:.6}.dgwt-wcas-details-title-tax,.dgwt-wcas-pd-title .product-title{font-weight:900;letter-spacing:-1px;text-transform:uppercase}.dgwt-wcas-pd-price ins{background:0 0;text-decoration:none}.dgwt-wcas-pd-rating{font-size:13px;line-height:13px}.dgwt-wcas-pd-rating:after{content:'';clear:both;display:block}.dgwt-wcas-pd-review{color:#777;font-size:11px;line-height:11px}.dgwt-wcas-datails-title{display:block;margin:5px 0 15px}.dgwt-wcas-pd-title{margin-bottom:15px;display:block;text-decoration:none}.dgwt-wcas-details-title-tax{margin-right:3px}.rtl .dgwt-wcas-details-title-tax{margin:0 0 0 3px;float:right}.dgwt-wcas-tax-product-details{text-decoration:none;margin-bottom:15px;display:block}.dgwt-wcas-pd-details:after,.dgwt-wcas-tax-product-details:after{content:'';clear:both;display:block}.dgwt-wcas-pd-image,.dgwt-wcas-tpd-image{float:left;width:70px;margin-right:15px;padding:4px;background-color:#fff;border:1px solid #e8e8e8;border-radius:4px}.dgwt-wcas-pd-image img,.dgwt-wcas-tpd-image img{display:block}.rtl .dgwt-wcas-pd-image,.rtl .dgwt-wcas-tpd-image{float:right;margin-right:0;margin-left:15px}.rtl .dgwt-wcas-pd-rest,.rtl .dgwt-wcas-tpd-rest{float:right;max-width:200px}input[type=search].dgwt-wcas-search-input,input[type=text].dgwt-cas-search-input{-webkit-transition:none;-moz-transition:none;-ms-transition:none;-o-transition:none;transition:none;-webkit-box-shadow:none;box-shadow:none;margin:0}.dgwt-wcas-search-input::-ms-clear{display:none}.dgwt-wcas-pd-desc{font-size:13px;line-height:130%;margin:12px 0}.dgwt-wcas-pd-addtc{margin:10px 0;display:flex}.dgwt-wcas-pd-addtc>.quantity{margin-right:10px}.dgwt-wcas-pd-addtc a{margin-bottom:5px}button.dgwt-wcas-search-submit,input[type=submit].dgwt-wcas-search-submit{position:relative}.dgwt-wcas-ico-magnifier{bottom:0;left:0;margin:auto;position:absolute;right:0;top:0;height:65%;display:block;fill:#fff}.dgwt-wcas-preloader{height:100%;position:absolute;right:0;top:0;width:40px;z-index:1;background-repeat:no-repeat;background-position:right 15px center;background-size:auto 44%}.rtl .dgwt-wcas-preloader{right:auto;left:35px}.dgwt-wcas-inner-preloader{background-image:url(../img/preloader.png);background-repeat:no-repeat;background-position:right 13px center;background-size:auto 22px}@media all and (-ms-high-contrast:none),(-ms-high-contrast:active){.dgwt-wcas-inner-preloader{background-image:url(../img/preloader.gif)}}.dgwt-wcas-close:not(.dgwt-wcas-inner-preloader){cursor:pointer;background-image:url(../img/close.png);background-repeat:no-repeat;background-position:right 15px center;background-size:auto 18px;opacity:.6;-webkit-transition:all 160ms ease-in-out;-moz-transition:all 160ms ease-in-out;-ms-transition:all 160ms ease-in-out;-o-transition:all 160ms ease-in-out;transition:all 160ms ease-in-out}.dgwt-wcas-close:hover{opacity:.3}@media screen and (max-width:992px){.dgwt-wcas-is-detail-box .dgwt-wcas-suggestions-wrapp{max-width:none}}.dgwt-wcas-suggestion strong{font-weight:700}.screen-reader-text{clip:rect(1px,1px,1px,1px);height:1px;overflow:hidden;position:absolute!important;width:1px}.dgwt-wcas-sf-wrapp:after,.dgwt-wcas-sf-wrapp:before{content:"";display:table}.dgwt-wcas-sf-wrapp:after{clear:both}.dgwt-wcas-sf-wrapp{zoom:1;width:100%;margin:0;position:relative;background:0 0}.dgwt-wcas-sf-wrapp input[type=search].dgwt-wcas-search-input{width:100%;height:40px;font-size:14px;line-height:100%;padding:10px 15px;background:#fff;border:1px solid #ddd;border-radius:3px;-webkit-border-radius:3px;-webkit-appearance:none}.dgwt-wcas-open .dgwt-wcas-sf-wrapp input[type=search].dgwt-wcas-search-input{border-radius:3px 3px 0 0}.dgwt-wcas-sf-wrapp input[type=search].dgwt-wcas-search-input:focus{outline:0;background:#fff;box-shadow:0 0 9px 1px rgba(0,0,0,.06)}.dgwt-wcas-sf-wrapp input[type=search].dgwt-wcas-search-input::-webkit-input-placeholder{color:#999;font-weight:400;font-style:italic}.dgwt-wcas-sf-wrapp input[type=search].dgwt-wcas-search-input:-moz-placeholder{color:#999;font-weight:400;font-style:italic}.dgwt-wcas-sf-wrapp input[type=search].dgwt-wcas-search-input::-moz-placeholder{color:#999;font-weight:400;font-style:italic}.dgwt-wcas-sf-wrapp input[type=search].dgwt-wcas-search-input:-ms-input-placeholder{color:#999;font-weight:400;font-style:italic}.dgwt-wcas-sf-wrapp button.dgwt-wcas-search-submit{overflow:visible;position:absolute;border:0;margin:0;cursor:pointer;height:40px;min-width:50px;right:0;top:0;padding:0 15px;color:#fff;-webkit-transition:all 250ms ease-in-out;-moz-transition:all 250ms ease-in-out;-ms-transition:all 250ms ease-in-out;-o-transition:all 250ms ease-in-out;transition:all 250ms ease-in-out;text-transform:uppercase;background-color:#96588A;border-radius:0 2px 2px 0;-webkit-border-radius:0 2px 2px 0;text-shadow:0 -1px 0 rgba(0,0 ,0,.3);-webkit-box-shadow:none;box-shadow:none;-webkit-appearance:none}.rtl .dgwt-wcas-sf-wrapp button.dgwt-wcas-search-submit{left:0;right:auto}.dgwt-wcas-open .dgwt-wcas-sf-wrapp .dgwt-wcas-search-submit{border-radius:0 2px 0 0}.dgwt-wcas-sf-wrapp .dgwt-wcas-search-submit:hover{opacity:.7}.dgwt-wcas-sf-wrapp .dgwt-wcas-search-submit:active,.dgwt-wcas-sf-wrapp .dgwt-wcas-search-submit:focus{opacity:.7;outline:0}.dgwt-wcas-sf-wrapp .dgwt-wcas-search-submit:before{content:'';position:absolute;border-width:8px 8px 8px 0;border-style:solid solid solid none;border-color:transparent #96588A;top:12px;left:-6px;-webkit-transition:all 250ms ease-in-out;-moz-transition:all 250ms ease-in-out;-ms-transition:all 250ms ease-in-out;-o-transition:all 250ms ease-in-out;transition:all 250ms ease-in-out}.rtl .dgwt-wcas-sf-wrapp .dgwt-wcas-search-submit:before{left:auto;right:-6px;border-width:8px 0 8px 8px;border-style:solid none solid solid}.dgwt-wcas-sf-wrapp .dgwt-wcas-search-submit:active:before,.dgwt-wcas-sf-wrapp .dgwt-wcas-search-submit:focus:before,.dgwt-wcas-sf-wrapp .dgwt-wcas-search-submit:hover:before{border-right-color:#96588A}.dgwt-wcas-sf-wrapp .dgwt-wcas-search-submit::-moz-focus-inner{border:0;padding:0}.dgwt-wcas-has-img .dgwt-wcas-suggestion.dgwt-wcas-suggestion-product{min-height:60px}.dgwt-wcas-details-inner .added_to_cart,.dgwt-wcas-has-desc .dgwt-wcas-sp>*,.dgwt-wcas-has-img .dgwt-wcas-sp>*{display:block}.dgwt-wcas-has-desc .dgwt-wcas-sp,.dgwt-wcas-has-img .dgwt-wcas-sp{top:12px}.dgwt-wcas-is-details .dgwt-wcas-content-wrapp{display:flex;flex-direction:column;height:100%;justify-content:center;resize:vertical;padding-left:20px}.dgwt-wcas-is-details .dgwt-wcas-suggestions-wrapp{min-height:340px;overflow:visible}body:not(.dgwt-wcas-is-details) .dgwt-wcas-suggestion:last-child{border-bottom:none}.dgwt-wcas-is-details .dgwt-wcas-has-img .dgwt-wcas-suggestion{min-height:40px}.dgwt-wcas-is-details .dgwt-wcas-has-img .dgwt-wcas-content-wrapp{padding-left:40px}.dgwt-wcas-is-details .dgwt-wcas-si{min-height:40px;width:30px}.dgwt-wcas-is-details .dgwt-wcas-sp{display:flex;top:0;flex-direction:column;height:100%;justify-content:center;resize:vertical}.dgwt-wcas-is-details .dgwt-wcas-sd{font-size:11px;line-height:100%}.dgwt-wcas-has-img .dgwt-wcas-suggestion[data-taxonomy=product_cat],.dgwt-wcas-has-img .dgwt-wcas-suggestion[data-taxonomy=product_tag]{padding-left:15px;min-height:0}.dgwt-wcas-has-img .dgwt-wcas-suggestion[data-taxonomy=product_cat] .dgwt-wcas-st,.dgwt-wcas-has-img .dgwt-wcas-suggestion[data-taxonomy=product_tag] .dgwt-wcas-st{padding-left:0}.dgwt-wcas-no-submit .dgwt-wcas-ico-magnifier{height:50%;max-height:20px;width:100%;max-width:20px;left:12px;right:auto;opacity:.5;fill:#000}.dgwt-wcas-no-submit .dgwt-wcas-sf-wrapp input[type=search].dgwt-wcas-search-input{padding:10px 15px 10px 40px}
1
+ .dgwt-wcas-block-scroll{overflow:hidden}.dgwt-wcas-search-wrapp{position:relative;display:block;color:#444;min-width:230px;width:100%;text-align:left;margin:0 auto}.dgwt-wcas-search-wrapp .product-title{color:#333;display:block;line-height:110%;margin:0}.dgwt-wcas-tpd-image img{margin:0 15px 0 0!important;display:block}.rtl .dgwt-wcas-tpd-image img{margin:0 0 0 15px!important}.dgwt-wcas-default-preloader *{box-sizing:border-box;-o-box-sizing:border-box;-ms-box-sizing:border-box;-webkit-box-sizing:border-box;-moz-box-sizing:border-box}.dgwt-wcas-default-preloader{width:1em;height:1em;font-size:169px;position:relative;display:block;margin:56px auto}.dgwt-wcas-default-preloader:after,.dgwt-wcas-default-preloader:before{content:"";top:0;display:block;width:1em;height:1em;position:absolute;border-width:.503em;border-style:double;border-color:transparent;border-radius:1em;box-sizing:border-box;-o-box-sizing:border-box;-ms-box-sizing:border-box;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;animation:dgwt-wcas-spin .8s infinite;-o-animation:dgwt-wcas-spin .8s infinite;-ms-animation:dgwt-wcas-spin .8s infinite;-webkit-animation:dgwt-wcas-spin .8s infinite;-moz-animation:dgwt-wcas-spin .8s infinite}.dgwt-wcas-pd-rating:after,.dgwt-wcas-suggestion:after,.dgwt-wcas-tax-product-details:after{content:'';clear:both}.dgwt-wcas-default-preloader:after{left:0;border-left-color:rgba(0,0,0,.05)}.dgwt-wcas-default-preloader:before{right:0;border-right-color:rgba(0,0,0,.02);animation-delay:-.2025s;-o-animation-delay:-.2025s;-ms-animation-delay:-.2025s;-webkit-animation-delay:-.2025s;-moz-animation-delay:-.2025s}@keyframes dgwt-wcas-spin{from{transform:rotate(360deg)}}@-o-keyframes dgwt-wcas-spin{from{-o-transform:rotate(360deg)}}@-ms-keyframes dgwt-wcas-spin{from{-ms-transform:rotate(360deg)}}@-webkit-keyframes dgwt-wcas-spin{from{-webkit-transform:rotate(360deg)}}@-moz-keyframes dgwt-wcas-spin{from{-moz-transform:rotate(360deg)}}.dgwt-wcas-preloader-wrapp img{margin:10px auto 0;display:block;max-width:200px}.dgwt-wcas-suggestions-wrapp{background:#fff;border:1px solid #ddd;border-top:none;padding:0;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;overflow-y:auto}.dgwt-wcas-suggestions-wrapp.dgwt-wcas-suggestions-wrapp--top{border:1px solid #ddd;border-bottom:none}.dgwt-wcas-is-detail-box .dgwt-wcas-suggestions-wrapp{max-width:550px}.dgwt-wcas-full-width.dgwt-wcas-is-detail-box .dgwt-wcas-suggestion{padding:8px 15px}.dgwt-wcas-details-left .dgwt-wcas-suggestions-wrapp{border-radius:0 0 5px;border-left-color:#eee}.dgwt-wcas-details-right .dgwt-wcas-suggestions-wrapp{border-radius:0 0 0 5px;border-right-color:#eee}.dgwt-wcas-suggestion{cursor:pointer;font-size:12px;line-height:110%;text-align:left;padding:7px 0;position:relative;border-bottom:1px solid #dfdfdf;display:flex;flex-direction:column;justify-content:center;resize:vertical}.dgwt-wcas-si,.dgwt-wcas-si img{position:absolute;display:block}.dgwt-wcas-suggestion.dgwt-wcas-suggestion-no-border-bottom{border-bottom:none}.dgwt-wcas-suggestion:after{display:block}.dgwt-wcas-suggestion.dgwt-wcas-nores{cursor:default;opacity:.5}.dgwt-wcas-has-img .dgwt-wcas-suggestion.dgwt-wcas-suggestion-product{padding:12px 0}.dgwt-wcas-st{padding-left:10px;display:block;color:#444;font-size:15px}.dgwt-wcas-st>span.dgwt-wcas-st--tax{display:block;font-style:italic;font-size:10px;text-transform:uppercase;opacity:.4;line-height:10px;margin-bottom:1px;letter-spacing:2px}.dgwt-wcas-has-price .dgwt-wcas-st{padding-right:80px}.rtl .dgwt-wcas-has-price .dgwt-wcas-st{padding-right:0;padding-left:80px}.dgwt-wcas-has-img .dgwt-wcas-content-wrapp{padding-left:60px}.rtl .dgwt-wcas-has-img .dgwt-wcas-content-wrapp{padding-right:70px;padding-left:0}.rtl.dgwt-wcas-is-details .dgwt-wcas-has-img .dgwt-wcas-content-wrapp{padding-right:50px;padding-left:0}.dgwt-wcas-sku{font-size:80%;margin-left:6px}.dgwt-wcas-st>span{display:inline-block;vertical-align:middle}.dgwt-wcas-si{left:10px;top:0;width:50px;height:100%;min-height:50px}.rtl .dgwt-wcas-si{left:auto;right:10px}.dgwt-wcas-si img{background:#fff;border:1px solid #e8e8e8;border-radius:3px;bottom:0;margin:auto;padding:2px;top:0;height:auto;width:auto;max-height:90%;max-width:100%}.dgwt-wcas-content-wrapp{padding-left:60px}.dgwt-wcas-sp{color:#555;font-size:14px;position:absolute;right:10px;top:5px;vertical-align:middle;line-height:120%;text-align:right}.rtl .dgwt-wcas-sp{right:auto;left:10px}.dgwt-wcas-search-form{margin:0;padding:0}.dgwt-wcas-sp del{opacity:.5;font-size:12px}.dgwt-wcas-sd{color:#777;display:block;padding-left:11px;line-height:14px;padding-right:60px;margin-top:5px}.rtl .dgwt-wcas-sd{padding-left:60px;padding-right:0}.dgwt-wcas-suggestion-selected{background-color:#eee}.dgwt-wcas-suggestion-selected:first-child{border-top:none}.rtl .dgwt-wcas-suggestion{padding-left:0;padding-right:15px;text-align:right}.dgwt-wcas-details-wrapp{background:#fff;border:1px solid #ddd;border-top:none;border-left:none;padding:0;width:300px;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;z-index:100;min-height:340px}.dgwt-wcas-pd-price,.dgwt-wcas-tpd-rest .product-title{text-overflow:ellipsis;white-space:nowrap;width:145px;line-height:13px;overflow:hidden}.rtl .dgwt-wcas-details-wrapp{border-left:1px solid #ddd;border-right:none}.dgwt-wcas-details-outside .dgwt-wcas-details-wrapp,.dgwt-wcas-details-outside.dgwt-wcas-is-details .dgwt-wcas-suggestions-wrapp{margin-top:-1px;border-top:1px solid #ddd}.dgwt-wcas-details-right .dgwt-wcas-details-wrapp{border-left:none;border-right:1px solid #ddd;border-radius:0 5px 5px 0}.dgwt-wcas-details-left .dgwt-wcas-details-wrapp{border-right:none;border-left:1px solid #ddd;border-radius:5px 0 0 5px}.dgwt-wcas-details-notfit .dgwt-wcas-details-wrapp{display:none}.dgwt-wcas-full-width .dgwt-wcas-suggestions-wrapp{border-radius:0 0 0 5px}.dgwt-wcas-full-width .dgwt-wcas-details-wrapp,.rtl.dgwt-wcas-full-width .dgwt-wcas-suggestions-wrapp{border-radius:0 0 5px}.rtl.dgwt-wcas-full-width .dgwt-wcas-details-wrapp{border-radius:0 0 0 5px}.dgwt-wcas-details-inner{padding:15px 10px;height:100%}.dgwt-wcas-datails-title,.dgwt-wcas-pd-title{border-bottom:1px dashed #eee;padding-bottom:5px}.woocommerce .dgwt-wcas-pd-rating .star-rating{float:left;margin-right:5px;font-size:12px;color:#CCAE72}.rtl .dgwt-wcas-pd-rating .star-rating{float:right;margin-left:5px;margin-right:0}.dgwt-wcas-datails-title{margin-bottom:15px;font-size:14px}.dgwt-wcas-pd-title{color:#202020}.dgwt-wcas-pd-title .product-title{color:#202020;margin:0}.dgwt-wcas-tax-product-details{margin-bottom:15px;text-decoration:none;display:flex;align-items:center;justify-content:left}.dgwt-wcas-tax-product-details:after{display:block}.dgwt-wcas-details-wrapp .dgwt-wcas-pd-title{margin-bottom:8px}.dgwt-wcas-pd-rest{justify-content:center}.dgwt-wcas-tpd-rest{max-width:200px}.dgwt-wcas-tpd-rest .product-title{display:block;font-size:13px;font-weight:500;letter-spacing:0;margin:0 0 8px;text-transform:uppercase}.dgwt-wcas-suggestion-nores{pointer-events:none;opacity:.45}.dgwt-wcas-pd-price{font-size:14px;color:#777;margin-top:5px;font-weight:lighter}.dgwt-wcas-pd-price del .amount{font-weight:lighter;background:0 0;font-size:90%;opacity:.6}.dgwt-wcas-details-title-tax,.dgwt-wcas-pd-title .product-title{font-weight:900;letter-spacing:-1px;text-transform:uppercase}.dgwt-wcas-pd-price ins{background:0 0;text-decoration:none}.dgwt-wcas-pd-rating{font-size:13px;line-height:13px}.dgwt-wcas-pd-rating:after{display:block}.dgwt-wcas-pd-review{color:#777;font-size:11px;line-height:11px}.dgwt-wcas-datails-title{display:block;margin:5px 0 15px}.dgwt-wcas-pd-title{margin-bottom:15px;display:block;text-decoration:none}.dgwt-wcas-details-title-tax{margin-right:3px}.rtl .dgwt-wcas-details-title-tax{margin:0 0 0 3px;float:right}.dgwt-wcas-pd-image,.dgwt-wcas-tpd-image{float:left;width:70px;margin-right:15px;padding:4px;background-color:#fff;border:1px solid #e8e8e8;border-radius:4px}.dgwt-wcas-pd-image img,.dgwt-wcas-tpd-image img{display:block;max-width:100%}.rtl .dgwt-wcas-pd-image,.rtl .dgwt-wcas-tpd-image{float:right;margin-right:0;margin-left:15px}.rtl .dgwt-wcas-pd-rest,.rtl .dgwt-wcas-tpd-rest{float:right;max-width:200px}input[type=search].dgwt-wcas-search-input,input[type=text].dgwt-cas-search-input{-webkit-transition:none;-moz-transition:none;-ms-transition:none;-o-transition:none;transition:none;-webkit-box-shadow:none;box-shadow:none;margin:0}.dgwt-wcas-search-input::-ms-clear{display:none}.dgwt-wcas-pd-desc{font-size:13px;line-height:130%;margin:12px 0}.dgwt-wcas-pd-addtc{margin:10px 0;display:flex;align-items:center;justify-content:flex-end}.dgwt-wcas-pd-addtc>.quantity{margin-right:10px}.dgwt-wcas-pd-addtc .add_to_cart_button,.dgwt-wcas-pd-addtc .add_to_cart_inline{margin:0}button.dgwt-wcas-search-submit,input[type=submit].dgwt-wcas-search-submit{position:relative}.dgwt-wcas-ico-magnifier{bottom:0;left:0;margin:auto;position:absolute;right:0;top:0;height:65%;display:block;fill:#fff}.dgwt-wcas-preloader{height:100%;position:absolute;right:0;top:0;width:40px;z-index:1;background-repeat:no-repeat;background-position:right 15px center;background-size:auto 44%}.rtl .dgwt-wcas-preloader{right:auto;left:35px}.dgwt-wcas-inner-preloader{background-image:url(../img/preloader.png);background-repeat:no-repeat;background-position:right 13px center;background-size:auto 22px}@media all and (-ms-high-contrast:none),(-ms-high-contrast:active){.dgwt-wcas-inner-preloader{background-image:url(../img/preloader.gif)}}.dgwt-wcas-close:not(.dgwt-wcas-inner-preloader){cursor:pointer;background-image:url(../img/close.png);background-repeat:no-repeat;background-position:right 15px center;background-size:auto 18px;opacity:.6;-webkit-transition:all 160ms ease-in-out;-moz-transition:all 160ms ease-in-out;-ms-transition:all 160ms ease-in-out;-o-transition:all 160ms ease-in-out;transition:all 160ms ease-in-out}.dgwt-wcas-close:hover{opacity:.3}@media screen and (max-width:992px){.dgwt-wcas-is-detail-box .dgwt-wcas-suggestions-wrapp{max-width:none}}.dgwt-wcas-suggestion strong{font-weight:700}.screen-reader-text{clip:rect(1px,1px,1px,1px);height:1px;overflow:hidden;position:absolute!important;width:1px}.dgwt-wcas-sf-wrapp:after,.dgwt-wcas-sf-wrapp:before{content:"";display:table}.dgwt-wcas-sf-wrapp:after{clear:both}.dgwt-wcas-sf-wrapp{zoom:1;width:100%;margin:0;position:relative;background:0 0}.dgwt-wcas-sf-wrapp input[type=search].dgwt-wcas-search-input{width:100%;height:40px;font-size:14px;line-height:100%;padding:10px 15px;background:#fff;border:1px solid #ddd;border-radius:3px;-webkit-border-radius:3px;-webkit-appearance:none}.dgwt-wcas-open .dgwt-wcas-sf-wrapp input[type=search].dgwt-wcas-search-input{border-radius:3px 3px 0 0}.dgwt-wcas-sf-wrapp input[type=search].dgwt-wcas-search-input:focus{outline:0;background:#fff;box-shadow:0 0 9px 1px rgba(0,0,0,.06)}.dgwt-wcas-sf-wrapp input[type=search].dgwt-wcas-search-input::-webkit-input-placeholder{color:#999;font-weight:400;font-style:italic}.dgwt-wcas-sf-wrapp input[type=search].dgwt-wcas-search-input:-moz-placeholder{color:#999;font-weight:400;font-style:italic}.dgwt-wcas-sf-wrapp input[type=search].dgwt-wcas-search-input::-moz-placeholder{color:#999;font-weight:400;font-style:italic}.dgwt-wcas-sf-wrapp input[type=search].dgwt-wcas-search-input:-ms-input-placeholder{color:#999;font-weight:400;font-style:italic}.dgwt-wcas-sf-wrapp button.dgwt-wcas-search-submit{overflow:visible;position:absolute;border:0;margin:0;cursor:pointer;height:40px;min-width:50px;right:0;top:0;padding:0 15px;color:#fff;-webkit-transition:all 250ms ease-in-out;-moz-transition:all 250ms ease-in-out;-ms-transition:all 250ms ease-in-out;-o-transition:all 250ms ease-in-out;transition:all 250ms ease-in-out;text-transform:uppercase;background-color:#96588A;border-radius:0 2px 2px 0;-webkit-border-radius:0 2px 2px 0;text-shadow:0 -1px 0 rgba(0,0,0,.3);-webkit-box-shadow:none;box-shadow:none;-webkit-appearance:none}.rtl .dgwt-wcas-sf-wrapp button.dgwt-wcas-search-submit{left:0;right:auto}.dgwt-wcas-open .dgwt-wcas-sf-wrapp .dgwt-wcas-search-submit{border-radius:0 2px 0 0}.dgwt-wcas-sf-wrapp .dgwt-wcas-search-submit:hover{opacity:.7}.dgwt-wcas-sf-wrapp .dgwt-wcas-search-submit:active,.dgwt-wcas-sf-wrapp .dgwt-wcas-search-submit:focus{opacity:.7;outline:0}.dgwt-wcas-sf-wrapp .dgwt-wcas-search-submit:before{content:'';position:absolute;border-width:8px 8px 8px 0;border-style:solid solid solid none;border-color:transparent #96588A;top:12px;left:-6px;-webkit-transition:all 250ms ease-in-out;-moz-transition:all 250ms ease-in-out;-ms-transition:all 250ms ease-in-out;-o-transition:all 250ms ease-in-out;transition:all 250ms ease-in-out}.rtl .dgwt-wcas-sf-wrapp .dgwt-wcas-search-submit:before{left:auto;right:-6px;border-width:8px 0 8px 8px;border-style:solid none solid solid}.dgwt-wcas-sf-wrapp .dgwt-wcas-search-submit:active:before,.dgwt-wcas-sf-wrapp .dgwt-wcas-search-submit:focus:before,.dgwt-wcas-sf-wrapp .dgwt-wcas-search-submit:hover:before{border-right-color:#96588A}.dgwt-wcas-sf-wrapp .dgwt-wcas-search-submit::-moz-focus-inner{border:0;padding:0}.dgwt-wcas-has-img .dgwt-wcas-suggestion.dgwt-wcas-suggestion-product{min-height:60px}.dgwt-wcas-details-inner .added_to_cart,.dgwt-wcas-has-desc .dgwt-wcas-sp>*,.dgwt-wcas-has-img .dgwt-wcas-sp>*{display:block}.dgwt-wcas-has-desc .dgwt-wcas-sp,.dgwt-wcas-has-img .dgwt-wcas-sp{top:12px}.dgwt-wcas-is-details .dgwt-wcas-content-wrapp{display:flex;flex-direction:column;height:100%;justify-content:center;resize:vertical;padding-left:20px}.dgwt-wcas-is-details .dgwt-wcas-suggestions-wrapp{min-height:340px;overflow:visible}body:not(.dgwt-wcas-is-details) .dgwt-wcas-suggestion:last-child{border-bottom:none}.dgwt-wcas-is-details .dgwt-wcas-has-img .dgwt-wcas-suggestion{min-height:40px}.dgwt-wcas-is-details .dgwt-wcas-has-img .dgwt-wcas-content-wrapp{padding-left:40px}.dgwt-wcas-is-details .dgwt-wcas-si{min-height:40px;width:30px;max-width:100%;box-sizing:border-box}.dgwt-wcas-is-details .dgwt-wcas-sp{display:flex;top:0;flex-direction:column;height:100%;justify-content:center;resize:vertical}.dgwt-wcas-is-details .dgwt-wcas-sd{font-size:11px;line-height:100%}.dgwt-wcas-has-img .dgwt-wcas-suggestion[data-taxonomy=product_cat],.dgwt-wcas-has-img .dgwt-wcas-suggestion[data-taxonomy=product_tag]{padding-left:15px;min-height:0}.dgwt-wcas-has-img .dgwt-wcas-suggestion[data-taxonomy=product_cat] .dgwt-wcas-st,.dgwt-wcas-has-img .dgwt-wcas-suggestion[data-taxonomy=product_tag] .dgwt-wcas-st{padding-left:0}.dgwt-wcas-no-submit .dgwt-wcas-ico-magnifier{height:50%;max-height:20px;width:100%;max-width:20px;left:12px;right:auto;opacity:.5;fill:#000}.dgwt-wcas-no-submit .dgwt-wcas-sf-wrapp input[type=search].dgwt-wcas-search-input{padding:10px 15px 10px 40px}body .dgwt-wcas-content-wrapp .rood,body .dgwt-wcas-content-wrapp .zwave{display:none}
assets/js/search.js CHANGED
@@ -133,7 +133,8 @@
133
  that.options = $.extend({}, defaults, options);
134
  that.classes = {
135
  selected: 'dgwt-wcas-suggestion-selected',
136
- suggestion: 'dgwt-wcas-suggestion'
 
137
  };
138
  that.hint = null;
139
  that.hintValue = '';
@@ -200,6 +201,7 @@
200
 
201
  container = $(that.suggestionsContainer);
202
  container.attr('data-wcas-context', context);
 
203
 
204
  container.appendTo('body');
205
 
@@ -227,6 +229,7 @@
227
 
228
  containerDetails = $(that.detailsContainer);
229
  containerDetails.attr('data-wcas-context', context);
 
230
 
231
  containerDetails.appendTo('body');
232
  }
@@ -311,6 +314,7 @@
311
  },
312
  setOptions: function (suppliedOptions) {
313
  var that = this,
 
314
  options = that.options;
315
 
316
  $.extend(options, suppliedOptions);
@@ -325,7 +329,7 @@
325
 
326
  // Adjust height, width and z-index:
327
  //@TODO nie działa obliczanie prawej krawędzi ekranu
328
- $(that.suggestionsContainer).css({
329
  'max-height': !that.canShowDetailsBox() ? options.maxHeight + 'px' : 'none',
330
  'width': options.width + 'px',
331
  'z-index': options.zIndex
@@ -333,11 +337,12 @@
333
 
334
  // Add classes
335
  if (options.showDetailsPanel === true) {
 
336
 
337
- $(that.detailsContainer).css({
338
  'z-index': (options.zIndex - 1)
339
  });
340
- $(that.suggestionsContainer).parent().addClass('dgwt-wcas-is-details');
341
  }
342
 
343
  that.options.onSearchComplete = function () {
@@ -345,18 +350,6 @@
345
  that.preloader('show', 'form', options.closeTrigger);
346
  };
347
 
348
- that.autoBlurOnMobile();
349
-
350
- },
351
- autoBlurOnMobile: function () {
352
- var that = this;
353
-
354
- if (( 'ontouchend' in document )) {
355
- document.addEventListener('scroll', function (e) {
356
- that.el.blur();
357
- }, true);
358
- }
359
-
360
  },
361
  clearCache: function () {
362
  this.cachedResponse = {};
@@ -381,10 +374,10 @@
381
  },
382
  fixPosition: function () {
383
  var that = this,
384
- $container = $(that.suggestionsContainer),
385
  offset = that.getFormOffset();
386
 
387
- $container.css(offset);
388
 
389
  if (that.canShowDetailsBox()) {
390
  that.fixPositionDetailsBox();
@@ -512,11 +505,12 @@
512
  },
513
  getFormOffset: function () {
514
  var that = this,
515
- $container = that.el.closest('.' + that.options.searchFormClass);
 
516
 
517
  // Choose orientation
518
  var orientation = that.options.orientation,
519
- containerHeight = $container.outerHeight(),
520
  height = that.el.outerHeight(),
521
  offset = that.el.offset(),
522
  styles = {'top': offset.top, 'left': offset.left};
@@ -531,13 +525,14 @@
531
  }
532
 
533
  if (orientation === 'top') {
 
 
534
 
535
- if (that.options.positionFixed === true) {
536
- var viewportOffse = that.el[0].getBoundingClientRect();
537
- styles.top = viewportOffse.top - $(that.suggestionsContainer).outerHeight();
538
- } else {
539
- styles.top += -$(that.suggestionsContainer).outerHeight();
540
  }
 
541
  } else {
542
  styles.top += height;
543
  }
@@ -559,6 +554,19 @@
559
 
560
  return that.el.closest('[data-wcas-context]');
561
  },
 
 
 
 
 
 
 
 
 
 
 
 
 
562
  enableKillerFn: function () {
563
  var that = this;
564
  $(document).on('click.autocomplete', that.killerFn);
@@ -568,8 +576,8 @@
568
  $(document).off('click.autocomplete', that.killerFn);
569
  },
570
  killSuggestions: function () {
571
- var that = this,
572
- containerParent = $(that.suggestionsContainer).parent();
573
  that.stopKillSuggestions();
574
  that.intervalId = window.setInterval(function () {
575
  if (that.visible) {
@@ -939,9 +947,8 @@
939
  },
940
  hide: function () {
941
  var that = this,
942
- container = $(that.suggestionsContainer),
943
- containerDetails = $(that.detailsContainer),
944
- containerParent = $(that.suggestionsContainer).parent();
945
 
946
  if ($.isFunction(that.options.onHide) && that.visible) {
947
  that.options.onHide.call(that.element, container);
@@ -950,9 +957,12 @@
950
  that.visible = false;
951
  that.selectedIndex = -1;
952
  clearInterval(that.onChangeInterval);
953
- $(that.suggestionsContainer).hide();
954
- $(that.detailsContainer).hide();
955
- containerParent.removeClass('dgwt-wcas-open');
 
 
 
956
 
957
  that.signalHint(null);
958
  },
@@ -973,8 +983,8 @@
973
  value = that.getQuery(that.currentValue),
974
  className = that.classes.suggestion,
975
  classSelected = that.classes.selected,
976
- container = $(that.suggestionsContainer),
977
- containerDetails = $(that.detailsContainer),
978
  noSuggestionsContainer = $(that.noSuggestionsContainer),
979
  beforeRender = options.beforeRender,
980
  html = '',
@@ -1101,12 +1111,7 @@
1101
  container.show();
1102
 
1103
  // Add class on show
1104
- container.parent().addClass('dgwt-wcas-open');
1105
-
1106
- if (options.positionFixed === true) {
1107
- $(that.suggestionsContainer).addClass('dgwt-wcas-suggestions-fixed');
1108
- }
1109
-
1110
 
1111
  if (options.showDetailsPanel === true) {
1112
  containerDetails.show();
@@ -1121,11 +1126,20 @@
1121
  }
1122
 
1123
  that.visible = true;
 
 
 
 
 
 
 
 
 
1124
  that.findBestHint();
1125
  },
1126
  noSuggestions: function () {
1127
  var that = this,
1128
- container = $(that.suggestionsContainer),
1129
  noSuggestionsContainer = $(that.noSuggestionsContainer);
1130
 
1131
  // Some explicit steps. Be careful here as it easy to get
@@ -1144,9 +1158,9 @@
1144
  options = that.options,
1145
  width,
1146
  container = $('body'),
1147
- searchForm = $('.' + options.searchFormClass + '[data-wcas-context="' + that.getContext() + '"]'),
1148
- containerSugg = $(that.suggestionsContainer),
1149
- containerDetails = $(that.detailsContainer),
1150
  maxWidth = 550,
1151
  offset = that.getFormOffset(),
1152
  realWidth = getComputedStyle(searchForm[0]).width;
@@ -1314,6 +1328,10 @@
1314
  return;
1315
  }
1316
 
 
 
 
 
1317
  that.suggestions = result.suggestions;
1318
  that.suggest();
1319
  },
@@ -1321,7 +1339,7 @@
1321
  var that = this,
1322
  activeItem,
1323
  selected = that.classes.selected,
1324
- container = $(that.suggestionsContainer),
1325
  children = container.find('.' + that.classes.suggestion);
1326
 
1327
  container.find('.' + selected).removeClass(selected);
@@ -1356,7 +1374,7 @@
1356
  }
1357
 
1358
  if (that.selectedIndex === 0) {
1359
- $(that.suggestionsContainer).children().first().removeClass(that.classes.selected);
1360
  that.selectedIndex = -1;
1361
  that.el.val(that.currentValue);
1362
  that.findBestHint();
@@ -1385,16 +1403,17 @@
1385
  var offsetTop,
1386
  upperBound,
1387
  lowerBound,
 
1388
  heightDelta = $(activeItem).outerHeight();
1389
 
1390
  offsetTop = activeItem.offsetTop;
1391
- upperBound = $(that.suggestionsContainer).scrollTop();
1392
  lowerBound = upperBound + that.options.maxHeight - heightDelta;
1393
 
1394
  if (offsetTop < upperBound) {
1395
- $(that.suggestionsContainer).scrollTop(offsetTop);
1396
  } else if (offsetTop > lowerBound) {
1397
- $(that.suggestionsContainer).scrollTop(offsetTop - that.options.maxHeight + heightDelta);
1398
  }
1399
 
1400
  if (!that.options.preserveInput) {
@@ -1470,7 +1489,8 @@
1470
  that.el.off('.autocomplete').removeData('autocomplete');
1471
  that.disableKillerFn();
1472
  $(window).off('resize.autocomplete', that.fixPositionCapture);
1473
- $(that.suggestionsContainer).remove();
 
1474
  }
1475
  };
1476
 
@@ -1528,18 +1548,6 @@
1528
  $(document).ready(function () {
1529
  "use strict";
1530
 
1531
- function getMaxHeight() {
1532
- var maxHeight = 300,
1533
- limit = ($(window).height() * 0.8);
1534
-
1535
- if (maxHeight > limit) {
1536
- maxHeight = limit;
1537
- }
1538
-
1539
-
1540
- return maxHeight;
1541
- }
1542
-
1543
  /*-----------------------------------------------------------------
1544
  /* Fire autocomplete
1545
  /*------------ -----------------------------------------------------*/
@@ -1566,8 +1574,7 @@
1566
  showFeaturedBadge: dgwt_wcas.show_featured_badge == 1 ? true : false,
1567
  saleBadgeText: dgwt_wcas.t.sale_badge,
1568
  featuredBadgeText: dgwt_wcas.t.featured_badge,
1569
- is_rtl: dgwt_wcas.is_rtl == 1 ? true : false,
1570
- maxHeight: getMaxHeight()
1571
  });
1572
 
1573
  });
133
  that.options = $.extend({}, defaults, options);
134
  that.classes = {
135
  selected: 'dgwt-wcas-suggestion-selected',
136
+ suggestion: 'dgwt-wcas-suggestion',
137
+ suggestionsContainerOrientTop: 'dgwt-wcas-suggestions-wrapp--top'
138
  };
139
  that.hint = null;
140
  that.hintValue = '';
201
 
202
  container = $(that.suggestionsContainer);
203
  container.attr('data-wcas-context', context);
204
+ container.addClass('woocommerce');
205
 
206
  container.appendTo('body');
207
 
229
 
230
  containerDetails = $(that.detailsContainer);
231
  containerDetails.attr('data-wcas-context', context);
232
+ containerDetails.addClass('woocommerce');
233
 
234
  containerDetails.appendTo('body');
235
  }
314
  },
315
  setOptions: function (suppliedOptions) {
316
  var that = this,
317
+ $suggestionsContainer = that.getSuggestionsContainer(),
318
  options = that.options;
319
 
320
  $.extend(options, suppliedOptions);
329
 
330
  // Adjust height, width and z-index:
331
  //@TODO nie działa obliczanie prawej krawędzi ekranu
332
+ $suggestionsContainer.css({
333
  'max-height': !that.canShowDetailsBox() ? options.maxHeight + 'px' : 'none',
334
  'width': options.width + 'px',
335
  'z-index': options.zIndex
337
 
338
  // Add classes
339
  if (options.showDetailsPanel === true) {
340
+ var $detailsContainer = that.getDetailsContainer();
341
 
342
+ $detailsContainer.css({
343
  'z-index': (options.zIndex - 1)
344
  });
345
+ $('body').addClass('dgwt-wcas-is-details');
346
  }
347
 
348
  that.options.onSearchComplete = function () {
350
  that.preloader('show', 'form', options.closeTrigger);
351
  };
352
 
 
 
 
 
 
 
 
 
 
 
 
 
353
  },
354
  clearCache: function () {
355
  this.cachedResponse = {};
374
  },
375
  fixPosition: function () {
376
  var that = this,
377
+ $containerSuggestions = $('.' + that.options.containerClass + '[data-wcas-context="' + that.getContext() + '"]'),
378
  offset = that.getFormOffset();
379
 
380
+ $containerSuggestions.css(offset);
381
 
382
  if (that.canShowDetailsBox()) {
383
  that.fixPositionDetailsBox();
505
  },
506
  getFormOffset: function () {
507
  var that = this,
508
+ $form = that.getFormWrapper(),
509
+ $suggestionsContainer = that.getSuggestionsContainer();
510
 
511
  // Choose orientation
512
  var orientation = that.options.orientation,
513
+ containerHeight = $form.outerHeight(),
514
  height = that.el.outerHeight(),
515
  offset = that.el.offset(),
516
  styles = {'top': offset.top, 'left': offset.left};
525
  }
526
 
527
  if (orientation === 'top') {
528
+ var sh = $suggestionsContainer[0].getBoundingClientRect().top,
529
+ ft = $form[0].getBoundingClientRect().top;
530
 
531
+ $suggestionsContainer.css('height', 'auto');
532
+ if(ft < $suggestionsContainer.height()){
533
+ $suggestionsContainer.height(ft - 10);
 
 
534
  }
535
+ styles.top += -$suggestionsContainer.outerHeight();
536
  } else {
537
  styles.top += height;
538
  }
554
 
555
  return that.el.closest('[data-wcas-context]');
556
  },
557
+ getSuggestionsContainer: function () {
558
+ var that = this;
559
+ return $('.' + that.options.containerClass + '[data-wcas-context="' + that.getContext() + '"]');
560
+ },
561
+ getDetailsContainer: function () {
562
+ var that = this;
563
+ return $('.' + that.options.containerDetailsClass + '[data-wcas-context="' + that.getContext() + '"]');
564
+ },
565
+ scrollDownSuggestions: function () {
566
+ var that = this,
567
+ $el = that.getSuggestionsContainer();
568
+ $el[0].scrollTop = $el[0].scrollHeight;
569
+ },
570
  enableKillerFn: function () {
571
  var that = this;
572
  $(document).on('click.autocomplete', that.killerFn);
576
  $(document).off('click.autocomplete', that.killerFn);
577
  },
578
  killSuggestions: function () {
579
+ var that = this;
580
+
581
  that.stopKillSuggestions();
582
  that.intervalId = window.setInterval(function () {
583
  if (that.visible) {
947
  },
948
  hide: function () {
949
  var that = this,
950
+ $container = that.getSuggestionsContainer(),
951
+ $containerDetails = that.getDetailsContainer();
 
952
 
953
  if ($.isFunction(that.options.onHide) && that.visible) {
954
  that.options.onHide.call(that.element, container);
957
  that.visible = false;
958
  that.selectedIndex = -1;
959
  clearInterval(that.onChangeInterval);
960
+ $container.hide();
961
+ $container.removeClass(that.classes.suggestionsContainerOrientTop);
962
+ $containerDetails.hide();
963
+
964
+ $('body').removeClass('dgwt-wcas-open');
965
+ $('body').removeClass('dgwt-wcas-block-scroll');
966
 
967
  that.signalHint(null);
968
  },
983
  value = that.getQuery(that.currentValue),
984
  className = that.classes.suggestion,
985
  classSelected = that.classes.selected,
986
+ container = that.getSuggestionsContainer(),
987
+ containerDetails = that.getDetailsContainer(),
988
  noSuggestionsContainer = $(that.noSuggestionsContainer),
989
  beforeRender = options.beforeRender,
990
  html = '',
1111
  container.show();
1112
 
1113
  // Add class on show
1114
+ $('body').addClass('dgwt-wcas-open');
 
 
 
 
 
1115
 
1116
  if (options.showDetailsPanel === true) {
1117
  containerDetails.show();
1126
  }
1127
 
1128
  that.visible = true;
1129
+
1130
+ if(that.options.orientation === 'top') {
1131
+ that.getSuggestionsContainer().addClass(that.classes.suggestionsContainerOrientTop);
1132
+ $('body').addClass('dgwt-wcas-block-scroll');
1133
+ setTimeout(function () {
1134
+ that.scrollDownSuggestions();
1135
+ }, 300);
1136
+ }
1137
+
1138
  that.findBestHint();
1139
  },
1140
  noSuggestions: function () {
1141
  var that = this,
1142
+ container = that.getSuggestionsContainer(),
1143
  noSuggestionsContainer = $(that.noSuggestionsContainer);
1144
 
1145
  // Some explicit steps. Be careful here as it easy to get
1158
  options = that.options,
1159
  width,
1160
  container = $('body'),
1161
+ searchForm = that.getFormWrapper(),
1162
+ containerSugg = that.getSuggestionsContainer(),
1163
+ containerDetails = that.getDetailsContainer(),
1164
  maxWidth = 550,
1165
  offset = that.getFormOffset(),
1166
  realWidth = getComputedStyle(searchForm[0]).width;
1328
  return;
1329
  }
1330
 
1331
+ if(that.options.orientation === 'top'){
1332
+ result.suggestions.reverse();
1333
+ }
1334
+
1335
  that.suggestions = result.suggestions;
1336
  that.suggest();
1337
  },
1339
  var that = this,
1340
  activeItem,
1341
  selected = that.classes.selected,
1342
+ container = that.getSuggestionsContainer(),
1343
  children = container.find('.' + that.classes.suggestion);
1344
 
1345
  container.find('.' + selected).removeClass(selected);
1374
  }
1375
 
1376
  if (that.selectedIndex === 0) {
1377
+ that.getSuggestionsContainer().children().first().removeClass(that.classes.selected);
1378
  that.selectedIndex = -1;
1379
  that.el.val(that.currentValue);
1380
  that.findBestHint();
1403
  var offsetTop,
1404
  upperBound,
1405
  lowerBound,
1406
+ $suggestionContainer = that.getSuggestionsContainer(),
1407
  heightDelta = $(activeItem).outerHeight();
1408
 
1409
  offsetTop = activeItem.offsetTop;
1410
+ upperBound = $suggestionContainer.scrollTop();
1411
  lowerBound = upperBound + that.options.maxHeight - heightDelta;
1412
 
1413
  if (offsetTop < upperBound) {
1414
+ $suggestionContainer.scrollTop(offsetTop);
1415
  } else if (offsetTop > lowerBound) {
1416
+ $suggestionContainer.scrollTop(offsetTop - that.options.maxHeight + heightDelta);
1417
  }
1418
 
1419
  if (!that.options.preserveInput) {
1489
  that.el.off('.autocomplete').removeData('autocomplete');
1490
  that.disableKillerFn();
1491
  $(window).off('resize.autocomplete', that.fixPositionCapture);
1492
+ $('.' + that.options.containerClass).remove();
1493
+ $('.' + that.options.containerDetailsClass).remove();
1494
  }
1495
  };
1496
 
1548
  $(document).ready(function () {
1549
  "use strict";
1550
 
 
 
 
 
 
 
 
 
 
 
 
 
1551
  /*-----------------------------------------------------------------
1552
  /* Fire autocomplete
1553
  /*------------ -----------------------------------------------------*/
1574
  showFeaturedBadge: dgwt_wcas.show_featured_badge == 1 ? true : false,
1575
  saleBadgeText: dgwt_wcas.t.sale_badge,
1576
  featuredBadgeText: dgwt_wcas.t.featured_badge,
1577
+ is_rtl: dgwt_wcas.is_rtl == 1 ? true : false
 
1578
  });
1579
 
1580
  });
assets/js/search.min.js CHANGED
@@ -1 +1 @@
1
- !function(e){"use strict";"function"==typeof define&&define.amd?define(["jquery"],e):"object"==typeof exports&&"function"==typeof require?e(require("jquery")):e(jQuery)}(function(e){"use strict";var t={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}},s=27,n=9,o=13,i=38,a=39,l=40;function r(t,s){var n=e.noop,o=this,i={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:3,maxHeight:600,deferRequestBy:0,params:{},formatResult:r.formatResult,delimiter:null,zIndex:9999,type:"GET",noCache:!1,is_rtl:!1,onSearchStart:n,onSearchComplete:n,onSearchError:n,preserveInput:!1,searchFormClass:"dgwt-wcas-search-wrapp",containerClass:"dgwt-wcas-suggestions-wrapp",containerDetailsClass:"dgwt-wcas-details-wrapp",searchInputClass:"dgwt-wcas-search-input",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,positionFixed:!1};o.element=t,o.el=e(t),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({},i,s),o.classes={selected:"dgwt-wcas-suggestion-selected",suggestion:"dgwt-wcas-suggestion"},o.hint=null,o.hintValue="",o.selection=null,o.initialize(),o.setOptions(s)}r.utils=t,e.Autocomplete=r,r.formatResult=function(e,s){if(!s)return e;var n="("+t.escapeRegExChars(s)+")";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>")},r.prototype={killerFn:null,initialize:function(){var t,s,n=this,o="."+n.classes.suggestion,i=(n.classes.selected,n.options),a="."+i.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())};var l=n.el.closest("."+i.searchFormClass).data("wcas-context");n.noSuggestionsContainer=e('<div class="dgwt-wcas-no-suggestion"></div>').html(this.options.noSuggestionNotice).get(0),n.suggestionsContainer=r.utils.createNode(i.containerClass),(t=e(n.suggestionsContainer)).attr("data-wcas-context",l),t.appendTo("body"),!0===i.showImage&&t.addClass("dgwt-wcas-has-img"),!0===i.showPrice&&t.addClass("dgwt-wcas-has-price"),!0===i.showDescription&&t.addClass("dgwt-wcas-has-desc"),!0===i.showSKU&&t.addClass("dgwt-wcas-has-sku"),"auto"!==i.width&&t.width(i.width),!0===i.showDetailsPanel&&(n.detailsContainer=r.utils.createNode(i.containerDetailsClass),(s=e(n.detailsContainer)).attr("data-wcas-context",l),s.appendTo("body")),t.on("mouseover.autocomplete",o,function(){n.onMouseOver(e(this).data("index")),n.activate(e(this).data("index"))}),t.on("mouseout.autocomplete",function(){}),e(document).on("click.autocomplete",a,function(t){n.killerFn(t),n.clear(!1),e(this).removeClass(i.closeTrigger),e(this).closest("."+i.searchFormClass).find("."+i.searchInputClass).val("").focus()}),t.on("click.autocomplete",o,function(){return n.select(e(this).data("index")),!1}),e(document).on("change",'[name="js-dgwt-wcas-quantity"]',function(t){e(this).closest(".js-dgwt-wcas-pd-addtc").find("[data-quantity]").attr("data-quantity",e(this).val())}),n.fixPositionCapture=function(){n.adjustContainerWidth(),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.fixPositionCapture(),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":s.canShowDetailsBox()?"none":n.maxHeight+"px",width:n.width+"px","z-index":n.zIndex}),!0===n.showDetailsPanel&&(e(s.detailsContainer).css({"z-index":n.zIndex-1}),e(s.suggestionsContainer).parent().addClass("dgwt-wcas-is-details")),s.options.onSearchComplete=function(){s.preloader("hide","form","dgwt-wcas-inner-preloader"),s.preloader("show","form",n.closeTrigger)},s.autoBlurOnMobile()},autoBlurOnMobile:function(){var e=this;"ontouchend"in document&&document.addEventListener("scroll",function(t){e.el.blur()},!0)},clearCache:function(){this.cachedResponse={},this.cachedDetails={},this.badQueries=[]},clear:function(e){e&&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=e(t.suggestionsContainer),n=t.getFormOffset();s.css(n),t.canShowDetailsBox()&&t.fixPositionDetailsBox()},fixPositionDetailsBox:function(){var t=this,s=t.el.closest("[data-wcas-context]"),n=e("."+t.options.containerDetailsClass+'[data-wcas-context="'+t.getContext()+'"]'),o=e("."+t.options.containerClass+'[data-wcas-context="'+t.getContext()+'"]'),i=t.getFormOffset(),a=i.left;if(0==n.length)return!1;var l=!0===t.options.is_rtl?1:2,r=Math.round(i.left);if(i.left=r+Math.round(o.width()+l),n.css(i),s.width()>=550)return e("body").removeClass("dgwt-wcas-details-outside"),e("body").removeClass("dgwt-wcas-details-right"),e("body").removeClass("dgwt-wcas-details-left"),void(!0===t.options.is_rtl&&(o.css("left",r+Math.round(n.width()+l)+"px"),n.css("left",a+"px")));var c=e(window).width(),d=n.width(),u=n.offset();e("body").addClass("dgwt-wcas-details-outside"),!0===t.options.is_rtl&&(i.left=i.left+1);var g=!1,h=!1;c<u.left+d&&(g=!0,e("body").removeClass("dgwt-wcas-details-right"),e("body").addClass("dgwt-wcas-details-left"),n.css("left",Math.round(parseFloat(o.css("left").replace("px","")))-n.outerWidth()+"px")),(u=n.offset()).left<1&&(h=!0,e("body").removeClass("dgwt-wcas-details-left"),e("body").addClass("dgwt-wcas-details-right")),h&&g?(e("body").removeClass("dgwt-wcas-details-left"),e("body").removeClass("dgwt-wcas-details-right"),e("body").addClass("dgwt-wcas-details-notfit")):e("body").removeClass("dgwt-wcas-details-notfit")},fixHeight:function(){var t=this.options;if(1!=t.showDetailsPanel)return!1;e("."+t.containerClass).css("height","auto"),e("."+t.containerDetailsClass).css("height","auto");var s=e("."+t.containerClass),n=e("."+t.containerDetailsClass),o=s.outerHeight(),i=n.outerHeight();return s.find(".dgwt-wcas-suggestion:last-child").removeClass("dgwt-wcas-suggestion-no-border-bottom"),!(o<=340&&i<=340)&&(s.find(".dgwt-wcas-suggestion:last-child").addClass("dgwt-wcas-suggestion-no-border-bottom"),i<o&&n.css("height",o+"px"),o<i&&s.css("height",i+"px"),!1)},getFormOffset:function(){var t=this,s=t.el.closest("."+t.options.searchFormClass),n=t.options.orientation,o=s.outerHeight(),i=t.el.outerHeight(),a=t.el.offset(),l={top:a.top,left:a.left};if("auto"===n){var r=e(window).height(),c=e(window).scrollTop(),d=-c+a.top-o,u=c+r-(a.top+i+o);n=Math.max(d,u)===d?"top":"bottom"}if("top"===n)if(!0===t.options.positionFixed){var g=t.el[0].getBoundingClientRect();l.top=g.top-e(t.suggestionsContainer).outerHeight()}else l.top+=-e(t.suggestionsContainer).outerHeight();else l.top+=i;return l},getContext:function(){var e=this.el.closest("[data-wcas-context]"),t="";return e.length>0&&(t=e.data("wcas-context")),t},getFormWrapper:function(){return this.el.closest("[data-wcas-context]")},enableKillerFn:function(){e(document).on("click.autocomplete",this.killerFn)},disableKillerFn:function(){e(document).off("click.autocomplete",this.killerFn)},killSuggestions:function(){var t=this;e(t.suggestionsContainer).parent();t.stopKillSuggestions(),t.intervalId=window.setInterval(function(){t.visible&&(t.options.preserveInput||t.el.val(t.currentValue),t.hide()),t.stopKillSuggestions()},50)},stopKillSuggestions:function(){window.clearInterval(this.intervalId)},isCursorAtEnd:function(){var e,t=this.el.val().length,s=this.element.selectionStart;return"number"==typeof s?s===t:!document.selection||((e=document.selection.createRange()).moveStart("character",-t),t===e.text.length)},onKeyPress:function(e){var t=this;if(t.disabled||t.visible||e.which!==l||!t.currentValue){if(!t.disabled&&t.visible){switch(e.which){case s:t.el.val(t.currentValue),t.hide();break;case a:if(t.hint&&t.options.onHint&&t.isCursorAtEnd()){t.selectHint();break}return;case n: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 o:if(-1===t.selectedIndex)return void t.hide();t.select(t.selectedIndex);break;case i:t.moveUp();break;case l: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 i:case l: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(),o=t.getQuery(n);t.selection&&t.currentValue!==o&&(t.selection=null,(s.onInvalidateSelection||e.noop).call(t.element)),clearInterval(t.onChangeInterval),t.currentValue=n,t.selectedIndex=-1,s.triggerSelectOnValidInput&&t.isExactMatch(o)?t.select(0):o.length<s.minChars?(e("."+t.options.closeTrigger).removeClass(t.options.closeTrigger),t.hide()):t.getSuggestions(o)},isExactMatch:function(e){var t=this.suggestions;return 1===t.length&&t[0].value.toLowerCase()===e.toLowerCase()},canShowDetailsBox:function(){return 1==this.options.showDetailsPanel&&e(window).width()>=992&&!("ontouchend"in document)},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,o=t.toLowerCase(),i=n.lookupFilter,a=parseInt(n.lookupLimit,10);return s={suggestions:e.grep(n.lookup,function(e){return i(e,t,o)})},a&&s.suggestions.length>a&&(s.suggestions=s.suggestions.slice(0,a)),s},getSuggestions:function(t){var s,n,o,i,a=this,l=a.options,r=l.serviceUrl;l.params[l.paramName]=t,n=l.ignoreParams?null:l.params,a.preloader("show","form","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)),o=r+"?"+e.param(n||{}),s=a.cachedResponse[o]),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(),i={url:r,data:n,type:l.type,dataType:l.dataType},e.extend(i,l.ajaxSettings),a.currentRequest=e.ajax(i).done(function(e){var s;a.currentRequest=null,void 0!==(s=l.transformResult(e,t)).suggestions&&(a.processResponse(s,t,o),a.getDetails(s.suggestions[0])),a.fixPositionCapture(),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(!s.canShowDetailsBox())return!1;if(null!=t){var o,i,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(o=l.action+l.post_id+l.term_id+l.taxonomy,null!=(i=s.cachedDetails[o]))a.html(i.details),s.fixHeight(),s.fixPositionCapture();else{if(a.html(""),s.preloader("show","details","",!0),-1!=e.inArray(o,s.detailsRequestsSent))return;s.detailsRequestsSent.push(o),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[o]=t,s.preloader("hide","details","",!0),null!=t.details?a.html(t.details):a.html(""),s.fixPositionCapture(),s.fixHeight()},error:function(e,t){s.preloader("hide","details","",!0),a.html(e),s.fixPositionCapture(),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),n=(e(t.detailsContainer),e(t.suggestionsContainer).parent());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(),n.removeClass("dgwt-wcas-open"),t.signalHint(null)},suggest:function(){if(this.suggestions.length){var t,s=this,n=s.options,o=n.groupBy,i=n.formatResult,a=s.getQuery(s.currentValue),l=s.classes.suggestion,r=s.classes.selected,c=e(s.suggestionsContainer),d=e(s.detailsContainer),u=e(s.noSuggestionsContainer),g=n.beforeRender,h="";n.triggerSelectOnValidInput&&s.isExactMatch(a)?s.select(0):(e.each(s.suggestions,function(e,s){var r,c="",d="",u=!1;if(o&&(h+=(r=s.data[o],t===r?"":'<div class="autocomplete-group"><strong>'+(t=r)+"</strong></div>")),void 0===s.post_id){var g=l,p="";"product_cat"===s.taxonomy?(g+=" dgwt-wcas-suggestion-cat",p+='<span class="dgwt-wcas-st--tax">'+dgwt_wcas.t.category+"</span>"):"product_tag"===s.taxonomy?(g+=" dgwt-wcas-suggestion-tag",p+='<span class="dgwt-wcas-st--tax">'+dgwt_wcas.t.tag+"</span>"):g+=" dgwt-wcas-suggestion-nores",h+='<div class="'+g+'" data-index="'+e+'">',h+='<span class="dgwt-wcas-st">'+p+i(s.value,a)+"</span>",h+="</div>"}else void 0!==s.parents&&(c=s.parents),!0===n.showImage&&void 0!==s.thumb_html&&(u=!0),d+=void 0!==s.post_id?'data-post-id="'+s.post_id+'" ':"",d+=void 0!==s.taxonomy?'data-taxonomy="'+s.taxonomy+'" ':"",d+=void 0!==s.term_id?'data-term-id="'+s.term_id+'" ':"",h+='<div class="'+l+' dgwt-wcas-suggestion-product" data-index="'+e+'" '+d+">",u&&(h+='<span class="dgwt-wcas-si">'+s.thumb_html+"</span>"),h+=u?'<div class="dgwt-wcas-content-wrapp">':"",h+='<span class="dgwt-wcas-st">',h+="<span>"+i(s.value,a)+c+"</span>",!0===n.showSKU&&void 0!==s.sku&&s.sku.length>0&&(h+='<span class="dgwt-wcas-sku">(SKU: '+i(s.sku,a)+")</span>"),h+="</span>",!0===n.showPrice&&void 0!==s.price&&(h+='<span class="dgwt-wcas-sp">'+s.price+"</span>"),!0===n.showDescription&&void 0!==s.desc&&s.desc&&(h+='<span class="dgwt-wcas-sd">'+i(s.desc,a)+"</span>"),!0===n.showFeaturedBadge&&!0===s.on_sale&&(h+='<span class="dgwt-wcas-badge dgwt-wcas-badge-os">'+n.saleBadgeText+"</span>"),!0===n.showFeaturedBadge&&!0===s.featured&&(h+='<span class="dgwt-wcas-badge dgwt-wcas-badge-f">'+n.featuredBadgeText+"</span>"),h+=u?"</div>":"",h+="</div>"}),this.adjustContainerWidth(),u.detach(),c.html(h),e.isFunction(g)&&g.call(s.element,c,s.suggestions),s.fixPositionCapture(),c.show(),c.parent().addClass("dgwt-wcas-open"),!0===n.positionFixed&&e(s.suggestionsContainer).addClass("dgwt-wcas-suggestions-fixed"),!0===n.showDetailsPanel&&(d.show(),s.fixHeight()),n.autoSelectFirst&&(s.selectedIndex=0,c.scrollTop(0),c.children("."+l).first().addClass(r)),s.visible=!0,s.findBestHint())}else this.options.showNoSuggestionNotice?this.noSuggestions():this.hide()},noSuggestions:function(){var t=e(this.suggestionsContainer),s=e(this.noSuggestionsContainer);s.detach(),t.empty(),t.append(s),this.fixPositionCapture(),t.show(),this.visible=!0},adjustContainerWidth:function(){var t,s=this,n=s.options,o=e("body"),i=e("."+n.searchFormClass+'[data-wcas-context="'+s.getContext()+'"]'),a=e(s.suggestionsContainer),l=e(s.detailsContainer),r=s.getFormOffset(),c=getComputedStyle(i[0]).width;if(c=Math.round(parseFloat(c.replace("px",""))),"auto"===n.width&&(t=s.el.outerWidth(),a.css("width",t+"px")),!0===n.showDetailsPanel){if(i.width()>=550)return o.addClass("dgwt-wcas-full-width"),c%2==0?(a.css("width",Math.round(c/2)),l.css("width",Math.round(c/2))):(a.css("width",Math.floor(c/2)),l.css("width",Math.ceil(c/2))),o.removeClass("dgwt-wcas-details-left"),o.removeClass("dgwt-wcas-details-right"),void(!0===n.is_rtl?l.css("left","0"):a.css("left",c/2+r.left+"px"));o.addClass("dgwt-wcas-details-right")}},findBestHint:function(){var t=this.el.val().toLowerCase(),s=null;t&&(e.each(this.suggestions,function(e,n){var o=0===n.value.toLowerCase().indexOf(t);return o&&(s=n),!o}),this.signalHint(s))},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,o){var i,a,l="dgwt-wcas-preloader-wrapp",r=null==n?l:l+" "+n;"form"===s?a=this.getFormWrapper().find(".dgwt-wcas-preloader"):"details"===s&&(a=e(this.detailsContainer)),1==dgwt_wcas.show_preloader&&0!=a.length&&(!0===o?"hide"!==t?"show"===t&&(i='<div class="'+r+'"><div class="dgwt-wcas-default-preloader"></div></div>',a.html(i)):e(l).remove():"hide"===t?a.removeClass(n):a.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,o=n.options;e.suggestions=n.verifySuggestionsFormat(e.suggestions),o.noCache||(n.cachedResponse[s]=e,o.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,o=n.classes.selected,i=e(n.suggestionsContainer),a=i.find("."+n.classes.suggestion);return i.find("."+o).removeClass(o),n.selectedIndex=t,-1!==n.selectedIndex&&a.length>n.selectedIndex?(s=a.get(n.selectedIndex),e(s).addClass(o),s):null},selectHint:function(){var t=e.inArray(this.hint,this.suggestions);this.select(t)},select:function(e){this.hide(),this.onSelect(e),this.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(){this.selectedIndex!==this.suggestions.length-1&&this.adjustScroll(this.selectedIndex+1)},adjustScroll:function(t){var s=this,n=s.activate(t);if(n&&!s.canShowDetailsBox()){var o,i,a,l=e(n).outerHeight();o=n.offsetTop,a=(i=e(s.suggestionsContainer).scrollTop())+s.options.maxHeight-l,o<i?e(s.suggestionsContainer).scrollTop(o):o>a&&e(s.suggestionsContainer).scrollTop(o-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,o=s.suggestions[t];s.currentValue=s.getValue(o.value),s.currentValue===s.el.val()||s.options.preserveInput||s.el.val(s.currentValue),-1!=o.id&&(window.location.href=o.url),s.signalHint(null),s.suggestions=[],s.selection=o,e.isFunction(n)&&n.call(s.element,o)},onMouseOver:function(t){var s=this,n=s.options.onMouseOver,o=s.suggestions[t];s.selectedIndex!==t&&s.getDetails(o),e.isFunction(n)&&n.call(s.element,o)},onMouseLeave:function(t){var s=this.options.onMouseLeave,n=this.suggestions[t];e.isFunction(s)&&s.call(this.element,n)},getValue:function(e){var t,s,n=this.options.delimiter;return n?1===(s=(t=this.currentValue).split(n)).length?e:t.substr(0,t.length-s[s.length-1].length)+e:e},dispose:function(){this.el.off(".autocomplete").removeData("autocomplete"),this.disableKillerFn(),e(window).off("resize.autocomplete",this.fixPositionCapture),e(this.suggestionsContainer).remove()}},e.fn.dgwtWcasAutocomplete=function(t,s){var n="autocomplete";return arguments.length?this.each(function(){var o=e(this),i=o.data(n);"string"==typeof t?i&&"function"==typeof i[t]&&i[t](s):(i&&i.dispose&&i.dispose(),i=new r(this,t),o.data(n,i))}):this.first().data(n)},e(window).on("load",function(){e(".dgwt-wcas-search-submit").length>0&&e(".dgwt-wcas-search-submit").each(function(){var t=e(this).closest(".dgwt-wcas-search-wrapp").find(".dgwt-wcas-preloader");1==dgwt_wcas.is_rtl?t.css("left",6+e(this).outerWidth()+"px"):t.css("right",e(this).outerWidth()+"px")})}),e(document).ready(function(){var t,s,n=1==dgwt_wcas.show_details_box;(jQuery(window).width()<992||"ontouchend"in document)&&(n=!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:"s",showDetailsPanel:n,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,is_rtl:1==dgwt_wcas.is_rtl,maxHeight:(t=300,s=.8*e(window).height(),t>s&&(t=s),t)})})});
1
+ !function(e){"use strict";"function"==typeof define&&define.amd?define(["jquery"],e):"object"==typeof exports&&"function"==typeof require?e(require("jquery")):e(jQuery)}(function(e){"use strict";var t={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}},s=27,n=9,o=13,a=38,i=39,l=40;function r(t,s){var n=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:3,maxHeight:600,deferRequestBy:0,params:{},formatResult:r.formatResult,delimiter:null,zIndex:9999,type:"GET",noCache:!1,is_rtl:!1,onSearchStart:n,onSearchComplete:n,onSearchError:n,preserveInput:!1,searchFormClass:"dgwt-wcas-search-wrapp",containerClass:"dgwt-wcas-suggestions-wrapp",containerDetailsClass:"dgwt-wcas-details-wrapp",searchInputClass:"dgwt-wcas-search-input",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,positionFixed:!1};o.element=t,o.el=e(t),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,s),o.classes={selected:"dgwt-wcas-suggestion-selected",suggestion:"dgwt-wcas-suggestion",suggestionsContainerOrientTop:"dgwt-wcas-suggestions-wrapp--top"},o.hint=null,o.hintValue="",o.selection=null,o.initialize(),o.setOptions(s)}r.utils=t,e.Autocomplete=r,r.formatResult=function(e,s){if(!s)return e;var n="("+t.escapeRegExChars(s)+")";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>")},r.prototype={killerFn:null,initialize:function(){var t,s,n=this,o="."+n.classes.suggestion,a=(n.classes.selected,n.options),i="."+a.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())};var l=n.el.closest("."+a.searchFormClass).data("wcas-context");n.noSuggestionsContainer=e('<div class="dgwt-wcas-no-suggestion"></div>').html(this.options.noSuggestionNotice).get(0),n.suggestionsContainer=r.utils.createNode(a.containerClass),(t=e(n.suggestionsContainer)).attr("data-wcas-context",l),t.addClass("woocommerce"),t.appendTo("body"),!0===a.showImage&&t.addClass("dgwt-wcas-has-img"),!0===a.showPrice&&t.addClass("dgwt-wcas-has-price"),!0===a.showDescription&&t.addClass("dgwt-wcas-has-desc"),!0===a.showSKU&&t.addClass("dgwt-wcas-has-sku"),"auto"!==a.width&&t.width(a.width),!0===a.showDetailsPanel&&(n.detailsContainer=r.utils.createNode(a.containerDetailsClass),(s=e(n.detailsContainer)).attr("data-wcas-context",l),s.addClass("woocommerce"),s.appendTo("body")),t.on("mouseover.autocomplete",o,function(){n.onMouseOver(e(this).data("index")),n.activate(e(this).data("index"))}),t.on("mouseout.autocomplete",function(){}),e(document).on("click.autocomplete",i,function(t){n.killerFn(t),n.clear(!1),e(this).removeClass(a.closeTrigger),e(this).closest("."+a.searchFormClass).find("."+a.searchInputClass).val("").focus()}),t.on("click.autocomplete",o,function(){return n.select(e(this).data("index")),!1}),e(document).on("change",'[name="js-dgwt-wcas-quantity"]',function(t){e(this).closest(".js-dgwt-wcas-pd-addtc").find("[data-quantity]").attr("data-quantity",e(this).val())}),n.fixPositionCapture=function(){n.adjustContainerWidth(),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.fixPositionCapture(),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.getSuggestionsContainer(),o=s.options;(e.extend(o,t),s.isLocal=e.isArray(o.lookup),s.isLocal&&(o.lookup=s.verifySuggestionsFormat(o.lookup)),o.orientation=s.validateOrientation(o.orientation,"bottom"),n.css({"max-height":s.canShowDetailsBox()?"none":o.maxHeight+"px",width:o.width+"px","z-index":o.zIndex}),!0===o.showDetailsPanel)&&(s.getDetailsContainer().css({"z-index":o.zIndex-1}),e("body").addClass("dgwt-wcas-is-details"));s.options.onSearchComplete=function(){s.preloader("hide","form","dgwt-wcas-inner-preloader"),s.preloader("show","form",o.closeTrigger)}},clearCache:function(){this.cachedResponse={},this.cachedDetails={},this.badQueries=[]},clear:function(e){e&&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=e("."+t.options.containerClass+'[data-wcas-context="'+t.getContext()+'"]'),n=t.getFormOffset();s.css(n),t.canShowDetailsBox()&&t.fixPositionDetailsBox()},fixPositionDetailsBox:function(){var t=this,s=t.el.closest("[data-wcas-context]"),n=e("."+t.options.containerDetailsClass+'[data-wcas-context="'+t.getContext()+'"]'),o=e("."+t.options.containerClass+'[data-wcas-context="'+t.getContext()+'"]'),a=t.getFormOffset(),i=a.left;if(0==n.length)return!1;var l=!0===t.options.is_rtl?1:2,r=Math.round(a.left);if(a.left=r+Math.round(o.width()+l),n.css(a),s.width()>=550)return e("body").removeClass("dgwt-wcas-details-outside"),e("body").removeClass("dgwt-wcas-details-right"),e("body").removeClass("dgwt-wcas-details-left"),void(!0===t.options.is_rtl&&(o.css("left",r+Math.round(n.width()+l)+"px"),n.css("left",i+"px")));var c=e(window).width(),d=n.width(),u=n.offset();e("body").addClass("dgwt-wcas-details-outside"),!0===t.options.is_rtl&&(a.left=a.left+1);var g=!1,h=!1;c<u.left+d&&(g=!0,e("body").removeClass("dgwt-wcas-details-right"),e("body").addClass("dgwt-wcas-details-left"),n.css("left",Math.round(parseFloat(o.css("left").replace("px","")))-n.outerWidth()+"px")),(u=n.offset()).left<1&&(h=!0,e("body").removeClass("dgwt-wcas-details-left"),e("body").addClass("dgwt-wcas-details-right")),h&&g?(e("body").removeClass("dgwt-wcas-details-left"),e("body").removeClass("dgwt-wcas-details-right"),e("body").addClass("dgwt-wcas-details-notfit")):e("body").removeClass("dgwt-wcas-details-notfit")},fixHeight:function(){var t=this.options;if(1!=t.showDetailsPanel)return!1;e("."+t.containerClass).css("height","auto"),e("."+t.containerDetailsClass).css("height","auto");var s=e("."+t.containerClass),n=e("."+t.containerDetailsClass),o=s.outerHeight(),a=n.outerHeight();return s.find(".dgwt-wcas-suggestion:last-child").removeClass("dgwt-wcas-suggestion-no-border-bottom"),!(o<=340&&a<=340)&&(s.find(".dgwt-wcas-suggestion:last-child").addClass("dgwt-wcas-suggestion-no-border-bottom"),a<o&&n.css("height",o+"px"),o<a&&s.css("height",a+"px"),!1)},getFormOffset:function(){var t=this,s=t.getFormWrapper(),n=t.getSuggestionsContainer(),o=t.options.orientation,a=s.outerHeight(),i=t.el.outerHeight(),l=t.el.offset(),r={top:l.top,left:l.left};if("auto"===o){var c=e(window).height(),d=e(window).scrollTop(),u=-d+l.top-a,g=d+c-(l.top+i+a);o=Math.max(u,g)===u?"top":"bottom"}if("top"===o){n[0].getBoundingClientRect().top;var h=s[0].getBoundingClientRect().top;n.css("height","auto"),h<n.height()&&n.height(h-10),r.top+=-n.outerHeight()}else r.top+=i;return r},getContext:function(){var e=this.el.closest("[data-wcas-context]"),t="";return e.length>0&&(t=e.data("wcas-context")),t},getFormWrapper:function(){return this.el.closest("[data-wcas-context]")},getSuggestionsContainer:function(){return e("."+this.options.containerClass+'[data-wcas-context="'+this.getContext()+'"]')},getDetailsContainer:function(){return e("."+this.options.containerDetailsClass+'[data-wcas-context="'+this.getContext()+'"]')},scrollDownSuggestions:function(){var e=this.getSuggestionsContainer();e[0].scrollTop=e[0].scrollHeight},enableKillerFn:function(){e(document).on("click.autocomplete",this.killerFn)},disableKillerFn:function(){e(document).off("click.autocomplete",this.killerFn)},killSuggestions:function(){var e=this;e.stopKillSuggestions(),e.intervalId=window.setInterval(function(){e.visible&&(e.options.preserveInput||e.el.val(e.currentValue),e.hide()),e.stopKillSuggestions()},50)},stopKillSuggestions:function(){window.clearInterval(this.intervalId)},isCursorAtEnd:function(){var e,t=this.el.val().length,s=this.element.selectionStart;return"number"==typeof s?s===t:!document.selection||((e=document.selection.createRange()).moveStart("character",-t),t===e.text.length)},onKeyPress:function(e){var t=this;if(t.disabled||t.visible||e.which!==l||!t.currentValue){if(!t.disabled&&t.visible){switch(e.which){case s:t.el.val(t.currentValue),t.hide();break;case i:if(t.hint&&t.options.onHint&&t.isCursorAtEnd()){t.selectHint();break}return;case n: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 o:if(-1===t.selectedIndex)return void t.hide();t.select(t.selectedIndex);break;case a:t.moveUp();break;case l: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 a:case l: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(),o=t.getQuery(n);t.selection&&t.currentValue!==o&&(t.selection=null,(s.onInvalidateSelection||e.noop).call(t.element)),clearInterval(t.onChangeInterval),t.currentValue=n,t.selectedIndex=-1,s.triggerSelectOnValidInput&&t.isExactMatch(o)?t.select(0):o.length<s.minChars?(e("."+t.options.closeTrigger).removeClass(t.options.closeTrigger),t.hide()):t.getSuggestions(o)},isExactMatch:function(e){var t=this.suggestions;return 1===t.length&&t[0].value.toLowerCase()===e.toLowerCase()},canShowDetailsBox:function(){return 1==this.options.showDetailsPanel&&e(window).width()>=992&&!("ontouchend"in document)},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,o=t.toLowerCase(),a=n.lookupFilter,i=parseInt(n.lookupLimit,10);return s={suggestions:e.grep(n.lookup,function(e){return a(e,t,o)})},i&&s.suggestions.length>i&&(s.suggestions=s.suggestions.slice(0,i)),s},getSuggestions:function(t){var s,n,o,a,i=this,l=i.options,r=l.serviceUrl;l.params[l.paramName]=t,n=l.ignoreParams?null:l.params,i.preloader("show","form","dgwt-wcas-inner-preloader"),!1!==l.onSearchStart.call(i.element,l.params)&&(e.isFunction(l.lookup)?l.lookup(t,function(e){i.suggestions=e.suggestions,i.suggest(),i.getDetails(e.suggestions[0]),l.onSearchComplete.call(i.element,t,e.suggestions)}):(i.isLocal?s=i.getSuggestionsLocal(t):(e.isFunction(r)&&(r=r.call(i.element,t)),o=r+"?"+e.param(n||{}),s=i.cachedResponse[o]),s&&e.isArray(s.suggestions)?(i.suggestions=s.suggestions,i.suggest(),i.getDetails(s.suggestions[0]),l.onSearchComplete.call(i.element,t,s.suggestions)):i.isBadQuery(t)?l.onSearchComplete.call(i.element,t,[]):(i.abortAjax(),a={url:r,data:n,type:l.type,dataType:l.dataType},e.extend(a,l.ajaxSettings),i.currentRequest=e.ajax(a).done(function(e){var s;i.currentRequest=null,void 0!==(s=l.transformResult(e,t)).suggestions&&(i.processResponse(s,t,o),i.getDetails(s.suggestions[0])),i.fixPositionCapture(),l.onSearchComplete.call(i.element,t,s.suggestions)}).fail(function(e,s,n){l.onSearchError.call(i.element,t,e,s,n)}))))},getDetails:function(t){var s=this,n=s.options;if(!s.canShowDetailsBox())return!1;if(null!=t){var o,a,i=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(o=l.action+l.post_id+l.term_id+l.taxonomy,null!=(a=s.cachedDetails[o]))i.html(a.details),s.fixHeight(),s.fixPositionCapture();else{if(i.html(""),s.preloader("show","details","",!0),-1!=e.inArray(o,s.detailsRequestsSent))return;s.detailsRequestsSent.push(o),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[o]=t,s.preloader("hide","details","",!0),null!=t.details?i.html(t.details):i.html(""),s.fixPositionCapture(),s.fixHeight()},error:function(e,t){s.preloader("hide","details","",!0),i.html(e),s.fixPositionCapture(),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=t.getSuggestionsContainer(),n=t.getDetailsContainer();e.isFunction(t.options.onHide)&&t.visible&&t.options.onHide.call(t.element,container),t.visible=!1,t.selectedIndex=-1,clearInterval(t.onChangeInterval),s.hide(),s.removeClass(t.classes.suggestionsContainerOrientTop),n.hide(),e("body").removeClass("dgwt-wcas-open"),e("body").removeClass("dgwt-wcas-block-scroll"),t.signalHint(null)},suggest:function(){if(this.suggestions.length){var t,s=this,n=s.options,o=n.groupBy,a=n.formatResult,i=s.getQuery(s.currentValue),l=s.classes.suggestion,r=s.classes.selected,c=s.getSuggestionsContainer(),d=s.getDetailsContainer(),u=e(s.noSuggestionsContainer),g=n.beforeRender,h="";n.triggerSelectOnValidInput&&s.isExactMatch(i)?s.select(0):(e.each(s.suggestions,function(e,s){var r,c="",d="",u=!1;if(o&&(h+=(r=s.data[o],t===r?"":'<div class="autocomplete-group"><strong>'+(t=r)+"</strong></div>")),void 0===s.post_id){var g=l,p="";"product_cat"===s.taxonomy?(g+=" dgwt-wcas-suggestion-cat",p+='<span class="dgwt-wcas-st--tax">'+dgwt_wcas.t.category+"</span>"):"product_tag"===s.taxonomy?(g+=" dgwt-wcas-suggestion-tag",p+='<span class="dgwt-wcas-st--tax">'+dgwt_wcas.t.tag+"</span>"):g+=" dgwt-wcas-suggestion-nores",h+='<div class="'+g+'" data-index="'+e+'">',h+='<span class="dgwt-wcas-st">'+p+a(s.value,i)+"</span>",h+="</div>"}else void 0!==s.parents&&(c=s.parents),!0===n.showImage&&void 0!==s.thumb_html&&(u=!0),d+=void 0!==s.post_id?'data-post-id="'+s.post_id+'" ':"",d+=void 0!==s.taxonomy?'data-taxonomy="'+s.taxonomy+'" ':"",d+=void 0!==s.term_id?'data-term-id="'+s.term_id+'" ':"",h+='<div class="'+l+' dgwt-wcas-suggestion-product" data-index="'+e+'" '+d+">",u&&(h+='<span class="dgwt-wcas-si">'+s.thumb_html+"</span>"),h+=u?'<div class="dgwt-wcas-content-wrapp">':"",h+='<span class="dgwt-wcas-st">',h+="<span>"+a(s.value,i)+c+"</span>",!0===n.showSKU&&void 0!==s.sku&&s.sku.length>0&&(h+='<span class="dgwt-wcas-sku">(SKU: '+a(s.sku,i)+")</span>"),h+="</span>",!0===n.showPrice&&void 0!==s.price&&(h+='<span class="dgwt-wcas-sp">'+s.price+"</span>"),!0===n.showDescription&&void 0!==s.desc&&s.desc&&(h+='<span class="dgwt-wcas-sd">'+a(s.desc,i)+"</span>"),!0===n.showFeaturedBadge&&!0===s.on_sale&&(h+='<span class="dgwt-wcas-badge dgwt-wcas-badge-os">'+n.saleBadgeText+"</span>"),!0===n.showFeaturedBadge&&!0===s.featured&&(h+='<span class="dgwt-wcas-badge dgwt-wcas-badge-f">'+n.featuredBadgeText+"</span>"),h+=u?"</div>":"",h+="</div>"}),this.adjustContainerWidth(),u.detach(),c.html(h),e.isFunction(g)&&g.call(s.element,c,s.suggestions),s.fixPositionCapture(),c.show(),e("body").addClass("dgwt-wcas-open"),!0===n.showDetailsPanel&&(d.show(),s.fixHeight()),n.autoSelectFirst&&(s.selectedIndex=0,c.scrollTop(0),c.children("."+l).first().addClass(r)),s.visible=!0,"top"===s.options.orientation&&(s.getSuggestionsContainer().addClass(s.classes.suggestionsContainerOrientTop),e("body").addClass("dgwt-wcas-block-scroll"),setTimeout(function(){s.scrollDownSuggestions()},300)),s.findBestHint())}else this.options.showNoSuggestionNotice?this.noSuggestions():this.hide()},noSuggestions:function(){var t=this.getSuggestionsContainer(),s=e(this.noSuggestionsContainer);s.detach(),t.empty(),t.append(s),this.fixPositionCapture(),t.show(),this.visible=!0},adjustContainerWidth:function(){var t,s=this,n=s.options,o=e("body"),a=s.getFormWrapper(),i=s.getSuggestionsContainer(),l=s.getDetailsContainer(),r=s.getFormOffset(),c=getComputedStyle(a[0]).width;if(c=Math.round(parseFloat(c.replace("px",""))),"auto"===n.width&&(t=s.el.outerWidth(),i.css("width",t+"px")),!0===n.showDetailsPanel){if(a.width()>=550)return o.addClass("dgwt-wcas-full-width"),c%2==0?(i.css("width",Math.round(c/2)),l.css("width",Math.round(c/2))):(i.css("width",Math.floor(c/2)),l.css("width",Math.ceil(c/2))),o.removeClass("dgwt-wcas-details-left"),o.removeClass("dgwt-wcas-details-right"),void(!0===n.is_rtl?l.css("left","0"):i.css("left",c/2+r.left+"px"));o.addClass("dgwt-wcas-details-right")}},findBestHint:function(){var t=this.el.val().toLowerCase(),s=null;t&&(e.each(this.suggestions,function(e,n){var o=0===n.value.toLowerCase().indexOf(t);return o&&(s=n),!o}),this.signalHint(s))},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,o){var a,i,l="dgwt-wcas-preloader-wrapp",r=null==n?l:l+" "+n;"form"===s?i=this.getFormWrapper().find(".dgwt-wcas-preloader"):"details"===s&&(i=e(this.detailsContainer)),1==dgwt_wcas.show_preloader&&0!=i.length&&(!0===o?"hide"!==t?"show"===t&&(a='<div class="'+r+'"><div class="dgwt-wcas-default-preloader"></div></div>',i.html(a)):e(l).remove():"hide"===t?i.removeClass(n):i.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,o=n.options;e.suggestions=n.verifySuggestionsFormat(e.suggestions),o.noCache||(n.cachedResponse[s]=e,o.preventBadQueries&&!e.suggestions.length&&n.badQueries.push(t)),t===n.getQuery(n.currentValue)&&("top"===n.options.orientation&&e.suggestions.reverse(),n.suggestions=e.suggestions,n.suggest())},activate:function(t){var s,n=this,o=n.classes.selected,a=n.getSuggestionsContainer(),i=a.find("."+n.classes.suggestion);return a.find("."+o).removeClass(o),n.selectedIndex=t,-1!==n.selectedIndex&&i.length>n.selectedIndex?(s=i.get(n.selectedIndex),e(s).addClass(o),s):null},selectHint:function(){var t=e.inArray(this.hint,this.suggestions);this.select(t)},select:function(e){this.hide(),this.onSelect(e),this.disableKillerFn()},moveUp:function(){var e=this;if(-1!==e.selectedIndex)return 0===e.selectedIndex?(e.getSuggestionsContainer().children().first().removeClass(e.classes.selected),e.selectedIndex=-1,e.el.val(e.currentValue),void e.findBestHint()):void e.adjustScroll(e.selectedIndex-1)},moveDown:function(){this.selectedIndex!==this.suggestions.length-1&&this.adjustScroll(this.selectedIndex+1)},adjustScroll:function(t){var s=this,n=s.activate(t);if(n&&!s.canShowDetailsBox()){var o,a,i,l=s.getSuggestionsContainer(),r=e(n).outerHeight();o=n.offsetTop,i=(a=l.scrollTop())+s.options.maxHeight-r,o<a?l.scrollTop(o):o>i&&l.scrollTop(o-s.options.maxHeight+r),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,o=s.suggestions[t];s.currentValue=s.getValue(o.value),s.currentValue===s.el.val()||s.options.preserveInput||s.el.val(s.currentValue),-1!=o.id&&(window.location.href=o.url),s.signalHint(null),s.suggestions=[],s.selection=o,e.isFunction(n)&&n.call(s.element,o)},onMouseOver:function(t){var s=this,n=s.options.onMouseOver,o=s.suggestions[t];s.selectedIndex!==t&&s.getDetails(o),e.isFunction(n)&&n.call(s.element,o)},onMouseLeave:function(t){var s=this.options.onMouseLeave,n=this.suggestions[t];e.isFunction(s)&&s.call(this.element,n)},getValue:function(e){var t,s,n=this.options.delimiter;return n?1===(s=(t=this.currentValue).split(n)).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.options.containerClass).remove(),e("."+t.options.containerDetailsClass).remove()}},e.fn.dgwtWcasAutocomplete=function(t,s){var n="autocomplete";return arguments.length?this.each(function(){var o=e(this),a=o.data(n);"string"==typeof t?a&&"function"==typeof a[t]&&a[t](s):(a&&a.dispose&&a.dispose(),a=new r(this,t),o.data(n,a))}):this.first().data(n)},e(window).on("load",function(){e(".dgwt-wcas-search-submit").length>0&&e(".dgwt-wcas-search-submit").each(function(){var t=e(this).closest(".dgwt-wcas-search-wrapp").find(".dgwt-wcas-preloader");1==dgwt_wcas.is_rtl?t.css("left",6+e(this).outerWidth()+"px"):t.css("right",e(this).outerWidth()+"px")})}),e(document).ready(function(){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:"s",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,is_rtl:1==dgwt_wcas.is_rtl})})});
fs/config.php CHANGED
@@ -16,9 +16,10 @@ function dgora_asfw_fs() {
16
  'is_premium' => false,
17
  'has_addons' => false,
18
  'has_paid_plans' => false,
19
- 'menu' => array(
20
- 'support' => false,
21
- ),
 
22
  ) );
23
  }
24
 
16
  'is_premium' => false,
17
  'has_addons' => false,
18
  'has_paid_plans' => false,
19
+ 'menu' => array(
20
+ 'slug' => 'dgwt_wcas_settings',
21
+ 'support' => false,
22
+ )
23
  ) );
24
  }
25
 
includes/Engines/WordPressNative/Search.php CHANGED
@@ -22,7 +22,7 @@ class Search {
22
  * Description limit
23
  * int
24
  */
25
- private $desc_limit = 130;
26
 
27
  /**
28
  * Empty slots
@@ -35,20 +35,20 @@ class Search {
35
  $this->limit = absint( DGWT_WCAS()->settings->get_opt( 'suggestions_limit', 10 ) );
36
  $this->slots = $this->limit; // Free slots for the results. Default 10
37
 
38
- add_filter( 'posts_search', array( $this, 'search_filters' ), 501, 2 );
39
- add_filter( 'posts_where', array( $this, 'fix_woo_excerpt_search' ), 100, 2 );
40
  add_filter('posts_distinct', array($this, 'search_distinct'), 501, 2);
41
- add_filter( 'posts_join', array( $this, 'search_filters_join' ), 501, 2 );
42
- add_filter( 'pre_get_posts', array( $this, 'change_wp_search_size' ), 500 );
43
- add_filter( 'pre_get_posts', array( $this, 'set_search_results_query' ), 501 );
44
- add_filter( 'pre_get_posts', array( $this, 'force_post_type' ), 502 );
45
 
46
  // Search results ajax action
47
  if ( DGWT_WCAS_WC_AJAX_ENDPOINT ) {
48
- add_action( 'wc_ajax_' . DGWT_WCAS_SEARCH_ACTION, array( $this, 'get_search_results' ) );
49
  } else {
50
- add_action( 'wp_ajax_nopriv_' . DGWT_WCAS_SEARCH_ACTION, array( $this, 'get_search_results' ) );
51
- add_action( 'wp_ajax_' . DGWT_WCAS_SEARCH_ACTION, array( $this, 'get_search_results' ) );
52
  }
53
  }
54
 
@@ -56,9 +56,11 @@ class Search {
56
  * Get search results via ajax
57
  */
58
 
59
- public function get_search_results() {
60
  global $woocommerce;
61
 
 
 
62
  if ( !defined( 'DGWT_WCAS_AJAX' ) ) {
63
  define( 'DGWT_WCAS_AJAX', true );
64
  }
@@ -130,15 +132,19 @@ class Search {
130
 
131
  if ( !empty( $products ) ) {
132
 
 
 
133
  foreach ( $products as $post ) {
134
  $product = new Product( $post );
135
 
136
  $r = array(
137
  'post_id' => $product->getID(),
138
- 'value' => html_entity_decode(wp_strip_all_tags($product->getName())),
139
  'url' => $product->getPermalink(),
140
  );
141
 
 
 
142
  // Get thumb HTML
143
  if ( DGWT_WCAS()->settings->get_opt( 'show_product_image' ) === 'on' ) {
144
  $r[ 'thumb_html' ] = $product->getThumbnail();
@@ -152,9 +158,9 @@ class Search {
152
  // Get description
153
  if ( DGWT_WCAS()->settings->get_opt( 'show_product_desc' ) === 'on' ) {
154
  if ( DGWT_WCAS()->settings->get_opt( 'show_details_box' ) === 'on' ) {
155
- $this->desc_limit = 60;
156
  }
157
- $r[ 'desc' ] = Helpers::get_product_desc( $product->getID(), $this->desc_limit );
158
  }
159
 
160
  // Get SKU
@@ -162,7 +168,7 @@ class Search {
162
  $r[ 'sku' ] = $product->getSKU();
163
  }
164
 
165
- // Is on sale
166
  // if ( DGWT_WCAS()->settings->get_opt( 'show_sale_badge' ) === 'on' ) {
167
  // $r[ 'on_sale' ] = $product->is_on_sale();
168
  // }
@@ -172,7 +178,12 @@ class Search {
172
  // $r[ 'featured' ] = $product->is_featured();
173
  // }
174
 
175
- $results[] = apply_filters( 'dgwt/wcas/search_results/suggestion', $r, $product );
 
 
 
 
 
176
  }
177
  }
178
  wp_reset_postdata();
@@ -180,32 +191,86 @@ class Search {
180
 
181
 
182
 
183
- // Show nothing on empty results
184
- //@todo show 'No results' as option
185
- if ( empty( $results ) ) {
 
 
 
186
 
187
- $results[] = array(
188
- 'value' => __( 'No results', 'ajax-search-for-woocommerce' ),
189
- );
190
  }
191
 
 
 
 
 
 
 
 
 
192
  $output[ 'suggestions' ] = $results;
 
193
 
194
  echo json_encode( apply_filters( 'dgwt/wcas/search_results/output', $output ));
195
  die();
196
  }
197
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
198
  /**
199
  * Get meta query
200
  * For WooCommerce < 3.0
201
- *
202
  * return array
203
  */
204
 
205
  private function get_meta_query() {
206
 
207
- $meta_query = array();
208
-
209
  $meta_query = array(
210
  'relation' => 'AND',
211
  1 => array(
@@ -274,9 +339,9 @@ class Search {
274
 
275
  /**
276
  * Search for matching category
277
- *
278
  * @param string $keyword
279
- *
280
  * @return array
281
  */
282
 
@@ -296,18 +361,19 @@ class Search {
296
 
297
  if ( $i < $this->limit ) {
298
 
299
- $pos = strpos( strtolower( $cat->name ), strtolower( $keyword ) );
 
 
300
 
301
  if ( $pos !== false ) {
302
  $results[ $i ] = array(
303
  'term_id' => $cat->term_id,
304
  'taxonomy' => DGWT_WCAS_WOO_PRODUCT_CATEGORY,
305
- 'value' => preg_replace( sprintf( "/(%s)/", $keyword ), "$1", $cat->name ),
306
  'url' => get_term_link( $cat, DGWT_WCAS_WOO_PRODUCT_CATEGORY ),
307
  'parents' => ''
308
  );
309
 
310
-
311
  // Add category parents info
312
  $parents = $this->get_taxonomy_parent_string( $cat->term_id, DGWT_WCAS_WOO_PRODUCT_CATEGORY, array(), array( $cat->term_id ) );
313
 
@@ -328,9 +394,9 @@ class Search {
328
 
329
  /**
330
  * Extend research in the Woo tags
331
- *
332
  * @param strong $keyword
333
- *
334
  * @return array
335
  */
336
 
@@ -350,13 +416,15 @@ class Search {
350
 
351
  if ( $i < $this->limit ) {
352
 
353
- $pos = strpos( strtolower( $tag->name ), strtolower( $keyword ) );
 
 
354
 
355
  if ( $pos !== false ) {
356
  $results[ $i ] = array(
357
  'term_id' => $tag->term_id,
358
  'taxonomy' => DGWT_WCAS_WOO_PRODUCT_TAG,
359
- 'value' => preg_replace( sprintf( "/(%s)/", $keyword ), "$1", $tag->name ),
360
  'url' => get_term_link( $tag, DGWT_WCAS_WOO_PRODUCT_TAG ),
361
  'parents' => ''
362
  );
@@ -380,12 +448,13 @@ class Search {
380
  /**
381
  * Set search product limit
382
  */
 
383
 
384
- public function change_wp_search_size( $query ) {
385
-
386
- if ( $this->is_ajax_search() ) {
387
- if ( $query->is_search )
388
- $query->query_vars[ 'posts_per_page' ] = $this->slots;
389
  }
390
 
391
  return $query;
@@ -393,13 +462,13 @@ class Search {
393
 
394
  /**
395
  * Search only in products titles
396
- *
397
  * @param string $search SQL
398
- *
399
  * @return string prepared SQL
400
  */
401
 
402
- public function search_filters( $search, $wp_query ) {
403
  global $wpdb;
404
 
405
  if ( empty( $search ) || is_admin() ) {
@@ -475,7 +544,7 @@ class Search {
475
  * Join the postmeta column in the search posts SQL
476
  */
477
 
478
- public function search_filters_join( $join, $query ) {
479
  global $wpdb;
480
 
481
  if ( empty( $query->query_vars[ 'post_type' ] ) || $query->query_vars[ 'post_type' ] !== 'product' ) {
@@ -502,7 +571,7 @@ class Search {
502
  * @param string $where
503
  * @return string
504
  */
505
- public function fix_woo_excerpt_search($where){
506
  global $wp_the_query;
507
 
508
  // If this is not a WC Query, do not modify the query
@@ -556,15 +625,15 @@ class Search {
556
 
557
  /**
558
  * Change default search query on the search results page
559
- *
560
  * @since 1.0.3
561
- *
562
  * @param object $query
563
- *
564
  * @return object
565
  */
566
 
567
- public function set_search_results_query( $query ) {
568
  global $woocommerce;
569
 
570
  if ( !$this->is_ajax_search() && $query->is_search ) {
@@ -606,7 +675,7 @@ class Search {
606
  *
607
  * @return object
608
  */
609
- public function force_post_type($query){
610
 
611
  if($this->is_search_page() || $this->is_ajax_search()){
612
  if($query->is_search){
22
  * Description limit
23
  * int
24
  */
25
+ private $descLimit = 130;
26
 
27
  /**
28
  * Empty slots
35
  $this->limit = absint( DGWT_WCAS()->settings->get_opt( 'suggestions_limit', 10 ) );
36
  $this->slots = $this->limit; // Free slots for the results. Default 10
37
 
38
+ add_filter( 'posts_search', array( $this, 'searchFilters' ), 501, 2 );
39
+ add_filter( 'posts_where', array( $this, 'fixWooExcerptSearch' ), 100, 2 );
40
  add_filter('posts_distinct', array($this, 'search_distinct'), 501, 2);
41
+ add_filter( 'posts_join', array( $this, 'searchFiltersJoin' ), 501, 2 );
42
+ add_filter( 'pre_get_posts', array( $this, 'changeWpSearchSize' ), 500 );
43
+ add_filter( 'pre_get_posts', array( $this, 'setSearchResultsQuery' ), 501 );
44
+ add_filter( 'pre_get_posts', array( $this, 'forcePostType' ), 502 );
45
 
46
  // Search results ajax action
47
  if ( DGWT_WCAS_WC_AJAX_ENDPOINT ) {
48
+ add_action( 'wc_ajax_' . DGWT_WCAS_SEARCH_ACTION, array( $this, 'getSearchResults' ) );
49
  } else {
50
+ add_action( 'wp_ajax_nopriv_' . DGWT_WCAS_SEARCH_ACTION, array( $this, 'getSearchResults' ) );
51
+ add_action( 'wp_ajax_' . DGWT_WCAS_SEARCH_ACTION, array( $this, 'getSearchResults' ) );
52
  }
53
  }
54
 
56
  * Get search results via ajax
57
  */
58
 
59
+ public function getSearchResults() {
60
  global $woocommerce;
61
 
62
+ $start = microtime(true);
63
+
64
  if ( !defined( 'DGWT_WCAS_AJAX' ) ) {
65
  define( 'DGWT_WCAS_AJAX', true );
66
  }
132
 
133
  if ( !empty( $products ) ) {
134
 
135
+ $relevantProducts = array();
136
+
137
  foreach ( $products as $post ) {
138
  $product = new Product( $post );
139
 
140
  $r = array(
141
  'post_id' => $product->getID(),
142
+ 'value' => wp_strip_all_tags($product->getName()),
143
  'url' => $product->getPermalink(),
144
  );
145
 
146
+ $r['score'] = $this->applyScore($r['value'], $keyword);
147
+
148
  // Get thumb HTML
149
  if ( DGWT_WCAS()->settings->get_opt( 'show_product_image' ) === 'on' ) {
150
  $r[ 'thumb_html' ] = $product->getThumbnail();
158
  // Get description
159
  if ( DGWT_WCAS()->settings->get_opt( 'show_product_desc' ) === 'on' ) {
160
  if ( DGWT_WCAS()->settings->get_opt( 'show_details_box' ) === 'on' ) {
161
+ $this->descLimit = 60;
162
  }
163
+ $r[ 'desc' ] = Helpers::get_product_desc( $product->getID(), $this->descLimit );
164
  }
165
 
166
  // Get SKU
168
  $r[ 'sku' ] = $product->getSKU();
169
  }
170
 
171
+ // Is on sale
172
  // if ( DGWT_WCAS()->settings->get_opt( 'show_sale_badge' ) === 'on' ) {
173
  // $r[ 'on_sale' ] = $product->is_on_sale();
174
  // }
178
  // $r[ 'featured' ] = $product->is_featured();
179
  // }
180
 
181
+ $relevantProducts[] = apply_filters( 'dgwt/wcas/search_results/products', $r, $product );
182
+ $this->slots--;
183
+
184
+ if($this->slots == 0){
185
+ break;
186
+ }
187
  }
188
  }
189
  wp_reset_postdata();
191
 
192
 
193
 
194
+ if ( !empty( $relevantProducts ) ) {
195
+
196
+ // Sort by relevance
197
+ usort($relevantProducts, array($this, 'cmpSimilarity'));
198
+
199
+ $results = array_merge( $results, $relevantProducts );
200
 
 
 
 
201
  }
202
 
203
+ if(empty($results)){
204
+ // Show nothing on empty results
205
+ //@todo show 'No results' as option
206
+ $results[] = array(
207
+ 'value' => __( 'No results', 'ajax-search-for-woocommerce' ),
208
+ );
209
+ }
210
+
211
  $output[ 'suggestions' ] = $results;
212
+ $output['time'] = number_format((microtime(true) - $start), 2, '.', '') . ' sec';
213
 
214
  echo json_encode( apply_filters( 'dgwt/wcas/search_results/output', $output ));
215
  die();
216
  }
217
 
218
+ /**
219
+ *
220
+ * Calculate score for results
221
+ *
222
+ * @param string $pname
223
+ * @param string $keyword
224
+ *
225
+ * @return float|int
226
+ */
227
+ private function applyScore($pname, $keyword){
228
+
229
+ $pname = strtolower($pname);
230
+ similar_text($keyword, $pname, $percent);
231
+
232
+ $score = $percent;
233
+
234
+ $pos = strpos($pname, $keyword);
235
+
236
+ // Add score based on substring position
237
+ if ($pos !== false) {
238
+ $score += 50; // Bonus for contained substring
239
+
240
+ // Bonus for substring position
241
+ $posBonus = (100 - ($pos * 100) / strlen($pname)) / 2;
242
+ $score += $posBonus;
243
+ }
244
+
245
+ return $score;
246
+ }
247
+
248
+ /**
249
+ * Sorting by score
250
+ *
251
+ * @param array $a
252
+ * @param array $b
253
+ *
254
+ * @return int
255
+ */
256
+ public function cmpSimilarity($a, $b)
257
+ {
258
+ if ($a['score']== $b['score']) {
259
+ return 0;
260
+ }
261
+
262
+ return ($a['score'] < $b['score']) ? 1 : -1;
263
+ }
264
+
265
  /**
266
  * Get meta query
267
  * For WooCommerce < 3.0
268
+ *
269
  * return array
270
  */
271
 
272
  private function get_meta_query() {
273
 
 
 
274
  $meta_query = array(
275
  'relation' => 'AND',
276
  1 => array(
339
 
340
  /**
341
  * Search for matching category
342
+ *
343
  * @param string $keyword
344
+ *
345
  * @return array
346
  */
347
 
361
 
362
  if ( $i < $this->limit ) {
363
 
364
+ $cat_name = html_entity_decode($cat->name);
365
+
366
+ $pos = strpos( strtolower( $cat_name ), strtolower( $keyword ) );
367
 
368
  if ( $pos !== false ) {
369
  $results[ $i ] = array(
370
  'term_id' => $cat->term_id,
371
  'taxonomy' => DGWT_WCAS_WOO_PRODUCT_CATEGORY,
372
+ 'value' => preg_replace( sprintf( "/(%s)/", $keyword ), "$1", $cat_name ),
373
  'url' => get_term_link( $cat, DGWT_WCAS_WOO_PRODUCT_CATEGORY ),
374
  'parents' => ''
375
  );
376
 
 
377
  // Add category parents info
378
  $parents = $this->get_taxonomy_parent_string( $cat->term_id, DGWT_WCAS_WOO_PRODUCT_CATEGORY, array(), array( $cat->term_id ) );
379
 
394
 
395
  /**
396
  * Extend research in the Woo tags
397
+ *
398
  * @param strong $keyword
399
+ *
400
  * @return array
401
  */
402
 
416
 
417
  if ( $i < $this->limit ) {
418
 
419
+ $tag_name = html_entity_decode($tag->name);
420
+
421
+ $pos = strpos( strtolower( $tag_name ), strtolower( $keyword ) );
422
 
423
  if ( $pos !== false ) {
424
  $results[ $i ] = array(
425
  'term_id' => $tag->term_id,
426
  'taxonomy' => DGWT_WCAS_WOO_PRODUCT_TAG,
427
+ 'value' => preg_replace( sprintf( "/(%s)/", $keyword ), "$1", $tag_name ),
428
  'url' => get_term_link( $tag, DGWT_WCAS_WOO_PRODUCT_TAG ),
429
  'parents' => ''
430
  );
448
  /**
449
  * Set search product limit
450
  */
451
+ public function changeWpSearchSize( $query ) {
452
 
453
+ if ( $this->is_ajax_search() && $query->is_search ) {
454
+ // @TODO Buffer for improve relevance.
455
+ // Better way return all relevant posts and add link "show all results"
456
+ $limit = $this->slots + 30;
457
+ $query->query_vars[ 'posts_per_page' ] = $limit;
458
  }
459
 
460
  return $query;
462
 
463
  /**
464
  * Search only in products titles
465
+ *
466
  * @param string $search SQL
467
+ *
468
  * @return string prepared SQL
469
  */
470
 
471
+ public function searchFilters( $search, $wp_query ) {
472
  global $wpdb;
473
 
474
  if ( empty( $search ) || is_admin() ) {
544
  * Join the postmeta column in the search posts SQL
545
  */
546
 
547
+ public function searchFiltersJoin( $join, $query ) {
548
  global $wpdb;
549
 
550
  if ( empty( $query->query_vars[ 'post_type' ] ) || $query->query_vars[ 'post_type' ] !== 'product' ) {
571
  * @param string $where
572
  * @return string
573
  */
574
+ public function fixWooExcerptSearch($where){
575
  global $wp_the_query;
576
 
577
  // If this is not a WC Query, do not modify the query
625
 
626
  /**
627
  * Change default search query on the search results page
628
+ *
629
  * @since 1.0.3
630
+ *
631
  * @param object $query
632
+ *
633
  * @return object
634
  */
635
 
636
+ public function setSearchResultsQuery( $query ) {
637
  global $woocommerce;
638
 
639
  if ( !$this->is_ajax_search() && $query->is_search ) {
675
  *
676
  * @return object
677
  */
678
+ public function forcePostType($query){
679
 
680
  if($this->is_search_page() || $this->is_ajax_search()){
681
  if($query->is_search){
includes/Integrations/Themes/Storefront.php ADDED
@@ -0,0 +1,61 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ namespace DgoraWcas\Integrations\Themes;
4
+
5
+
6
+ class Storefront
7
+ {
8
+
9
+ public function __construct()
10
+ {
11
+ $this->overwriteFunctions();
12
+
13
+ add_filter('dgwt/wcas/settings/section=basic', array($this, 'registerSettings'));
14
+ }
15
+
16
+ private function overwriteFunctions()
17
+ {
18
+ if ($this->canReplaceSearch()) {
19
+ require_once DGWT_WCAS_DIR . 'partials/storefront.php';
20
+ }
21
+ }
22
+
23
+ public function registerSettings($settings)
24
+ {
25
+
26
+ $settings[] = array(
27
+ 'name' => 'storefront_settings_head',
28
+ 'label' => __('Storefront theme', 'ajax-search-for-woocommerce'),
29
+ 'type' => 'head',
30
+ 'class' => 'dgwt-wcas-sgs-header'
31
+ );
32
+
33
+ $settings[] = array(
34
+ 'name' => 'storefront_replace_search',
35
+ 'label' => __('Replace search form', 'ajax-search-for-woocommerce'),
36
+ 'desc' => __('Replace the Storefront theme\'s default product search with the Ajax Search for WooCommerce form.', 'ajax-search-for-woocommerce'),
37
+ 'type' => 'checkbox',
38
+ 'default' => 'off',
39
+ );
40
+
41
+ return $settings;
42
+ }
43
+
44
+ /**
45
+ * Check if can replace the native Storefront search form
46
+ * by the Ajax Search for WooCommerce form.
47
+ *
48
+ * @return bool
49
+ */
50
+ private function canReplaceSearch()
51
+ {
52
+ $canIntegrate = false;
53
+
54
+ if (DGWT_WCAS()->settings->get_opt('storefront_replace_search', 'off') === 'on') {
55
+ $canIntegrate = true;
56
+ }
57
+
58
+ return $canIntegrate;
59
+ }
60
+
61
+ }
includes/Integrations/Themes/ThemesCompatibility.php ADDED
@@ -0,0 +1,45 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ namespace DgoraWcas\Integrations\Themes;
4
+
5
+ class ThemesCompatibility
6
+ {
7
+ private $themeName = '';
8
+
9
+ public function __construct()
10
+ {
11
+ $this->setCurrentTheme();
12
+
13
+ $this->loadCompatibilities();
14
+ }
15
+
16
+ private function setCurrentTheme()
17
+ {
18
+ $name = '';
19
+
20
+ $theme = wp_get_theme();
21
+
22
+ if (is_object($theme) && is_a($theme, 'WP_Theme')) {
23
+ $name = strtolower($theme->Name);
24
+
25
+ $template = $theme->Template;
26
+ if ( ! empty($template)) {
27
+ $name = $template;
28
+ }
29
+ }
30
+
31
+ $this->themeName = $name;
32
+ }
33
+
34
+ private function loadCompatibilities()
35
+ {
36
+
37
+ switch ($this->themeName) {
38
+ case 'storefront':
39
+ new Storefront;
40
+ break;
41
+ }
42
+
43
+ }
44
+
45
+ }
includes/Integrations/Storefront.php → partials/storefront.php RENAMED
@@ -1,5 +1,10 @@
1
  <?php
2
 
 
 
 
 
 
3
  if ( ! function_exists( 'storefront_product_search' ) ) {
4
  function storefront_product_search() {
5
  if ( storefront_is_woocommerce_activated() ) { ?>
1
  <?php
2
 
3
+ // Exit if accessed directly
4
+ if ( ! defined( 'ABSPATH' ) ) {
5
+ exit;
6
+ }
7
+
8
  if ( ! function_exists( 'storefront_product_search' ) ) {
9
  function storefront_product_search() {
10
  if ( storefront_is_woocommerce_activated() ) { ?>
readme.txt CHANGED
@@ -1,163 +1,171 @@
1
- === Ajax Search for WooCommerce ===
2
- Contributors: damian-gora
3
- Donate link: https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=LD2ALVRLXPZPC
4
- Tags: woocomerce search, ajax search, live search, product search, woocommerce
5
- Requires at least: 3.8
6
- Tested up to: 4.9.8
7
- Requires PHP: 5.5
8
- Stable tag: 1.2.0
9
- License: GPLv2 or later
10
- License URI: http://www.gnu.org/licenses/gpl-2.0.html
11
-
12
- Help users easily find and discover products in your store using Ajax Search for WooCommerce – a highly customizable live search plugin.
13
-
14
- == Description ==
15
-
16
- The plugin allows your customers to search products easily and quickly. It will display the results instantly while typing in an inputbox.
17
- You can display the WooCommerce AJAX search form anywhere on the page.
18
-
19
- Just enter a few letters and the products which best match your query will appear.
20
- Suggestions can be displayed in a simple form (names of the products only) or in an extended form (includes photos, prices, descriptions, extended information etc.).
21
-
22
- Ajax Search for WooCommerce has been designed to enhance user search experience to the maximum.
23
-
24
- = Free =
25
- This plugin is completely free of charge and provides the whole range of functions which are included in some paid plugins.
26
- Initially, I created the plugin for my personal use, but I have decided to include new features and make it available to WordPress community.
27
-
28
- = Demo =
29
- See how it works on the [DEMO](http://damiangora.com/ajax-search-for-woocommerce) site.
30
-
31
-
32
- = Features =
33
- * Search in **products titles, descriptions, excerpt or SKU**.
34
- * **Product image** can be displayed for each suggestion
35
- * **Price** can be displayed for each suggestion
36
- * **Description** can be displayed for each suggestion
37
- * **SKU** can be displayed for each suggestion
38
- * The **'add to cart' button with a quantity field** and **extended information** displayed when you hover the mouse over the suggestion
39
- * **Categories and tags** as suggestions
40
- * **Limit** displayed suggestions – you can set your own
41
- * **The minimum number of characters** required to display suggestions – you can set your own
42
- * WPML compatible
43
- * You can set your own **label on the 'search' button**
44
- * You can set your own **preloader image**
45
- * You can set your own **colour scheme** for the 10 main form elements and suggestions
46
- * **[WP Tao](https://wordpress.org/plugins/wp-tao) integration** - allows you to track and analyze search results of a website users. Each click on the suggestion is logged. Read more on [wptao.org](http://wptao.org/documentation/user-guide/).
47
-
48
- = How to use? =
49
- 1. Use shorcode [wcas-search-form] in page/post editor or <?php echo do_shortcode('[wcas-search-form]'); ?> in your Child Theme template files.
50
- 2. Go to the "Widgets Screen" and assign widget "Woo Ajax Search" to one of the widget area.
51
-
52
- = Feedback =
53
-
54
- Any suggestions or comments are welcome. Feel free to contact me using this [contact form](http://damiangora.com/ajax-search-for-woocommerce/contact).
55
-
56
- == Installation ==
57
-
58
- 1. Install the plugin from within the Dashboard or upload the directory `ajax-search-for-woocommerce` and all its contents to the `/wp-content/plugins/` directory.
59
- 2. Activate the plugin through the 'Plugins' menu in WordPress.
60
- 3. Go to Woo Ajax Search (admin menu) and set your preferences.
61
- 4. Use shorcode [wcas-search-form] or go to the Widgets Screen and choose "Woo Ajax Search"
62
-
63
- == Screenshots ==
64
-
65
- 1. Basic suggestions
66
- 2. Extra elements
67
- 3. Extended suggestions
68
- 4. Settings page with colour schemes
69
-
70
- == Changelog ==
71
-
72
- = 1.2.0, August 24, 2018 =
73
- * ADD: Backward compatibility system
74
- * ADD: Support of image size improvements in Woocommerce 3.3
75
- * ADD: Dynamic width of the search form
76
- * ADD: Option to set max width of the search form
77
- * ADD: DISABLE_NAG_NOTICES support for admin notices
78
- * ADD: More hooks for developers
79
- * ADD: Minified version of CSS and JS
80
- * ADD: Label for taxonomy suggestions
81
- * ADD: Quantity input for a add to cart button in the details box
82
- * FIX: Problem with covering suggestions by other HTML elements of themes.
83
- * FIX: Details box in RTL
84
- * FIX: Improvements for the IE browser
85
- * CHANGE: Code refactor for better future development. Composer and PSR-4 support (in part).
86
- * CHANGE: Better settings organization
87
- * CHANGE: Updated Freemius SDK
88
-
89
-
90
- = 1.1.7, April 22, 2017 =
91
- * FIX: Removed duplicate IDs
92
- * CHANGE: PHP requires tag set to PHP 5.5
93
- * CHANGE: Woocommerce requires tags
94
- * CHANGE: Updated Freemius SDK
95
- * REMOVE: Removed uninstall.php
96
-
97
- = 1.1.6, October 01, 2017 =
98
- * FIX: Disappearing some categories and tags in suggestions
99
- * FIX: Hidden products were shown in search
100
-
101
- = 1.1.5, September 05, 2017 =
102
- * ADD: Requires PHP tag in readme.txt
103
- * FIX: PHP Fatal error for PHP < 5.3
104
-
105
- = 1.1.4, September 03, 2017 =
106
- * ADD: Admin notice if there is no WooCommerce installed
107
- * ADD: Admin notice for better feedback from users
108
- * FIX: Deleting the 'dgwt-wcas-open' class after hiding the suggestion
109
- * FIX: Allows to display HTML entities in suggestions title and description
110
- * FIX: Better synchronizing suggestions and resutls on a search page
111
- * CHANGE: Move menu item to WooCommerce submenu
112
-
113
- = 1.1.3, July 12, 2017 =
114
- * ADD: New WordPress filters
115
- * FIX: Repetitive search results
116
- * FIX: Extra details when there are no results
117
-
118
- = 1.1.2, June 7, 2017 =
119
- * FIX: Replace deprecated methods and functions in WC 3.0.x
120
-
121
- = 1.1.1, June 6, 2017 =
122
- * ADD: Added Portable Object Template file
123
- * ADD: Added partial polish translation
124
- * FIX: WooCommerce 3.0.x compatible
125
- * FIX: Menu items repeated in a search page
126
- * FIX: Other minor bugs
127
-
128
- = 1.1.0, October 5, 2016 =
129
- * NEW: Add WPML compatibility
130
- * FIX: Repeating search results for products in a admin dashboard
131
- * FIX: Overwrite default input element rounding for Safari browser
132
-
133
- = 1.0.3.1, July 24, 2016 =
134
- * FIX: Disappearing widgets
135
- * FIX: Trivial things in CSS
136
-
137
- = 1.0.3, July 22, 2016 =
138
- * FIX: Synchronization WP Query on a search page and ajax search query
139
- * CHANGE: Disable auto select the first suggestion
140
- * CHANGE: Change textdomain to ajax-search-for-woocommerce
141
-
142
- = 1.0.2, June 30, 2016 =
143
- * FIX: PHP syntax error with PHP version < 5.3
144
-
145
- = 1.0.1, June 30, 2016 =
146
- * FIX: Excess AJAX requests in a detail mode
147
- * FIX: Optimization JS mouseover event in a detail mode
148
- * FIX: Trivial things in CSS
149
-
150
- = 1.0.0, June 24, 2016 =
151
- * ADD: [Option] Exclude out of stock products from suggestions
152
- * ADD: [Option] Overwrite a suggestion container width
153
- * ADD: [Option] Show/hide SKU in suggestions
154
- * ADD: Add no results note
155
- * FIX: Search in products SKU
156
- * FIX: Trivial things in CSS and JS files
157
-
158
- = 0.9.1, June 5, 2016 =
159
- * ADD: Javascript and CSS dynamic compression
160
- * FIX: Incorrect dimensions of the custom preloader
161
-
162
- = 0.9.0, May 17, 2016 =
163
- * ADD: First public release
 
 
 
 
 
 
 
 
1
+ === Ajax Search for WooCommerce ===
2
+ Contributors: damian-gora
3
+ Donate link: https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=LD2ALVRLXPZPC
4
+ Tags: woocomerce search, ajax search, live search, product search, woocommerce
5
+ Requires at least: 3.8
6
+ Tested up to: 4.9.8
7
+ Requires PHP: 5.5
8
+ Stable tag: 1.2.1
9
+ License: GPLv2 or later
10
+ License URI: http://www.gnu.org/licenses/gpl-2.0.html
11
+
12
+ Help users easily find and discover products in your store using Ajax Search for WooCommerce – a highly customizable live search plugin.
13
+
14
+ == Description ==
15
+
16
+ The plugin allows your customers to search products easily and quickly. It will display the results instantly while typing in an inputbox.
17
+ You can display the WooCommerce AJAX search form anywhere on the page.
18
+
19
+ Just enter a few letters and the products which best match your query will appear.
20
+ Suggestions can be displayed in a simple form (names of the products only) or in an extended form (includes photos, prices, descriptions, extended information etc.).
21
+
22
+ Ajax Search for WooCommerce has been designed to enhance user search experience to the maximum.
23
+
24
+ = Free =
25
+ This plugin is completely free of charge and provides the whole range of functions which are included in some paid plugins.
26
+ Initially, I created the plugin for my personal use, but I have decided to include new features and make it available to WordPress community.
27
+
28
+ = Demo =
29
+ See how it works on the [DEMO](http://damiangora.com/ajax-search-for-woocommerce) site.
30
+
31
+
32
+ = Features =
33
+ * Search in **products titles, descriptions, excerpt or SKU**.
34
+ * **Product image** can be displayed for each suggestion
35
+ * **Price** can be displayed for each suggestion
36
+ * **Description** can be displayed for each suggestion
37
+ * **SKU** can be displayed for each suggestion
38
+ * The **'add to cart' button with a quantity field** and **extended information** displayed when you hover the mouse over the suggestion
39
+ * **Categories and tags** as suggestions
40
+ * **Limit** displayed suggestions – you can set your own
41
+ * **The minimum number of characters** required to display suggestions – you can set your own
42
+ * WPML compatible
43
+ * You can set your own **label on the 'search' button**
44
+ * You can set your own **preloader image**
45
+ * You can set your own **colour scheme** for the 10 main form elements and suggestions
46
+ * **[WP Tao](https://wordpress.org/plugins/wp-tao) integration** - allows you to track and analyze search results of a website users. Each click on the suggestion is logged. Read more on [wptao.org](http://wptao.org/documentation/user-guide/).
47
+
48
+ = How to use? =
49
+ 1. Use shorcode [wcas-search-form] in page/post editor or <?php echo do_shortcode('[wcas-search-form]'); ?> in your Child Theme template files.
50
+ 2. Go to the "Widgets Screen" and assign widget "Woo Ajax Search" to one of the widget area.
51
+
52
+ = Feedback =
53
+
54
+ Any suggestions or comments are welcome. Feel free to contact me using this [contact form](http://damiangora.com/ajax-search-for-woocommerce/contact).
55
+
56
+ == Installation ==
57
+
58
+ 1. Install the plugin from within the Dashboard or upload the directory `ajax-search-for-woocommerce` and all its contents to the `/wp-content/plugins/` directory.
59
+ 2. Activate the plugin through the 'Plugins' menu in WordPress.
60
+ 3. Go to Woo Ajax Search (admin menu) and set your preferences.
61
+ 4. Use shorcode [wcas-search-form] or go to the Widgets Screen and choose "Woo Ajax Search"
62
+
63
+ == Screenshots ==
64
+
65
+ 1. Basic suggestions
66
+ 2. Extra elements
67
+ 3. Extended suggestions
68
+ 4. Settings page with colour schemes
69
+
70
+ == Changelog ==
71
+
72
+ = 1.2.1, October 26, 2018 =
73
+ * ADD: Storefront support as a option. Allows to replace the native Storefront search form
74
+ * FIX: Improving the relevance of search results by adding score system
75
+ * FIX: Problem with too big images is some cases
76
+ * FIX: Support for HTML entities in the search results
77
+ * FIX: Bugs with the blur event on mobile devices
78
+
79
+
80
+ = 1.2.0, August 24, 2018 =
81
+ * ADD: Backward compatibility system
82
+ * ADD: Support of image size improvements in Woocommerce 3.3
83
+ * ADD: Dynamic width of the search form
84
+ * ADD: Option to set max width of the search form
85
+ * ADD: DISABLE_NAG_NOTICES support for admin notices
86
+ * ADD: More hooks for developers
87
+ * ADD: Minified version of CSS and JS
88
+ * ADD: Label for taxonomy suggestions
89
+ * ADD: Quantity input for a add to cart button in the details box
90
+ * FIX: Problem with covering suggestions by other HTML elements of themes.
91
+ * FIX: Details box in RTL
92
+ * FIX: Improvements for the IE browser
93
+ * CHANGE: Code refactor for better future development. Composer and PSR-4 support (in part).
94
+ * CHANGE: Better settings organization
95
+ * CHANGE: Updated Freemius SDK
96
+
97
+
98
+ = 1.1.7, April 22, 2017 =
99
+ * FIX: Removed duplicate IDs
100
+ * CHANGE: PHP requires tag set to PHP 5.5
101
+ * CHANGE: Woocommerce requires tags
102
+ * CHANGE: Updated Freemius SDK
103
+ * REMOVE: Removed uninstall.php
104
+
105
+ = 1.1.6, October 01, 2017 =
106
+ * FIX: Disappearing some categories and tags in suggestions
107
+ * FIX: Hidden products were shown in search
108
+
109
+ = 1.1.5, September 05, 2017 =
110
+ * ADD: Requires PHP tag in readme.txt
111
+ * FIX: PHP Fatal error for PHP < 5.3
112
+
113
+ = 1.1.4, September 03, 2017 =
114
+ * ADD: Admin notice if there is no WooCommerce installed
115
+ * ADD: Admin notice for better feedback from users
116
+ * FIX: Deleting the 'dgwt-wcas-open' class after hiding the suggestion
117
+ * FIX: Allows to display HTML entities in suggestions title and description
118
+ * FIX: Better synchronizing suggestions and resutls on a search page
119
+ * CHANGE: Move menu item to WooCommerce submenu
120
+
121
+ = 1.1.3, July 12, 2017 =
122
+ * ADD: New WordPress filters
123
+ * FIX: Repetitive search results
124
+ * FIX: Extra details when there are no results
125
+
126
+ = 1.1.2, June 7, 2017 =
127
+ * FIX: Replace deprecated methods and functions in WC 3.0.x
128
+
129
+ = 1.1.1, June 6, 2017 =
130
+ * ADD: Added Portable Object Template file
131
+ * ADD: Added partial polish translation
132
+ * FIX: WooCommerce 3.0.x compatible
133
+ * FIX: Menu items repeated in a search page
134
+ * FIX: Other minor bugs
135
+
136
+ = 1.1.0, October 5, 2016 =
137
+ * NEW: Add WPML compatibility
138
+ * FIX: Repeating search results for products in a admin dashboard
139
+ * FIX: Overwrite default input element rounding for Safari browser
140
+
141
+ = 1.0.3.1, July 24, 2016 =
142
+ * FIX: Disappearing widgets
143
+ * FIX: Trivial things in CSS
144
+
145
+ = 1.0.3, July 22, 2016 =
146
+ * FIX: Synchronization WP Query on a search page and ajax search query
147
+ * CHANGE: Disable auto select the first suggestion
148
+ * CHANGE: Change textdomain to ajax-search-for-woocommerce
149
+
150
+ = 1.0.2, June 30, 2016 =
151
+ * FIX: PHP syntax error with PHP version < 5.3
152
+
153
+ = 1.0.1, June 30, 2016 =
154
+ * FIX: Excess AJAX requests in a detail mode
155
+ * FIX: Optimization JS mouseover event in a detail mode
156
+ * FIX: Trivial things in CSS
157
+
158
+ = 1.0.0, June 24, 2016 =
159
+ * ADD: [Option] Exclude out of stock products from suggestions
160
+ * ADD: [Option] Overwrite a suggestion container width
161
+ * ADD: [Option] Show/hide SKU in suggestions
162
+ * ADD: Add no results note
163
+ * FIX: Search in products SKU
164
+ * FIX: Trivial things in CSS and JS files
165
+
166
+ = 0.9.1, June 5, 2016 =
167
+ * ADD: Javascript and CSS dynamic compression
168
+ * FIX: Incorrect dimensions of the custom preloader
169
+
170
+ = 0.9.0, May 17, 2016 =
171
+ * ADD: First public release