Version Description
Download this release
Release Info
Developer | damian-gora |
Plugin | Ajax Search for WooCommerce |
Version | 1.6.3 |
Comparing to | |
See all releases |
Code changes from version 1.6.2 to 1.6.3
- ajax-search-for-woocommerce.php +2 -2
- assets/css/style.css +15 -0
- assets/css/style.min.css +1 -1
- assets/js/search.js +308 -204
- assets/js/search.min.js +1 -1
- includes/Admin/RegenerateImages.php +132 -9
- includes/Engines/WordPressNative/DetailsBox.php +16 -15
- includes/Helpers.php +1 -1
- includes/Integrations/Brands.php +9 -2
- includes/Multilingual.php +90 -2
- includes/Personalization.php +4 -0
- includes/Product.php +71 -7
- partials/details-panel/product.php +4 -0
- partials/search-form.php +9 -8
- readme.txt +14 -3
ajax-search-for-woocommerce.php
CHANGED
@@ -4,13 +4,13 @@
|
|
4 |
* Plugin Name: AJAX Search for WooCommerce
|
5 |
* Plugin URI: https://ajaxsearch.pro?utm_source=wp-admin&utm_medium=referral&utm_campaign=author_uri&utm_gen=utmdc
|
6 |
* Description: The most popular WooCommerce product search. Gives your users a well-designed advanced AJAX search bar with live search suggestions.
|
7 |
-
* Version: 1.6.
|
8 |
* Author: Damian Góra
|
9 |
* Author URI: https://ajaxsearch.pro?utm_source=wp-admin&utm_medium=referral&utm_campaign=author_uri&utm_gen=utmdc
|
10 |
* Text Domain: ajax-search-for-woocommerce
|
11 |
* Domain Path: /languages
|
12 |
* WC requires at least: 3.3
|
13 |
-
* WC tested up to:
|
14 |
*
|
15 |
*/
|
16 |
// Exit if accessed directly
|
4 |
* Plugin Name: AJAX Search for WooCommerce
|
5 |
* Plugin URI: https://ajaxsearch.pro?utm_source=wp-admin&utm_medium=referral&utm_campaign=author_uri&utm_gen=utmdc
|
6 |
* Description: The most popular WooCommerce product search. Gives your users a well-designed advanced AJAX search bar with live search suggestions.
|
7 |
+
* Version: 1.6.3
|
8 |
* Author: Damian Góra
|
9 |
* Author URI: https://ajaxsearch.pro?utm_source=wp-admin&utm_medium=referral&utm_campaign=author_uri&utm_gen=utmdc
|
10 |
* Text Domain: ajax-search-for-woocommerce
|
11 |
* Domain Path: /languages
|
12 |
* WC requires at least: 3.3
|
13 |
+
* WC tested up to: 4.0
|
14 |
*
|
15 |
*/
|
16 |
// Exit if accessed directly
|
assets/css/style.css
CHANGED
@@ -701,6 +701,21 @@ input[type="text"].dgwt-cas-search-input {
|
|
701 |
margin-top: 0;
|
702 |
}
|
703 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
704 |
|
705 |
.dgwt-wcas-pd-addtc .add_to_cart_inline,
|
706 |
.dgwt-wcas-pd-addtc .add_to_cart_button {
|
701 |
margin-top: 0;
|
702 |
}
|
703 |
|
704 |
+
.dgwt-wcas-stock {
|
705 |
+
display: block;
|
706 |
+
text-align: right;
|
707 |
+
font-size: 14px;
|
708 |
+
line-height: 14px;
|
709 |
+
margin-bottom: 14px;
|
710 |
+
|
711 |
+
}
|
712 |
+
.dgwt-wcas-stock.in-stock {
|
713 |
+
color: #0f834d;
|
714 |
+
}
|
715 |
+
|
716 |
+
.dgwt-wcas-stock.out-of-stock {
|
717 |
+
color: #e2401c;
|
718 |
+
}
|
719 |
|
720 |
.dgwt-wcas-pd-addtc .add_to_cart_inline,
|
721 |
.dgwt-wcas-pd-addtc .add_to_cart_button {
|
assets/css/style.min.css
CHANGED
@@ -1 +1 @@
|
|
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;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box}.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-preloader-wrapp img{margin:10px auto 0 auto;display:block;max-width:200px}.dgwt-wcas-preloader-wrapp img.dgwt-wcas-placeholder-preloader{display:block;width:100%;height:auto;max-width:300px;margin:0}.dgwt-wcas-suggestions-wrapp{background:#fff none repeat scroll 0 0;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-details-wrapp a:focus,.dgwt-wcas-suggestions-wrapp a:focus{outline:0}.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 0;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 10px;position:relative;border-bottom:1px solid #dfdfdf;display:flex;flex-direction:row;justify-content:space-between;align-items:center;resize:vertical}.dgwt-wcas-suggestion.dgwt-wcas-suggestion-more{justify-content:center;color:#6d6d6d}a.dgwt-wcas-details-more-products{padding:15px 0 10px 0;display:block;border-top:1px solid #eee;text-align:center;font-size:12px;text-transform:uppercase;color:#6d6d6d;transition:all .2s ease-in-out}a.dgwt-wcas-details-more-products:hover{text-decoration:underline}a.dgwt-wcas-product-details-readmore{display:block;text-align:right;margin-top:15px;color:#6d6d6d;text-transform:uppercase;letter-spacing:1px;font-weight:400;font-size:12px}a.dgwt-wcas-product-details-readmore:hover{text-decoration:underline}.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-top:8px;padding-bottom:8px;min-height:60px}.dgwt-wcas-is-details .dgwt-wcas-has-img .dgwt-wcas-suggestion.dgwt-wcas-suggestion-more,.dgwt-wcas-suggestion.dgwt-wcas-suggestion-more{min-height:30px;text-transform:uppercase}.dgwt-wcas-suggestion.dgwt-wcas-suggestion-more .dgwt-wcas-st-more{padding:0 10px;text-align:center}.dgwt-wcas-st{display:block;color:#444;font-size:15px;width:100%;line-height:110%}.dgwt-wcas-st>span{display:inline-block;vertical-align:middle}.dgwt-wcas-has-sku .dgwt-wcas-st-title{margin-right:6px}.dgwt-wcas-st>span.dgwt-wcas-st--direct-headline{display:block;font-style:italic;font-size:10px;text-transform:uppercase;opacity:.4;line-height:10px;margin-bottom:1px;letter-spacing:2px}.dgwt-wcas-st-breadcrumbs{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-size:80%;text-align:left;opacity:.6;width:100%;padding-right:10px}.rtl .dgwt-wcas-st-breadcrumbs{padding-right:0;padding-left:10px;text-align:right}.dgwt-wcas-sku{font-size:80%}.dgwt-wcas-si{width:50px;display:block;height:100%}.dgwt-wcas-si img{background:#fff none repeat scroll 0 0;border:1px solid #e8e8e8;border-radius:3px;display:block;margin:auto;padding:2px;height:auto;width:auto;max-height:90%;max-width:100%}.dgwt-wcas-content-wrapp{display:flex;height:100%;width:100%;justify-content:space-between;align-items:center;resize:vertical;padding-left:10px}.rtl .dgwt-wcas-content-wrapp{padding-left:0;padding-right:10px}.dgwt-wcas-sp{color:#555;font-size:14px;line-height:120%;text-align:right;line-height:4px;padding-left:10px}.dgwt-wcas-sp *{line-height:130%}.dgwt-wcas-search-form{margin:0;padding:0}.dgwt-wcas-sp del{opacity:.5;font-size:12px}.dgwt-wcas-sd{color:#777;display:block;line-height:14px;width:100%;margin-top:5px;font-size:.8em}.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 none repeat scroll 0 0;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{margin-top:-1px;border-top:1px solid #ddd}.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{border-radius:0 0 5px 0}.rtl.dgwt-wcas-full-width .dgwt-wcas-suggestions-wrapp{border-radius:0 0 5px 0}.rtl.dgwt-wcas-full-width .dgwt-wcas-details-wrapp{border-radius:0 0 0 5px}.dgwt-wcas-details-inner-taxonomy{margin-top:11px}.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{border-bottom:1px dashed #eee;display:block;margin-bottom:15px;padding-bottom:5px;font-size:14px}.dgwt-wcas-pd-title{border-bottom:1px dashed #eee;margin-bottom:15px;padding-bottom:5px;display:block;color:#202020;text-decoration:none}.dgwt-wcas-pd-title .product-title{font-weight:900;color:#202020;text-transform:uppercase;letter-spacing:-1px;margin:0}.dgwt-wcas-details-title-tax{text-transform:uppercase;font-weight:900;letter-spacing:-1px;margin-right:3px}.dgwt-wcas-tax-product-details{text-decoration:none;display:flex;align-items:center;justify-content:left;transition:all .2s ease-in-out;padding:5px;margin:0 -5px 15px -5px}.dgwt-wcas-tax-product-details:after{content:'';clear:both;display:block}.dgwt-wcas-tax-product-details:hover{box-shadow:0 0 11px 2px rgba(0,0,0,.05)}.dgwt-wcas-details-wrapp .dgwt-wcas-pd-title{margin-bottom:8px}.dgwt-wcas-tpd-image{width:60px;margin-right:15px}.dgwt-wcas-pd-rest .product-title{display:block;line-height:100%;font-weight:500;margin-bottom:5px}.dgwt-wcas-tpd-rest{max-width:200px}.dgwt-wcas-tpd-rest-title{display:block;line-height:125%;font-size:14px;font-weight:500;letter-spacing:0;margin:0 0 8px;overflow:hidden;color:#000}.dgwt-wcas-suggestion-nores{pointer-events:none;opacity:.45}.dgwt-wcas-pd-price,.dgwt-wcas-tpd-price{font-size:14px;line-height:120%;overflow:hidden;color:#000;margin-top:15px;font-weight:700;font-size:18px}.dgwt-wcas-tpd-price{font-size:12px;color:#777}.dgwt-wcas-pd-price .woocommerce-price-suffix,.dgwt-wcas-tpd-price .woocommerce-price-suffix{font-size:12px;font-weight:lighter;color:#999;margin-left:4px;display:inline-block}.dgwt-wcas-pd-price del .amount,.dgwt-wcas-tpd-price del .amount{font-weight:lighter;background:0 0;font-size:90%;opacity:.6}.dgwt-wcas-pd-price ins,.dgwt-wcas-tpd-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{border-bottom:1px dashed #eee;display:block;margin:5px 0 15px 0;padding-bottom:5px}.dgwt-wcas-pd-title{border-bottom:1px dashed #eee;margin-bottom:15px;padding-bottom:5px;display:block;text-decoration:none}.dgwt-wcas-pd-title .product-title{font-weight:900;text-transform:uppercase;letter-spacing:-1px}.dgwt-wcas-details-title-tax{text-transform:uppercase;font-weight:900;letter-spacing:-1px;margin-right:3px}.rtl .dgwt-wcas-details-title-tax{margin:0 0 0 3px;float:right}.dgwt-wcas-tpd-image{width:70px;padding:4px;background-color:#fff;border:1px solid #e8e8e8;border-radius:4px;display:flex;flex-direction:column;justify-content:center}.dgwt-wcas-details-space{padding:0 15px 15px 15px}.dgwt-wcas-details-main-image{border-bottom:1px solid #eee;min-height:200px;display:flex}.dgwt-wcas-details-main-image img{width:auto;height:auto;display:block;max-height:250px;max-width:100%;margin:0 auto;padding:0;border:none;align-self:center}.dgwt-wcas-details-right .dgwt-wcas-details-main-image img{border-radius:0 3px 0 0}.dgwt-wcas-details-left .dgwt-wcas-details-main-image img{border-radius:3px 0 0 0}a.dgwt-wcas-details-post-title,a.dgwt-wcas-details-product-title{color:#333;display:block;line-height:120%;margin:10px 0 0 0;font-size:21px;font-weight:400;text-decoration:none;text-transform:none}a.dgwt-wcas-details-post-title:hover,a.dgwt-wcas-details-product-title:hover{text-decoration:underline}a.dgwt-wcas-details-post-title{margin-bottom:15px}.dgwt-wcas-details-product-sku{display:block;font-size:12px;line-height:110%;color:#999}.dgwt-wcas-tpd-image img{display:block;max-width:100%;width:100%;height:auto}.dgwt-wcas-details-hr{height:1px;width:100%;border-bottom:1px solid #eee;margin:15px 0}.rtl .dgwt-wcas-tpd-image{float:right;margin-right:0;margin-left:15px}.rtl .dgwt-wcas-tpd-rest{float:right;max-width:190px}.rtl input[type=search].dgwt-wcas-search-input{text-align:right}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;-webkit-appearance:textfield;text-align:left}[type=search].dgwt-wcas-search-input::-ms-clear{display:none}[type=search].dgwt-wcas-search-input::-webkit-search-decoration{-webkit-appearance:none}[type=search].dgwt-wcas-search-input::-webkit-search-cancel-button{display:none}.dgwt-wcas-details-desc{font-size:13px;line-height:157%}.dgwt-wcas-details-desc b,.dgwt-wcas-details-desc strong{font-weight:400;color:#000;margin:0;padding:0}.dgwt-wcas-pd-addtc-form{margin:10px 0;display:flex;align-items:center;justify-content:flex-end}.dgwt-wcas-pd-addtc-form>.quantity{margin-right:10px}.dgwt-wcas-pd-addtc-form .add_to_cart_inline,.dgwt-wcas-pd-addtc-form .quantity input.qty{margin-bottom:0;margin-top:0}.dgwt-wcas-pd-addtc .add_to_cart_button,.dgwt-wcas-pd-addtc .add_to_cart_inline{margin:0}.dgwt-wcas-pd-addtc .add_to_cart_button.added{display:none}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}.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:5px}.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;margin:0;background:#fff;border:1px solid #ddd;border-radius:3px;-webkit-border-radius:3px;-webkit-appearance:none;box-sizing:border-box}.dgwt-wcas-open .dgwt-wcas-sf-wrapp input[type=search].dgwt-wcas-search-input{border-radius:3px 3px 0 0}.dgwt-wcas-open.dgwt-wcas-nores.dgwt-wcas-details-outside .dgwt-wcas-details-wrapp{display:none!important}.dgwt-wcas-open.dgwt-wcas-nores.dgwt-wcas-details-outside .dgwt-wcas-suggestions-wrapp{min-height:0!important;border-radius:0 0 5px 5px;border-right-color:#ddd}.dgwt-wcas-open.dgwt-wcas-nores.dgwt-wcas-full-width .dgwt-wcas-details-wrapp,.dgwt-wcas-open.dgwt-wcas-nores.dgwt-wcas-full-width .dgwt-wcas-suggestions-wrapp{min-height:41px!important}.dgwt-wcas-open.dgwt-wcas-nores.dgwt-wcas-full-width:not(.rtl):not(.dgwt-wcas-details-outside) .dgwt-wcas-suggestions-wrapp{border-right-color:transparent}.dgwt-wcas-open.dgwt-wcas-nores .dgwt-wcas-details-wrapp .dgwt-wcas-preloader-wrapp{display:none!important}.dgwt-wcas-open.dgwt-wcas-nores.dgwt-wcas-is-details:not(.dgwt-wcas-details-outside) .dgwt-wcas-suggestion-nores{margin-top:5px}.rtl.dgwt-wcas-open.dgwt-wcas-nores.dgwt-wcas-full-width:not(.dgwt-wcas-details-outside) .dgwt-wcas-suggestions-wrapp{border-left-color:transparent}.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::placeholder{color:#999;font-weight:400;font-style:italic;line-height:normal}.dgwt-wcas-sf-wrapp input[type=search].dgwt-wcas-search-input::-webkit-input-placeholder{color:#999;font-weight:400;font-style:italic;line-height:normal}.dgwt-wcas-sf-wrapp input[type=search].dgwt-wcas-search-input:-moz-placeholder{color:#999;font-weight:400;font-style:italic;line-height:normal}.dgwt-wcas-sf-wrapp input[type=search].dgwt-wcas-search-input::-moz-placeholder{color:#999;font-weight:400;font-style:italic;line-height:normal}.dgwt-wcas-sf-wrapp input[type=search].dgwt-wcas-search-input:-ms-input-placeholder{color:#999;font-weight:400;font-style:italic;line-height:normal}.dgwt-wcas-sf-wrapp button.dgwt-wcas-search-submit{overflow:visible;position:absolute;border:0;padding:0;margin:0;cursor:pointer;height:40px;min-width:50px;right:0;left:auto;top:0;bottom:auto;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:#333;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 #333 transparent;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:hover:before{border-right-color:#333}.dgwt-wcas-sf-wrapp .dgwt-wcas-search-submit:active:before,.dgwt-wcas-sf-wrapp .dgwt-wcas-search-submit:focus:before{border-right-color:#333}.dgwt-wcas-sf-wrapp .dgwt-wcas-search-submit::-moz-focus-inner{border:0;padding:0}.dgwt-wcas-ico-magnifier{fill:#fff}.dgwt-wcas-details-wrapp .added_to_cart{display:block}.dgwt-wcas-has-desc .dgwt-wcas-sp>*,.dgwt-wcas-has-img .dgwt-wcas-sp>*{display:block}.dgwt-wcas-is-details .dgwt-wcas-suggestions-wrapp{min-height:340px}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.dgwt-wcas-suggestion-product{min-height:40px}.dgwt-wcas-is-details .dgwt-wcas-suggestions-wrapp{overflow:visible}.dgwt-wcas-is-details .dgwt-wcas-si{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}.rtl .dgwt-wcas-no-submit .dgwt-wcas-ico-magnifier{left:auto;right:12px}.dgwt-wcas-no-submit .dgwt-wcas-sf-wrapp input[type=search].dgwt-wcas-search-input{padding:10px 15px 10px 40px}.rtl .dgwt-wcas-no-submit .dgwt-wcas-sf-wrapp input[type=search].dgwt-wcas-search-input{padding:10px 40px 10px 15px}.dgwt-wcas-overlay-mobile-on,.dgwt-wcas-overlay-mobile-on body{overflow:hidden}.dgwt-wcas-om-bar{display:flex;height:45px;width:100%}.dgwt-wcas-om-bar .dgwt-wcas-om-return{width:45px;height:100%;display:block;background:#ccc;cursor:pointer;position:relative}.dgwt-wcas-om-bar .dgwt-wcas-om-return svg{width:23px;height:23px;position:absolute;left:12px;top:12px}.rtl .dgwt-wcas-om-bar .dgwt-wcas-om-return svg{left:11px;top:9px;-moz-transform:rotate(180deg);-webkit-transform:rotate(180deg);-o-transform:rotate(180deg);-ms-transform:rotate(180deg);transform:rotate(180deg)}.dgwt-wcas-om-bar .dgwt-wcas-has-submit-off .dgwt-wcas-preloader{right:0!important}.rtl .dgwt-wcas-om-bar .dgwt-wcas-has-submit-off .dgwt-wcas-preloader{left:4px!important;right:auto!important}.dgwt-wcas-om-bar .dgwt-wcas-sf-wrapp button.dgwt-wcas-search-submit{display:none}.dgwt-wcas-om-bar .dgwt-wcas-search-wrapp-mobile{width:calc(100% - 45px);max-width:none}.dgwt-wcas-overlay-mobile{position:absolute;left:0;right:0;top:0;bottom:0;width:100%;background:#fff}.dgwt-wcas-overlay-mobile *{box-sizing:border-box}.dgwt-wcas-search-wrapp-mobile input[type=search].dgwt-wcas-search-input{height:45px!important;border-top:none;border-right:none;border-left:none;border-radius:0;font-size:16px!important}.dgwt-wcas-search-wrapp-mobile input[type=search].dgwt-wcas-search-input:focus{font-size:16px!important}.dgwt-wcas-overlay-mobile-on .dgwt-wcas-suggestions-wrapp{left:0!important;top:45px!important;width:100%!important;height:calc(100% - 45px)!important;position:absolute;overflow-y:auto;border:none}.dgwt-wcas-overlay-mobile-on .dgwt-wcas-enable-mobile-form{display:none}.dgwt-wcas-enable-mobile-form{position:absolute;z-index:100;left:0;top:0;width:100%;height:100%;cursor:pointer}html:not(.dgwt-wcas-overlay-mobile-on) .dgwt-wcas-icon-mobile .dgwt-wcas-search-form{display:none;position:relative}html:not(.dgwt-wcas-overlay-mobile-on) .dgwt-wcas-search-wrapp.dgwt-wcas-icon-mobile{min-width:0;display:inline-block;width:28px;height:28px}html:not(.dgwt-wcas-overlay-mobile-on) .dgwt-wcas-icon-handler{height:100%;width:100%}html:not(.dgwt-wcas-overlay-mobile-on) .dgwt-wcas-icon-handler .dgwt-wcas-ico-magnifier{opacity:1;position:static;max-width:none;max-height:none}.dgwt-wcas-overlay-mobile-on .dgwt-wcas-icon-handler{display:none}.dgwt-wcas-overlay-mobile-on body.dgwt-wcas-is-ios .dgwt-wcas-suggestions-wrapp{height:calc(100% - 45px)!important}.dgwt-wcas-overlay-mobile-on body.dgwt-wcas-is-ios{overflow:visible;overflow-x:hidden}.dgwt-wcas-overlay-mobile-on body.dgwt-wcas-is-ios .dgwt-wcas-suggestions-wrapp{max-height:none!important;height:auto!important}.dgwt-wcas-overlay-mobile-on body.dgwt-wcas-is-ios:not(.dgwt-wcas-theme-flatsome)>:not(.dgwt-wcas-overlay-mobile){display:none}body .dgwt-wcas-content-wrapp .rood,body .dgwt-wcas-content-wrapp .zwave{display:none}.dgwt-wcas-has-headings .dgwt-wcas-suggestion{border-bottom:none}.dgwt-wcas-has-headings .dgwt-wcas-st>span.dgwt-wcas-st--direct-headline{display:none}.dgwt-wcas-has-headings .dgwt-wcas-suggestion-headline{pointer-events:none;display:block;font-weight:500;white-space:nowrap}.dgwt-wcas-has-headings .dgwt-wcas-suggestion-headline .dgwt-wcas-st{border-bottom:1px solid #ddd;padding-bottom:3px;text-transform:uppercase;margin-top:16px;font-size:12px}.dgwt-wcas-has-headings .dgwt-wcas-suggestion.dgwt-wcas-suggestion-headline,.dgwt-wcas-has-headings .dgwt-wcas-suggestion.dgwt-wcas-suggestion-tax{border-bottom:none}.dgwt-wcas-has-headings .dgwt-wcas-suggestion-tax .dgwt-wcas-st{padding:0}.dgwt-wcas-has-headings .dgwt-wcas-suggestion.dgwt-wcas-suggestion-tax.dgwt-wcas-suggestion-selected,.dgwt-wcas-has-headings .dgwt-wcas-suggestion.dgwt-wcas-suggestion-tax:hover{background:0 0;text-decoration:underline}.dgwt-wcas-is-details .dgwt-wcas-has-headings .dgwt-wcas-suggestion.dgwt-wcas-suggestion-tax{min-height:30px}
|
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;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box}.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-preloader-wrapp img{margin:10px auto 0 auto;display:block;max-width:200px}.dgwt-wcas-preloader-wrapp img.dgwt-wcas-placeholder-preloader{display:block;width:100%;height:auto;max-width:300px;margin:0}.dgwt-wcas-suggestions-wrapp{background:#fff none repeat scroll 0 0;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-details-wrapp a:focus,.dgwt-wcas-suggestions-wrapp a:focus{outline:0}.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 0;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 10px;position:relative;border-bottom:1px solid #dfdfdf;display:flex;flex-direction:row;justify-content:space-between;align-items:center;resize:vertical}.dgwt-wcas-suggestion.dgwt-wcas-suggestion-more{justify-content:center;color:#6d6d6d}a.dgwt-wcas-details-more-products{padding:15px 0 10px 0;display:block;border-top:1px solid #eee;text-align:center;font-size:12px;text-transform:uppercase;color:#6d6d6d;transition:all .2s ease-in-out}a.dgwt-wcas-details-more-products:hover{text-decoration:underline}a.dgwt-wcas-product-details-readmore{display:block;text-align:right;margin-top:15px;color:#6d6d6d;text-transform:uppercase;letter-spacing:1px;font-weight:400;font-size:12px}a.dgwt-wcas-product-details-readmore:hover{text-decoration:underline}.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-top:8px;padding-bottom:8px;min-height:60px}.dgwt-wcas-is-details .dgwt-wcas-has-img .dgwt-wcas-suggestion.dgwt-wcas-suggestion-more,.dgwt-wcas-suggestion.dgwt-wcas-suggestion-more{min-height:30px;text-transform:uppercase}.dgwt-wcas-suggestion.dgwt-wcas-suggestion-more .dgwt-wcas-st-more{padding:0 10px;text-align:center}.dgwt-wcas-st{display:block;color:#444;font-size:15px;width:100%;line-height:110%}.dgwt-wcas-st>span{display:inline-block;vertical-align:middle}.dgwt-wcas-has-sku .dgwt-wcas-st-title{margin-right:6px}.dgwt-wcas-st>span.dgwt-wcas-st--direct-headline{display:block;font-style:italic;font-size:10px;text-transform:uppercase;opacity:.4;line-height:10px;margin-bottom:1px;letter-spacing:2px}.dgwt-wcas-st-breadcrumbs{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-size:80%;text-align:left;opacity:.6;width:100%;padding-right:10px}.rtl .dgwt-wcas-st-breadcrumbs{padding-right:0;padding-left:10px;text-align:right}.dgwt-wcas-sku{font-size:80%}.dgwt-wcas-si{width:50px;display:block;height:100%}.dgwt-wcas-si img{background:#fff none repeat scroll 0 0;border:1px solid #e8e8e8;border-radius:3px;display:block;margin:auto;padding:2px;height:auto;width:auto;max-height:90%;max-width:100%}.dgwt-wcas-content-wrapp{display:flex;height:100%;width:100%;justify-content:space-between;align-items:center;resize:vertical;padding-left:10px}.rtl .dgwt-wcas-content-wrapp{padding-left:0;padding-right:10px}.dgwt-wcas-sp{color:#555;font-size:14px;line-height:120%;text-align:right;line-height:4px;padding-left:10px}.dgwt-wcas-sp *{line-height:130%}.dgwt-wcas-search-form{margin:0;padding:0}.dgwt-wcas-sp del{opacity:.5;font-size:12px}.dgwt-wcas-sd{color:#777;display:block;line-height:14px;width:100%;margin-top:5px;font-size:.8em}.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 none repeat scroll 0 0;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{margin-top:-1px;border-top:1px solid #ddd}.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{border-radius:0 0 5px 0}.rtl.dgwt-wcas-full-width .dgwt-wcas-suggestions-wrapp{border-radius:0 0 5px 0}.rtl.dgwt-wcas-full-width .dgwt-wcas-details-wrapp{border-radius:0 0 0 5px}.dgwt-wcas-details-inner-taxonomy{margin-top:11px}.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{border-bottom:1px dashed #eee;display:block;margin-bottom:15px;padding-bottom:5px;font-size:14px}.dgwt-wcas-pd-title{border-bottom:1px dashed #eee;margin-bottom:15px;padding-bottom:5px;display:block;color:#202020;text-decoration:none}.dgwt-wcas-pd-title .product-title{font-weight:900;color:#202020;text-transform:uppercase;letter-spacing:-1px;margin:0}.dgwt-wcas-details-title-tax{text-transform:uppercase;font-weight:900;letter-spacing:-1px;margin-right:3px}.dgwt-wcas-tax-product-details{text-decoration:none;display:flex;align-items:center;justify-content:left;transition:all .2s ease-in-out;padding:5px;margin:0 -5px 15px -5px}.dgwt-wcas-tax-product-details:after{content:'';clear:both;display:block}.dgwt-wcas-tax-product-details:hover{box-shadow:0 0 11px 2px rgba(0,0,0,.05)}.dgwt-wcas-details-wrapp .dgwt-wcas-pd-title{margin-bottom:8px}.dgwt-wcas-tpd-image{width:60px;margin-right:15px}.dgwt-wcas-pd-rest .product-title{display:block;line-height:100%;font-weight:500;margin-bottom:5px}.dgwt-wcas-tpd-rest{max-width:200px}.dgwt-wcas-tpd-rest-title{display:block;line-height:125%;font-size:14px;font-weight:500;letter-spacing:0;margin:0 0 8px;overflow:hidden;color:#000}.dgwt-wcas-suggestion-nores{pointer-events:none;opacity:.45}.dgwt-wcas-pd-price,.dgwt-wcas-tpd-price{font-size:14px;line-height:120%;overflow:hidden;color:#000;margin-top:15px;font-weight:700;font-size:18px}.dgwt-wcas-tpd-price{font-size:12px;color:#777}.dgwt-wcas-pd-price .woocommerce-price-suffix,.dgwt-wcas-tpd-price .woocommerce-price-suffix{font-size:12px;font-weight:lighter;color:#999;margin-left:4px;display:inline-block}.dgwt-wcas-pd-price del .amount,.dgwt-wcas-tpd-price del .amount{font-weight:lighter;background:0 0;font-size:90%;opacity:.6}.dgwt-wcas-pd-price ins,.dgwt-wcas-tpd-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{border-bottom:1px dashed #eee;display:block;margin:5px 0 15px 0;padding-bottom:5px}.dgwt-wcas-pd-title{border-bottom:1px dashed #eee;margin-bottom:15px;padding-bottom:5px;display:block;text-decoration:none}.dgwt-wcas-pd-title .product-title{font-weight:900;text-transform:uppercase;letter-spacing:-1px}.dgwt-wcas-details-title-tax{text-transform:uppercase;font-weight:900;letter-spacing:-1px;margin-right:3px}.rtl .dgwt-wcas-details-title-tax{margin:0 0 0 3px;float:right}.dgwt-wcas-tpd-image{width:70px;padding:4px;background-color:#fff;border:1px solid #e8e8e8;border-radius:4px;display:flex;flex-direction:column;justify-content:center}.dgwt-wcas-details-space{padding:0 15px 15px 15px}.dgwt-wcas-details-main-image{border-bottom:1px solid #eee;min-height:200px;display:flex}.dgwt-wcas-details-main-image img{width:auto;height:auto;display:block;max-height:250px;max-width:100%;margin:0 auto;padding:0;border:none;align-self:center}.dgwt-wcas-details-right .dgwt-wcas-details-main-image img{border-radius:0 3px 0 0}.dgwt-wcas-details-left .dgwt-wcas-details-main-image img{border-radius:3px 0 0 0}a.dgwt-wcas-details-post-title,a.dgwt-wcas-details-product-title{color:#333;display:block;line-height:120%;margin:10px 0 0 0;font-size:21px;font-weight:400;text-decoration:none;text-transform:none}a.dgwt-wcas-details-post-title:hover,a.dgwt-wcas-details-product-title:hover{text-decoration:underline}a.dgwt-wcas-details-post-title{margin-bottom:15px}.dgwt-wcas-details-product-sku{display:block;font-size:12px;line-height:110%;color:#999}.dgwt-wcas-tpd-image img{display:block;max-width:100%;width:100%;height:auto}.dgwt-wcas-details-hr{height:1px;width:100%;border-bottom:1px solid #eee;margin:15px 0}.rtl .dgwt-wcas-tpd-image{float:right;margin-right:0;margin-left:15px}.rtl .dgwt-wcas-tpd-rest{float:right;max-width:190px}.rtl input[type=search].dgwt-wcas-search-input{text-align:right}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;-webkit-appearance:textfield;text-align:left}[type=search].dgwt-wcas-search-input::-ms-clear{display:none}[type=search].dgwt-wcas-search-input::-webkit-search-decoration{-webkit-appearance:none}[type=search].dgwt-wcas-search-input::-webkit-search-cancel-button{display:none}.dgwt-wcas-details-desc{font-size:13px;line-height:157%}.dgwt-wcas-details-desc b,.dgwt-wcas-details-desc strong{font-weight:400;color:#000;margin:0;padding:0}.dgwt-wcas-pd-addtc-form{margin:10px 0;display:flex;align-items:center;justify-content:flex-end}.dgwt-wcas-pd-addtc-form>.quantity{margin-right:10px}.dgwt-wcas-pd-addtc-form .add_to_cart_inline,.dgwt-wcas-pd-addtc-form .quantity input.qty{margin-bottom:0;margin-top:0}.dgwt-wcas-stock{display:block;text-align:right;font-size:14px;line-height:14px;margin-bottom:14px}.dgwt-wcas-stock.in-stock{color:#0f834d}.dgwt-wcas-stock.out-of-stock{color:#e2401c}.dgwt-wcas-pd-addtc .add_to_cart_button,.dgwt-wcas-pd-addtc .add_to_cart_inline{margin:0}.dgwt-wcas-pd-addtc .add_to_cart_button.added{display:none}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}.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:5px}.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;margin:0;background:#fff;border:1px solid #ddd;border-radius:3px;-webkit-border-radius:3px;-webkit-appearance:none;box-sizing:border-box}.dgwt-wcas-open .dgwt-wcas-sf-wrapp input[type=search].dgwt-wcas-search-input{border-radius:3px 3px 0 0}.dgwt-wcas-open.dgwt-wcas-nores.dgwt-wcas-details-outside .dgwt-wcas-details-wrapp{display:none!important}.dgwt-wcas-open.dgwt-wcas-nores.dgwt-wcas-details-outside .dgwt-wcas-suggestions-wrapp{min-height:0!important;border-radius:0 0 5px 5px;border-right-color:#ddd}.dgwt-wcas-open.dgwt-wcas-nores.dgwt-wcas-full-width .dgwt-wcas-details-wrapp,.dgwt-wcas-open.dgwt-wcas-nores.dgwt-wcas-full-width .dgwt-wcas-suggestions-wrapp{min-height:41px!important}.dgwt-wcas-open.dgwt-wcas-nores.dgwt-wcas-full-width:not(.rtl):not(.dgwt-wcas-details-outside) .dgwt-wcas-suggestions-wrapp{border-right-color:transparent}.dgwt-wcas-open.dgwt-wcas-nores .dgwt-wcas-details-wrapp .dgwt-wcas-preloader-wrapp{display:none!important}.dgwt-wcas-open.dgwt-wcas-nores.dgwt-wcas-is-details:not(.dgwt-wcas-details-outside) .dgwt-wcas-suggestion-nores{margin-top:5px}.rtl.dgwt-wcas-open.dgwt-wcas-nores.dgwt-wcas-full-width:not(.dgwt-wcas-details-outside) .dgwt-wcas-suggestions-wrapp{border-left-color:transparent}.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::placeholder{color:#999;font-weight:400;font-style:italic;line-height:normal}.dgwt-wcas-sf-wrapp input[type=search].dgwt-wcas-search-input::-webkit-input-placeholder{color:#999;font-weight:400;font-style:italic;line-height:normal}.dgwt-wcas-sf-wrapp input[type=search].dgwt-wcas-search-input:-moz-placeholder{color:#999;font-weight:400;font-style:italic;line-height:normal}.dgwt-wcas-sf-wrapp input[type=search].dgwt-wcas-search-input::-moz-placeholder{color:#999;font-weight:400;font-style:italic;line-height:normal}.dgwt-wcas-sf-wrapp input[type=search].dgwt-wcas-search-input:-ms-input-placeholder{color:#999;font-weight:400;font-style:italic;line-height:normal}.dgwt-wcas-sf-wrapp button.dgwt-wcas-search-submit{overflow:visible;position:absolute;border:0;padding:0;margin:0;cursor:pointer;height:40px;min-width:50px;right:0;left:auto;top:0;bottom:auto;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:#333;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 #333 transparent;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:hover:before{border-right-color:#333}.dgwt-wcas-sf-wrapp .dgwt-wcas-search-submit:active:before,.dgwt-wcas-sf-wrapp .dgwt-wcas-search-submit:focus:before{border-right-color:#333}.dgwt-wcas-sf-wrapp .dgwt-wcas-search-submit::-moz-focus-inner{border:0;padding:0}.dgwt-wcas-ico-magnifier{fill:#fff}.dgwt-wcas-details-wrapp .added_to_cart{display:block}.dgwt-wcas-has-desc .dgwt-wcas-sp>*,.dgwt-wcas-has-img .dgwt-wcas-sp>*{display:block}.dgwt-wcas-is-details .dgwt-wcas-suggestions-wrapp{min-height:340px}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.dgwt-wcas-suggestion-product{min-height:40px}.dgwt-wcas-is-details .dgwt-wcas-suggestions-wrapp{overflow:visible}.dgwt-wcas-is-details .dgwt-wcas-si{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}.rtl .dgwt-wcas-no-submit .dgwt-wcas-ico-magnifier{left:auto;right:12px}.dgwt-wcas-no-submit .dgwt-wcas-sf-wrapp input[type=search].dgwt-wcas-search-input{padding:10px 15px 10px 40px}.rtl .dgwt-wcas-no-submit .dgwt-wcas-sf-wrapp input[type=search].dgwt-wcas-search-input{padding:10px 40px 10px 15px}.dgwt-wcas-overlay-mobile-on,.dgwt-wcas-overlay-mobile-on body{overflow:hidden}.dgwt-wcas-om-bar{display:flex;height:45px;width:100%}.dgwt-wcas-om-bar .dgwt-wcas-om-return{width:45px;height:100%;display:block;background:#ccc;cursor:pointer;position:relative}.dgwt-wcas-om-bar .dgwt-wcas-om-return svg{width:23px;height:23px;position:absolute;left:12px;top:12px}.rtl .dgwt-wcas-om-bar .dgwt-wcas-om-return svg{left:11px;top:9px;-moz-transform:rotate(180deg);-webkit-transform:rotate(180deg);-o-transform:rotate(180deg);-ms-transform:rotate(180deg);transform:rotate(180deg)}.dgwt-wcas-om-bar .dgwt-wcas-has-submit-off .dgwt-wcas-preloader{right:0!important}.rtl .dgwt-wcas-om-bar .dgwt-wcas-has-submit-off .dgwt-wcas-preloader{left:4px!important;right:auto!important}.dgwt-wcas-om-bar .dgwt-wcas-sf-wrapp button.dgwt-wcas-search-submit{display:none}.dgwt-wcas-om-bar .dgwt-wcas-search-wrapp-mobile{width:calc(100% - 45px);max-width:none}.dgwt-wcas-overlay-mobile{position:absolute;left:0;right:0;top:0;bottom:0;width:100%;background:#fff}.dgwt-wcas-overlay-mobile *{box-sizing:border-box}.dgwt-wcas-search-wrapp-mobile input[type=search].dgwt-wcas-search-input{height:45px!important;border-top:none;border-right:none;border-left:none;border-radius:0;font-size:16px!important}.dgwt-wcas-search-wrapp-mobile input[type=search].dgwt-wcas-search-input:focus{font-size:16px!important}.dgwt-wcas-overlay-mobile-on .dgwt-wcas-suggestions-wrapp{left:0!important;top:45px!important;width:100%!important;height:calc(100% - 45px)!important;position:absolute;overflow-y:auto;border:none}.dgwt-wcas-overlay-mobile-on .dgwt-wcas-enable-mobile-form{display:none}.dgwt-wcas-enable-mobile-form{position:absolute;z-index:100;left:0;top:0;width:100%;height:100%;cursor:pointer}html:not(.dgwt-wcas-overlay-mobile-on) .dgwt-wcas-icon-mobile .dgwt-wcas-search-form{display:none;position:relative}html:not(.dgwt-wcas-overlay-mobile-on) .dgwt-wcas-search-wrapp.dgwt-wcas-icon-mobile{min-width:0;display:inline-block;width:28px;height:28px}html:not(.dgwt-wcas-overlay-mobile-on) .dgwt-wcas-icon-handler{height:100%;width:100%}html:not(.dgwt-wcas-overlay-mobile-on) .dgwt-wcas-icon-handler .dgwt-wcas-ico-magnifier{opacity:1;position:static;max-width:none;max-height:none}.dgwt-wcas-overlay-mobile-on .dgwt-wcas-icon-handler{display:none}.dgwt-wcas-overlay-mobile-on body.dgwt-wcas-is-ios .dgwt-wcas-suggestions-wrapp{height:calc(100% - 45px)!important}.dgwt-wcas-overlay-mobile-on body.dgwt-wcas-is-ios{overflow:visible;overflow-x:hidden}.dgwt-wcas-overlay-mobile-on body.dgwt-wcas-is-ios .dgwt-wcas-suggestions-wrapp{max-height:none!important;height:auto!important}.dgwt-wcas-overlay-mobile-on body.dgwt-wcas-is-ios:not(.dgwt-wcas-theme-flatsome)>:not(.dgwt-wcas-overlay-mobile){display:none}body .dgwt-wcas-content-wrapp .rood,body .dgwt-wcas-content-wrapp .zwave{display:none}.dgwt-wcas-has-headings .dgwt-wcas-suggestion{border-bottom:none}.dgwt-wcas-has-headings .dgwt-wcas-st>span.dgwt-wcas-st--direct-headline{display:none}.dgwt-wcas-has-headings .dgwt-wcas-suggestion-headline{pointer-events:none;display:block;font-weight:500;white-space:nowrap}.dgwt-wcas-has-headings .dgwt-wcas-suggestion-headline .dgwt-wcas-st{border-bottom:1px solid #ddd;padding-bottom:3px;text-transform:uppercase;margin-top:16px;font-size:12px}.dgwt-wcas-has-headings .dgwt-wcas-suggestion.dgwt-wcas-suggestion-headline,.dgwt-wcas-has-headings .dgwt-wcas-suggestion.dgwt-wcas-suggestion-tax{border-bottom:none}.dgwt-wcas-has-headings .dgwt-wcas-suggestion-tax .dgwt-wcas-st{padding:0}.dgwt-wcas-has-headings .dgwt-wcas-suggestion.dgwt-wcas-suggestion-tax.dgwt-wcas-suggestion-selected,.dgwt-wcas-has-headings .dgwt-wcas-suggestion.dgwt-wcas-suggestion-tax:hover{background:0 0;text-decoration:underline}.dgwt-wcas-is-details .dgwt-wcas-has-headings .dgwt-wcas-suggestion.dgwt-wcas-suggestion-tax{min-height:30px}
|
assets/js/search.js
CHANGED
@@ -104,6 +104,21 @@
|
|
104 |
|
105 |
|
106 |
}, wait);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
107 |
}
|
108 |
};
|
109 |
}()),
|
@@ -124,7 +139,7 @@
|
|
124 |
},
|
125 |
noop = $.noop;
|
126 |
|
127 |
-
function
|
128 |
var that = this;
|
129 |
|
130 |
// Shared variables:
|
@@ -145,7 +160,7 @@
|
|
145 |
that.detailsContainer = null;
|
146 |
that.autoAligmentprocess = null;
|
147 |
that.noSuggestionsContainer = null;
|
148 |
-
that.options = $.extend(true, {},
|
149 |
that.classes = {
|
150 |
selected: 'dgwt-wcas-suggestion-selected',
|
151 |
suggestion: 'dgwt-wcas-suggestion',
|
@@ -162,11 +177,11 @@
|
|
162 |
|
163 |
}
|
164 |
|
165 |
-
|
166 |
|
167 |
-
$.
|
168 |
|
169 |
-
|
170 |
ajaxSettings: {},
|
171 |
autoSelectFirst: false,
|
172 |
appendTo: 'body',
|
@@ -250,156 +265,204 @@
|
|
250 |
.replace(/<(\/?strong)>/g, '<$1>');
|
251 |
};
|
252 |
|
253 |
-
|
254 |
initialize: function () {
|
255 |
-
var that = this
|
256 |
-
suggestionSelector = '.' + that.classes.suggestion,
|
257 |
-
selected = that.classes.selected,
|
258 |
-
options = that.options,
|
259 |
-
container,
|
260 |
-
containerDetails,
|
261 |
-
closeTrigger = '.' + options.closeTrigger,
|
262 |
-
formWrapper = that.getFormWrapper();
|
263 |
|
264 |
// Remove autocomplete attribute to prevent native suggestions:
|
265 |
that.element.setAttribute('autocomplete', 'off');
|
266 |
|
267 |
-
|
268 |
|
269 |
-
|
270 |
-
that.
|
271 |
-
|
|
|
272 |
|
273 |
-
|
274 |
-
|
|
|
|
|
|
|
|
|
275 |
|
276 |
-
|
277 |
-
container.attr('data-wcas-context', context);
|
278 |
-
container.addClass('woocommerce');
|
279 |
|
280 |
-
|
281 |
|
282 |
-
|
283 |
-
if (options.showImage === true) {
|
284 |
-
container.addClass('dgwt-wcas-has-img');
|
285 |
-
}
|
286 |
|
287 |
-
// Price
|
288 |
-
if (options.showPrice === true) {
|
289 |
-
container.addClass('dgwt-wcas-has-price');
|
290 |
-
}
|
291 |
|
292 |
-
//
|
293 |
-
|
294 |
-
container.addClass('dgwt-wcas-has-desc');
|
295 |
-
}
|
296 |
|
297 |
-
if (
|
298 |
-
|
299 |
}
|
300 |
|
301 |
-
|
302 |
-
|
303 |
-
|
|
|
304 |
|
305 |
-
//
|
306 |
-
if (options.
|
307 |
-
container.width(options.width);
|
308 |
-
}
|
309 |
|
310 |
-
|
311 |
-
if (options.showDetailsPanel === true) {
|
312 |
|
313 |
-
that.
|
314 |
|
315 |
-
|
316 |
-
|
317 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
318 |
|
319 |
-
containerDetails.appendTo('body');
|
320 |
}
|
321 |
|
322 |
-
//
|
323 |
-
|
324 |
|
325 |
-
|
326 |
-
|
|
|
327 |
|
328 |
-
|
329 |
-
|
330 |
-
|
331 |
-
|
332 |
-
that.activate(currentIndex);
|
333 |
-
}
|
334 |
-
}, selector,100);
|
335 |
|
336 |
}
|
337 |
-
});
|
338 |
|
339 |
-
|
340 |
-
|
341 |
-
|
342 |
-
|
343 |
-
|
344 |
|
345 |
-
//
|
346 |
-
$(document).on('click.autocomplete', closeTrigger, function (
|
|
|
347 |
that.hide();
|
348 |
that.clear(false);
|
349 |
-
$(this).removeClass(options.closeTrigger);
|
350 |
-
$(this).closest('.' + options.searchFormClass).find('.' + options.searchInputClass).val('').focus();
|
351 |
});
|
352 |
|
353 |
-
|
354 |
-
|
355 |
-
|
356 |
-
|
357 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
358 |
|
359 |
-
|
360 |
-
|
361 |
-
|
|
|
|
|
362 |
|
363 |
-
|
|
|
|
|
|
|
364 |
|
365 |
-
|
366 |
-
|
367 |
-
|
368 |
-
});
|
369 |
|
370 |
-
|
|
|
371 |
|
372 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
373 |
that.select($(this).data('index'));
|
374 |
});
|
375 |
|
376 |
-
|
|
|
|
|
377 |
clearTimeout(that.blurTimeoutId);
|
378 |
})
|
379 |
|
380 |
-
|
381 |
-
|
382 |
-
|
383 |
-
|
384 |
-
}
|
385 |
|
386 |
-
that.
|
|
|
|
|
387 |
|
|
|
|
|
|
|
|
|
|
|
388 |
|
|
|
389 |
$(document).on('change', '[name="js-dgwt-wcas-quantity"]', function (e) {
|
390 |
var $input = $(this).closest('.js-dgwt-wcas-pd-addtc').find('[data-quantity]');
|
391 |
$input.attr('data-quantity', $(this).val());
|
392 |
});
|
393 |
|
394 |
-
|
395 |
-
|
396 |
-
|
397 |
-
if (that.visible) {
|
398 |
-
that.fixPosition();
|
399 |
-
}
|
400 |
-
};
|
401 |
-
|
402 |
-
$(window).on('resize.autocomplete', that.fixPositionCapture);
|
403 |
|
404 |
$(window).on('scroll', function () {
|
405 |
|
@@ -420,28 +483,36 @@
|
|
420 |
}
|
421 |
});
|
422 |
|
423 |
-
that.el.on('keydown.autocomplete', function (e) {
|
424 |
-
that.onKeyPress(e);
|
425 |
-
});
|
426 |
-
that.el.on('keyup.autocomplete', function (e) {
|
427 |
-
that.onKeyUp(e);
|
428 |
-
});
|
429 |
-
that.el.on('blur.autocomplete', function () {
|
430 |
-
that.onBlur();
|
431 |
-
});
|
432 |
-
that.el.on('focus.autocomplete', function () {
|
433 |
-
that.onFocus();
|
434 |
-
});
|
435 |
-
that.el.on('change.autocomplete', function (e) {
|
436 |
-
that.onKeyUp(e);
|
437 |
-
});
|
438 |
-
that.el.on('input.autocomplete', function (e) {
|
439 |
-
that.onKeyUp(e);
|
440 |
-
});
|
441 |
},
|
442 |
-
|
443 |
var that = this;
|
444 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
445 |
that.fixPositionCapture();
|
446 |
if (that.el.val().length >= that.options.minChars) {
|
447 |
that.onValueChange();
|
@@ -503,8 +574,8 @@
|
|
503 |
}
|
504 |
|
505 |
options.onSearchComplete = function () {
|
506 |
-
var searchForm = that.getFormWrapper();
|
507 |
-
searchForm.removeClass('dgwt-wcas-processing');
|
508 |
that.preloader('hide', 'form', 'dgwt-wcas-inner-preloader');
|
509 |
that.preloader('show', 'form', options.closeTrigger);
|
510 |
};
|
@@ -534,10 +605,10 @@
|
|
534 |
},
|
535 |
fixPosition: function () {
|
536 |
var that = this,
|
537 |
-
|
538 |
-
|
539 |
|
540 |
-
|
541 |
|
542 |
if (that.canShowDetailsBox()) {
|
543 |
that.fixPositionDetailsBox();
|
@@ -547,9 +618,9 @@
|
|
547 |
fixPositionDetailsBox: function () {
|
548 |
|
549 |
var that = this,
|
550 |
-
$form = that.
|
551 |
-
$
|
552 |
-
$
|
553 |
offset = that.getFormOffset(),
|
554 |
nativeOffsetLeft = offset.left,
|
555 |
maxWidth = 550;
|
@@ -664,32 +735,32 @@
|
|
664 |
|
665 |
return false;
|
666 |
},
|
667 |
-
automaticAlignment: function(){
|
668 |
var that = this,
|
669 |
$input = that.getFormWrapper().find('.dgwt-wcas-search-input'),
|
670 |
$suggestionsContainer = that.getSuggestionsContainer(),
|
671 |
$detailsWrapp = that.getDetailsContainer();
|
672 |
|
673 |
-
if(that.autoAligmentprocess != null) {
|
674 |
return;
|
675 |
}
|
676 |
|
677 |
var markers = [$input.width(), $suggestionsContainer.height()];
|
678 |
-
if(that.options.showDetailsPanel) {
|
679 |
markers[2] = $detailsWrapp.height();
|
680 |
}
|
681 |
|
682 |
-
that.autoAligmentprocess = setInterval(function(){
|
683 |
|
684 |
var newMarkers = [$input.width(), $suggestionsContainer.height()];
|
685 |
-
if(that.options.showDetailsPanel) {
|
686 |
newMarkers[2] = $detailsWrapp.height();
|
687 |
}
|
688 |
|
689 |
-
for(var i = 0
|
|
|
|
|
690 |
|
691 |
-
if(markers[i] != newMarkers[i]){
|
692 |
-
|
693 |
that.fixHeight();
|
694 |
that.fixPositionCapture();
|
695 |
markers = newMarkers;
|
@@ -698,7 +769,7 @@
|
|
698 |
}
|
699 |
|
700 |
|
701 |
-
if(that.options.showDetailsPanel) {
|
702 |
|
703 |
var innerDetailsHeight = $detailsWrapp.find('.dgwt-wcas-details-inner').height();
|
704 |
|
@@ -748,27 +819,18 @@
|
|
748 |
return styles;
|
749 |
|
750 |
},
|
751 |
-
getContext: function () {
|
752 |
-
var that = this,
|
753 |
-
$container = that.el.closest('[data-wcas-context]'),
|
754 |
-
context = '';
|
755 |
-
if ($container.length > 0) {
|
756 |
-
context = $container.data('wcas-context');
|
757 |
-
}
|
758 |
-
return context;
|
759 |
-
},
|
760 |
getFormWrapper: function () {
|
761 |
var that = this;
|
762 |
|
763 |
-
return that.el.closest('
|
764 |
},
|
765 |
getSuggestionsContainer: function () {
|
766 |
var that = this;
|
767 |
-
return $('.' + that.options.containerClass
|
768 |
},
|
769 |
getDetailsContainer: function () {
|
770 |
var that = this;
|
771 |
-
return $('.' + that.options.containerDetailsClass
|
772 |
},
|
773 |
scrollDownSuggestions: function () {
|
774 |
var that = this,
|
@@ -1065,9 +1127,7 @@
|
|
1065 |
|
1066 |
},
|
1067 |
getDetails: function (suggestion) {
|
1068 |
-
|
1069 |
-
var that = this,
|
1070 |
-
options = that.options;
|
1071 |
|
1072 |
// Disable details panel
|
1073 |
if (!that.canShowDetailsBox()) {
|
@@ -1110,11 +1170,11 @@
|
|
1110 |
|
1111 |
$.each(that.suggestions, function (i, suggestion) {
|
1112 |
|
1113 |
-
if(
|
1114 |
typeof suggestion.type != 'undefined'
|
1115 |
&& suggestion.type != 'more_products'
|
1116 |
&& suggestion.type != 'headline'
|
1117 |
-
){
|
1118 |
var itemData = {
|
1119 |
objectID: that.prepareSuggestionObjectID(suggestion),
|
1120 |
value: suggestion.value != null ? suggestion.value : ''
|
@@ -1142,13 +1202,13 @@
|
|
1142 |
|
1143 |
var result = typeof response === 'string' ? jQuery.parseJSON(response) : response;
|
1144 |
|
1145 |
-
if(typeof result.items != 'undefined'){
|
1146 |
-
for(var i = 0
|
1147 |
var cacheKey = result.items[i]['objectID'];
|
1148 |
that.cachedDetails[cacheKey] = {html: result.items[i]['html']};
|
1149 |
|
1150 |
// Preload images
|
1151 |
-
if(typeof result.items[i]['imageSrc'] != 'undefined' && result.items[i]['imageSrc'].length > 0){
|
1152 |
var tempImg = new Image();
|
1153 |
tempImg.src = result.items[i]['imageSrc'];
|
1154 |
}
|
@@ -1182,7 +1242,7 @@
|
|
1182 |
|
1183 |
$(document).trigger('dgwtWcasDetailsPanelLoaded', that);
|
1184 |
},
|
1185 |
-
prepareSuggestionObjectID: function(suggestion) {
|
1186 |
var objectID = '';
|
1187 |
|
1188 |
if (typeof suggestion != 'undefined' && typeof suggestion.type != 'undefined') {
|
@@ -1210,7 +1270,7 @@
|
|
1210 |
|
1211 |
return objectID;
|
1212 |
},
|
1213 |
-
selectFirstSuggestion: function(suggestions) {
|
1214 |
var that = this,
|
1215 |
index = 0,
|
1216 |
noResults = false;
|
@@ -1232,14 +1292,14 @@
|
|
1232 |
return false;
|
1233 |
}
|
1234 |
|
1235 |
-
if(typeof suggestion.type === 'undefined' || suggestion.type === 'no-results'){
|
1236 |
noResults = true;
|
1237 |
}
|
1238 |
|
1239 |
});
|
1240 |
}
|
1241 |
|
1242 |
-
if(noResults){
|
1243 |
return;
|
1244 |
}
|
1245 |
|
@@ -1287,7 +1347,7 @@
|
|
1287 |
$('body').removeClass('dgwt-wcas-details-right');
|
1288 |
$('body').removeClass('dgwt-wcas-details-left');
|
1289 |
|
1290 |
-
if(that.autoAligmentprocess != null){
|
1291 |
clearInterval(that.autoAligmentprocess);
|
1292 |
that.autoAligmentprocess = null;
|
1293 |
}
|
@@ -1331,7 +1391,7 @@
|
|
1331 |
},
|
1332 |
suggest: function () {
|
1333 |
if (!this.suggestions.length) {
|
1334 |
-
|
1335 |
return;
|
1336 |
}
|
1337 |
|
@@ -1518,6 +1578,7 @@
|
|
1518 |
|
1519 |
// Add class on show
|
1520 |
$('body').addClass('dgwt-wcas-open');
|
|
|
1521 |
that.automaticAlignment();
|
1522 |
|
1523 |
if (options.showDetailsPanel === true) {
|
@@ -1555,8 +1616,13 @@
|
|
1555 |
containerSugg = that.getSuggestionsContainer(),
|
1556 |
containerDetails = that.getDetailsContainer(),
|
1557 |
maxWidth = 550,
|
1558 |
-
offset = that.getFormOffset()
|
1559 |
-
|
|
|
|
|
|
|
|
|
|
|
1560 |
|
1561 |
realWidth = Math.round(parseFloat(realWidth.replace('px', '')));
|
1562 |
|
@@ -1566,7 +1632,7 @@
|
|
1566 |
containerSugg.css('width', width + 'px');
|
1567 |
}
|
1568 |
|
1569 |
-
if (
|
1570 |
|
1571 |
// Set specific style on the bigger search form
|
1572 |
if (searchForm.width() >= maxWidth) {
|
@@ -1651,7 +1717,7 @@
|
|
1651 |
if (place === 'form') {
|
1652 |
container = that.getFormWrapper().find('.dgwt-wcas-preloader');
|
1653 |
} else if (place === 'details') {
|
1654 |
-
container =
|
1655 |
}
|
1656 |
|
1657 |
// Disable preloader and check if container exist
|
@@ -2019,7 +2085,7 @@
|
|
2019 |
if (instance && instance.dispose) {
|
2020 |
instance.dispose();
|
2021 |
}
|
2022 |
-
instance = new
|
2023 |
inputElement.data(dataKey, instance);
|
2024 |
}
|
2025 |
});
|
@@ -2054,12 +2120,6 @@
|
|
2054 |
$(document).ready(function () {
|
2055 |
"use strict";
|
2056 |
|
2057 |
-
/*-----------------------------------------------------------------
|
2058 |
-
/* Fix the wrong context returned from PHP
|
2059 |
-
/* because some themes or builders do it wrong
|
2060 |
-
/*------------------------------------------------------------------*/
|
2061 |
-
makeContextUnique(true);
|
2062 |
-
|
2063 |
/*-----------------------------------------------------------------
|
2064 |
/* Fire autocomplete
|
2065 |
/*------------ -----------------------------------------------------*/
|
@@ -2071,7 +2131,7 @@
|
|
2071 |
showDetailsPanel = false;
|
2072 |
}
|
2073 |
|
2074 |
-
|
2075 |
minChars: dgwt_wcas.min_chars,
|
2076 |
width: dgwt_wcas.sug_width,
|
2077 |
autoSelectFirst: false,
|
@@ -2096,53 +2156,97 @@
|
|
2096 |
mobileOverlayWrapper: dgwt_wcas.mobile_overlay_wrapper,
|
2097 |
debounceWaitMs: dgwt_wcas.debounce_wait_ms,
|
2098 |
sendGAEvents: dgwt_wcas.send_ga_events,
|
2099 |
-
}
|
|
|
|
|
2100 |
|
2101 |
});
|
2102 |
|
|
|
2103 |
/*-----------------------------------------------------------------
|
2104 |
-
/* Fix
|
2105 |
-
/* Some page builders can copy instances of
|
2106 |
-
/* for eg. mobile usage
|
2107 |
/*------------ -----------------------------------------------------*/
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2108 |
$(window).on('load', function () {
|
2109 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2110 |
});
|
2111 |
|
2112 |
/**
|
2113 |
-
* Fix
|
2114 |
*/
|
2115 |
-
function
|
2116 |
|
2117 |
-
var $
|
2118 |
|
2119 |
-
var
|
2120 |
|
2121 |
-
if ($
|
2122 |
-
$
|
2123 |
-
var
|
2124 |
|
2125 |
-
if ($.inArray(
|
2126 |
-
|
2127 |
|
2128 |
} else {
|
2129 |
-
var
|
|
|
2130 |
|
2131 |
-
$(this).attr('
|
|
|
2132 |
|
2133 |
-
|
2134 |
-
|
2135 |
-
|
2136 |
|
2137 |
-
|
2138 |
-
|
2139 |
-
|
|
|
|
|
2140 |
|
2141 |
-
|
2142 |
-
|
2143 |
-
|
2144 |
-
|
|
|
|
|
|
|
2145 |
}
|
|
|
2146 |
});
|
2147 |
}
|
2148 |
|
104 |
|
105 |
|
106 |
}, wait);
|
107 |
+
},
|
108 |
+
getActiveInstance: function () {
|
109 |
+
var $el = $('.dgwt-wcas-search-wrapp.dgwt-wcas-active'),
|
110 |
+
instance;
|
111 |
+
if ($el.length > 0) {
|
112 |
+
$el.each(function () {
|
113 |
+
var $input = $(this).find('.dgwt-wcas-search-input');
|
114 |
+
if (typeof $input.data('autocomplete') == 'object') {
|
115 |
+
instance = $input.data('autocomplete');
|
116 |
+
return false;
|
117 |
+
}
|
118 |
+
});
|
119 |
+
}
|
120 |
+
|
121 |
+
return instance;
|
122 |
}
|
123 |
};
|
124 |
}()),
|
139 |
},
|
140 |
noop = $.noop;
|
141 |
|
142 |
+
function DgwtWcasAutocompleteSearch(el, options) {
|
143 |
var that = this;
|
144 |
|
145 |
// Shared variables:
|
160 |
that.detailsContainer = null;
|
161 |
that.autoAligmentprocess = null;
|
162 |
that.noSuggestionsContainer = null;
|
163 |
+
that.options = $.extend(true, {}, DgwtWcasAutocompleteSearch.defaults, options);
|
164 |
that.classes = {
|
165 |
selected: 'dgwt-wcas-suggestion-selected',
|
166 |
suggestion: 'dgwt-wcas-suggestion',
|
177 |
|
178 |
}
|
179 |
|
180 |
+
DgwtWcasAutocompleteSearch.utils = utils;
|
181 |
|
182 |
+
$.DgwtWcasAutocompleteSearch = DgwtWcasAutocompleteSearch;
|
183 |
|
184 |
+
DgwtWcasAutocompleteSearch.defaults = {
|
185 |
ajaxSettings: {},
|
186 |
autoSelectFirst: false,
|
187 |
appendTo: 'body',
|
265 |
.replace(/<(\/?strong)>/g, '<$1>');
|
266 |
};
|
267 |
|
268 |
+
DgwtWcasAutocompleteSearch.prototype = {
|
269 |
initialize: function () {
|
270 |
+
var that = this;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
271 |
|
272 |
// Remove autocomplete attribute to prevent native suggestions:
|
273 |
that.element.setAttribute('autocomplete', 'off');
|
274 |
|
275 |
+
that.createContainers();
|
276 |
|
277 |
+
that.registerEventsSearchBar();
|
278 |
+
that.registerEventsSuggestions();
|
279 |
+
that.registerEventsDetailsPanel();
|
280 |
+
that.registerEventsFixedMenu();
|
281 |
|
282 |
+
that.fixPositionCapture = function () {
|
283 |
+
that.adjustContainerWidth();
|
284 |
+
if (that.visible) {
|
285 |
+
that.fixPosition();
|
286 |
+
}
|
287 |
+
};
|
288 |
|
289 |
+
$(window).on('resize.autocomplete', that.fixPositionCapture);
|
|
|
|
|
290 |
|
291 |
+
that.initMobileMode();
|
292 |
|
293 |
+
that.hideAfterClickOutsideListener();
|
|
|
|
|
|
|
294 |
|
|
|
|
|
|
|
|
|
295 |
|
296 |
+
// Mark as initialized
|
297 |
+
that.suggestionsContainer.addClass('js-dgwt-wcas-initialized');
|
|
|
|
|
298 |
|
299 |
+
if (that.detailsContainer && that.detailsContainer.length > 0) {
|
300 |
+
that.detailsContainer.addClass('js-dgwt-wcas-initialized');
|
301 |
}
|
302 |
|
303 |
+
},
|
304 |
+
createContainers: function (type) {
|
305 |
+
var that = this,
|
306 |
+
options = that.options;
|
307 |
|
308 |
+
// Suggestions
|
309 |
+
if ($('.' + options.containerClass).length == 0) {
|
|
|
|
|
310 |
|
311 |
+
that.suggestionsContainer = $(DgwtWcasAutocompleteSearch.utils.createNode(options.containerClass));
|
|
|
312 |
|
313 |
+
that.suggestionsContainer.appendTo(options.appendTo || 'body');
|
314 |
|
315 |
+
that.suggestionsContainer.addClass('woocommerce');
|
316 |
+
|
317 |
+
// Add conditional classes
|
318 |
+
if (options.showImage === true) {
|
319 |
+
that.suggestionsContainer.addClass('dgwt-wcas-has-img');
|
320 |
+
}
|
321 |
+
|
322 |
+
// Price
|
323 |
+
if (options.showPrice === true) {
|
324 |
+
that.suggestionsContainer.addClass('dgwt-wcas-has-price');
|
325 |
+
}
|
326 |
+
|
327 |
+
// Description
|
328 |
+
if (options.showDescription === true) {
|
329 |
+
that.suggestionsContainer.addClass('dgwt-wcas-has-desc');
|
330 |
+
}
|
331 |
+
|
332 |
+
// SKU
|
333 |
+
if (options.showSKU === true) {
|
334 |
+
that.suggestionsContainer.addClass('dgwt-wcas-has-sku');
|
335 |
+
}
|
336 |
+
|
337 |
+
// Headings
|
338 |
+
if (options.showHeadings === true) {
|
339 |
+
that.suggestionsContainer.addClass('dgwt-wcas-has-headings');
|
340 |
+
}
|
341 |
+
|
342 |
+
// Only set width if it was provided:
|
343 |
+
if (options.width !== 'auto') {
|
344 |
+
that.suggestionsContainer.width(options.width);
|
345 |
+
}
|
346 |
+
|
347 |
+
} else {
|
348 |
+
|
349 |
+
that.suggestionsContainer = $('.' + that.options.containerClass);
|
350 |
|
|
|
351 |
}
|
352 |
|
353 |
+
// Details Panel
|
354 |
+
if (that.canShowDetailsBox()) {
|
355 |
|
356 |
+
if ($('.' + options.containerDetailsClass).length == 0) {
|
357 |
+
that.detailsContainer = $(DgwtWcasAutocompleteSearch.utils.createNode(options.containerDetailsClass));
|
358 |
+
that.detailsContainer.appendTo(options.appendTo || 'body');
|
359 |
|
360 |
+
that.detailsContainer.addClass('woocommerce');
|
361 |
+
} else {
|
362 |
+
|
363 |
+
that.detailsContainer = $('.' + options.containerDetailsClass);
|
|
|
|
|
|
|
364 |
|
365 |
}
|
|
|
366 |
|
367 |
+
}
|
368 |
+
|
369 |
+
},
|
370 |
+
registerEventsSearchBar: function () {
|
371 |
+
var that = this;
|
372 |
|
373 |
+
// Click close icon
|
374 |
+
$(document).on('click.autocomplete', '.' + that.options.closeTrigger, function () {
|
375 |
+
var that = utils.getActiveInstance();
|
376 |
that.hide();
|
377 |
that.clear(false);
|
378 |
+
$(this).removeClass(that.options.closeTrigger);
|
379 |
+
$(this).closest('.' + that.options.searchFormClass).find('.' + that.options.searchInputClass).val('').focus();
|
380 |
});
|
381 |
|
382 |
+
that.el.on('keydown.autocomplete', function (e) {
|
383 |
+
that.onKeyPress(e);
|
384 |
+
});
|
385 |
+
that.el.on('keyup.autocomplete', function (e) {
|
386 |
+
that.onKeyUp(e);
|
387 |
+
});
|
388 |
+
that.el.on('blur.autocomplete', function () {
|
389 |
+
that.onBlur();
|
390 |
+
});
|
391 |
+
that.el.on('focus.autocomplete', function () {
|
392 |
+
that.onFocus();
|
393 |
+
});
|
394 |
+
that.el.on('change.autocomplete', function (e) {
|
395 |
+
that.onKeyUp(e);
|
396 |
+
});
|
397 |
+
that.el.on('input.autocomplete', function (e) {
|
398 |
+
that.onKeyUp(e);
|
399 |
+
});
|
400 |
|
401 |
+
},
|
402 |
+
registerEventsSuggestions: function () {
|
403 |
+
var that = this,
|
404 |
+
suggestionSelector = '.' + that.classes.suggestion,
|
405 |
+
suggestionsContainer = that.getSuggestionsContainer();
|
406 |
|
407 |
+
// Register these events only once
|
408 |
+
if (suggestionsContainer.hasClass('js-dgwt-wcas-initialized')) {
|
409 |
+
return;
|
410 |
+
}
|
411 |
|
412 |
+
// Select suggestion and enable details panel on hovering over it
|
413 |
+
$(document).on('mouseenter.autocomplete', suggestionSelector, function () {
|
414 |
+
var that = utils.getActiveInstance();
|
|
|
415 |
|
416 |
+
var currentIndex = $(this).data('index');
|
417 |
+
var selector = '.dgwt-wcas-suggestion[data-index="' + currentIndex + '"]';
|
418 |
|
419 |
+
if (that.selectedIndex != currentIndex) {
|
420 |
+
utils.mouseHoverDebounce(function () {
|
421 |
+
if (that.selectedIndex !== currentIndex) {
|
422 |
+
that.getDetails(that.suggestions[currentIndex]);
|
423 |
+
that.activate(currentIndex);
|
424 |
+
}
|
425 |
+
}, selector, 100);
|
426 |
+
|
427 |
+
}
|
428 |
+
});
|
429 |
+
|
430 |
+
// Redirect to the new URL after click a suggestions
|
431 |
+
$(document).on('click.autocomplete', suggestionSelector, function () {
|
432 |
+
var that = utils.getActiveInstance();
|
433 |
that.select($(this).data('index'));
|
434 |
});
|
435 |
|
436 |
+
// Clear timeout - onBlur usage
|
437 |
+
$(document).on('click.autocomplete', '.' + that.options.containerClass, function () {
|
438 |
+
var that = utils.getActiveInstance();
|
439 |
clearTimeout(that.blurTimeoutId);
|
440 |
})
|
441 |
|
442 |
+
},
|
443 |
+
registerEventsDetailsPanel: function () {
|
444 |
+
var that = this,
|
445 |
+
detailsContainer = that.getDetailsContainer();
|
|
|
446 |
|
447 |
+
if (!that.canShowDetailsBox() || detailsContainer.hasClass('js-dgwt-wcas-initialized')) {
|
448 |
+
return;
|
449 |
+
}
|
450 |
|
451 |
+
// Clear timeout - onBlur usage
|
452 |
+
$(document).on('click.autocomplete', '.' + that.options.containerDetailsClass, function () {
|
453 |
+
var that = utils.getActiveInstance();
|
454 |
+
clearTimeout(that.blurTimeoutId);
|
455 |
+
})
|
456 |
|
457 |
+
// Update quantity
|
458 |
$(document).on('change', '[name="js-dgwt-wcas-quantity"]', function (e) {
|
459 |
var $input = $(this).closest('.js-dgwt-wcas-pd-addtc').find('[data-quantity]');
|
460 |
$input.attr('data-quantity', $(this).val());
|
461 |
});
|
462 |
|
463 |
+
},
|
464 |
+
registerEventsFixedMenu: function () {
|
465 |
+
var that = this;
|
|
|
|
|
|
|
|
|
|
|
|
|
466 |
|
467 |
$(window).on('scroll', function () {
|
468 |
|
483 |
}
|
484 |
});
|
485 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
486 |
},
|
487 |
+
initMobileMode: function () {
|
488 |
var that = this;
|
489 |
|
490 |
+
if (
|
491 |
+
that.options.overlayMobile
|
492 |
+
&& that.isMobileMode()
|
493 |
+
) {
|
494 |
+
|
495 |
+
var $formWrapper = that.getFormWrapper();
|
496 |
+
|
497 |
+
if ($formWrapper.hasClass('js-dgwt-wcas-icon-mobile')) {
|
498 |
+
$formWrapper.prepend('<div class="dgwt-wcas-icon-handler">' + dgwt_wcas.magnifier_icon + '</div>');
|
499 |
+
}
|
500 |
+
|
501 |
+
$formWrapper.prepend('<div class="js-dgwt-wcas-enable-mobile-form dgwt-wcas-enable-mobile-form"></div>');
|
502 |
+
|
503 |
+
var $el = $formWrapper.find('.js-dgwt-wcas-enable-mobile-form');
|
504 |
+
|
505 |
+
$el.on('click', function (e) {
|
506 |
+
that.enableOverlayMobile();
|
507 |
+
});
|
508 |
+
|
509 |
+
}
|
510 |
+
|
511 |
+
},
|
512 |
+
onFocus: function () {
|
513 |
+
var that = this;
|
514 |
+
$('.' + this.options.searchFormClass).removeClass('dgwt-wcas-active');
|
515 |
+
that.getFormWrapper().addClass('dgwt-wcas-active');
|
516 |
that.fixPositionCapture();
|
517 |
if (that.el.val().length >= that.options.minChars) {
|
518 |
that.onValueChange();
|
574 |
}
|
575 |
|
576 |
options.onSearchComplete = function () {
|
577 |
+
var $searchForm = that.getFormWrapper();
|
578 |
+
$searchForm.removeClass('dgwt-wcas-processing');
|
579 |
that.preloader('hide', 'form', 'dgwt-wcas-inner-preloader');
|
580 |
that.preloader('show', 'form', options.closeTrigger);
|
581 |
};
|
605 |
},
|
606 |
fixPosition: function () {
|
607 |
var that = this,
|
608 |
+
offset = that.getFormOffset(),
|
609 |
+
suggestionsContainer = that.getSuggestionsContainer();
|
610 |
|
611 |
+
suggestionsContainer.css(offset);
|
612 |
|
613 |
if (that.canShowDetailsBox()) {
|
614 |
that.fixPositionDetailsBox();
|
618 |
fixPositionDetailsBox: function () {
|
619 |
|
620 |
var that = this,
|
621 |
+
$form = that.getFormWrapper(),
|
622 |
+
$containerSuggestions = that.getSuggestionsContainer(),
|
623 |
+
$containerDetails = that.getDetailsContainer(),
|
624 |
offset = that.getFormOffset(),
|
625 |
nativeOffsetLeft = offset.left,
|
626 |
maxWidth = 550;
|
735 |
|
736 |
return false;
|
737 |
},
|
738 |
+
automaticAlignment: function () {
|
739 |
var that = this,
|
740 |
$input = that.getFormWrapper().find('.dgwt-wcas-search-input'),
|
741 |
$suggestionsContainer = that.getSuggestionsContainer(),
|
742 |
$detailsWrapp = that.getDetailsContainer();
|
743 |
|
744 |
+
if (that.autoAligmentprocess != null) {
|
745 |
return;
|
746 |
}
|
747 |
|
748 |
var markers = [$input.width(), $suggestionsContainer.height()];
|
749 |
+
if (that.options.showDetailsPanel) {
|
750 |
markers[2] = $detailsWrapp.height();
|
751 |
}
|
752 |
|
753 |
+
that.autoAligmentprocess = setInterval(function () {
|
754 |
|
755 |
var newMarkers = [$input.width(), $suggestionsContainer.height()];
|
756 |
+
if (that.options.showDetailsPanel) {
|
757 |
newMarkers[2] = $detailsWrapp.height();
|
758 |
}
|
759 |
|
760 |
+
for (var i = 0; i < markers.length; i++) {
|
761 |
+
|
762 |
+
if (markers[i] != newMarkers[i]) {
|
763 |
|
|
|
|
|
764 |
that.fixHeight();
|
765 |
that.fixPositionCapture();
|
766 |
markers = newMarkers;
|
769 |
}
|
770 |
|
771 |
|
772 |
+
if (that.options.showDetailsPanel) {
|
773 |
|
774 |
var innerDetailsHeight = $detailsWrapp.find('.dgwt-wcas-details-inner').height();
|
775 |
|
819 |
return styles;
|
820 |
|
821 |
},
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
822 |
getFormWrapper: function () {
|
823 |
var that = this;
|
824 |
|
825 |
+
return that.el.closest('.' + that.options.searchFormClass);
|
826 |
},
|
827 |
getSuggestionsContainer: function () {
|
828 |
var that = this;
|
829 |
+
return $('.' + that.options.containerClass);
|
830 |
},
|
831 |
getDetailsContainer: function () {
|
832 |
var that = this;
|
833 |
+
return $('.' + that.options.containerDetailsClass);
|
834 |
},
|
835 |
scrollDownSuggestions: function () {
|
836 |
var that = this,
|
1127 |
|
1128 |
},
|
1129 |
getDetails: function (suggestion) {
|
1130 |
+
var that = this;
|
|
|
|
|
1131 |
|
1132 |
// Disable details panel
|
1133 |
if (!that.canShowDetailsBox()) {
|
1170 |
|
1171 |
$.each(that.suggestions, function (i, suggestion) {
|
1172 |
|
1173 |
+
if (
|
1174 |
typeof suggestion.type != 'undefined'
|
1175 |
&& suggestion.type != 'more_products'
|
1176 |
&& suggestion.type != 'headline'
|
1177 |
+
) {
|
1178 |
var itemData = {
|
1179 |
objectID: that.prepareSuggestionObjectID(suggestion),
|
1180 |
value: suggestion.value != null ? suggestion.value : ''
|
1202 |
|
1203 |
var result = typeof response === 'string' ? jQuery.parseJSON(response) : response;
|
1204 |
|
1205 |
+
if (typeof result.items != 'undefined') {
|
1206 |
+
for (var i = 0; i < result.items.length; i++) {
|
1207 |
var cacheKey = result.items[i]['objectID'];
|
1208 |
that.cachedDetails[cacheKey] = {html: result.items[i]['html']};
|
1209 |
|
1210 |
// Preload images
|
1211 |
+
if (typeof result.items[i]['imageSrc'] != 'undefined' && result.items[i]['imageSrc'].length > 0) {
|
1212 |
var tempImg = new Image();
|
1213 |
tempImg.src = result.items[i]['imageSrc'];
|
1214 |
}
|
1242 |
|
1243 |
$(document).trigger('dgwtWcasDetailsPanelLoaded', that);
|
1244 |
},
|
1245 |
+
prepareSuggestionObjectID: function (suggestion) {
|
1246 |
var objectID = '';
|
1247 |
|
1248 |
if (typeof suggestion != 'undefined' && typeof suggestion.type != 'undefined') {
|
1270 |
|
1271 |
return objectID;
|
1272 |
},
|
1273 |
+
selectFirstSuggestion: function (suggestions) {
|
1274 |
var that = this,
|
1275 |
index = 0,
|
1276 |
noResults = false;
|
1292 |
return false;
|
1293 |
}
|
1294 |
|
1295 |
+
if (typeof suggestion.type === 'undefined' || suggestion.type === 'no-results') {
|
1296 |
noResults = true;
|
1297 |
}
|
1298 |
|
1299 |
});
|
1300 |
}
|
1301 |
|
1302 |
+
if (noResults) {
|
1303 |
return;
|
1304 |
}
|
1305 |
|
1347 |
$('body').removeClass('dgwt-wcas-details-right');
|
1348 |
$('body').removeClass('dgwt-wcas-details-left');
|
1349 |
|
1350 |
+
if (that.autoAligmentprocess != null) {
|
1351 |
clearInterval(that.autoAligmentprocess);
|
1352 |
that.autoAligmentprocess = null;
|
1353 |
}
|
1391 |
},
|
1392 |
suggest: function () {
|
1393 |
if (!this.suggestions.length) {
|
1394 |
+
this.hide();
|
1395 |
return;
|
1396 |
}
|
1397 |
|
1578 |
|
1579 |
// Add class on show
|
1580 |
$('body').addClass('dgwt-wcas-open');
|
1581 |
+
|
1582 |
that.automaticAlignment();
|
1583 |
|
1584 |
if (options.showDetailsPanel === true) {
|
1616 |
containerSugg = that.getSuggestionsContainer(),
|
1617 |
containerDetails = that.getDetailsContainer(),
|
1618 |
maxWidth = 550,
|
1619 |
+
offset = that.getFormOffset();
|
1620 |
+
|
1621 |
+
if(!searchForm.length){
|
1622 |
+
return;
|
1623 |
+
}
|
1624 |
+
|
1625 |
+
var realWidth = getComputedStyle(searchForm[0]).width;
|
1626 |
|
1627 |
realWidth = Math.round(parseFloat(realWidth.replace('px', '')));
|
1628 |
|
1632 |
containerSugg.css('width', width + 'px');
|
1633 |
}
|
1634 |
|
1635 |
+
if (that.canShowDetailsBox()) {
|
1636 |
|
1637 |
// Set specific style on the bigger search form
|
1638 |
if (searchForm.width() >= maxWidth) {
|
1717 |
if (place === 'form') {
|
1718 |
container = that.getFormWrapper().find('.dgwt-wcas-preloader');
|
1719 |
} else if (place === 'details') {
|
1720 |
+
container = that.getDetailsContainer();
|
1721 |
}
|
1722 |
|
1723 |
// Disable preloader and check if container exist
|
2085 |
if (instance && instance.dispose) {
|
2086 |
instance.dispose();
|
2087 |
}
|
2088 |
+
instance = new DgwtWcasAutocompleteSearch(this, options);
|
2089 |
inputElement.data(dataKey, instance);
|
2090 |
}
|
2091 |
});
|
2120 |
$(document).ready(function () {
|
2121 |
"use strict";
|
2122 |
|
|
|
|
|
|
|
|
|
|
|
|
|
2123 |
/*-----------------------------------------------------------------
|
2124 |
/* Fire autocomplete
|
2125 |
/*------------ -----------------------------------------------------*/
|
2131 |
showDetailsPanel = false;
|
2132 |
}
|
2133 |
|
2134 |
+
window.dgwt_wcas.config = {
|
2135 |
minChars: dgwt_wcas.min_chars,
|
2136 |
width: dgwt_wcas.sug_width,
|
2137 |
autoSelectFirst: false,
|
2156 |
mobileOverlayWrapper: dgwt_wcas.mobile_overlay_wrapper,
|
2157 |
debounceWaitMs: dgwt_wcas.debounce_wait_ms,
|
2158 |
sendGAEvents: dgwt_wcas.send_ga_events,
|
2159 |
+
};
|
2160 |
+
|
2161 |
+
$('.dgwt-wcas-search-input').dgwtWcasAutocomplete(window.dgwt_wcas.config);
|
2162 |
|
2163 |
});
|
2164 |
|
2165 |
+
|
2166 |
/*-----------------------------------------------------------------
|
2167 |
+
/* Fix broken search bars by 3rd party plugins
|
2168 |
+
/* Some page builders can copy instances of search bar without events
|
2169 |
+
/* for eg. mobile usage. We try to fix all broken search bars.
|
2170 |
/*------------ -----------------------------------------------------*/
|
2171 |
+
$(document).ready(function () {
|
2172 |
+
setTimeout(function() {
|
2173 |
+
makeIDUnique();
|
2174 |
+
maybeReinit();
|
2175 |
+
}, 500);
|
2176 |
+
});
|
2177 |
+
|
2178 |
$(window).on('load', function () {
|
2179 |
+
setTimeout(function() {
|
2180 |
+
makeIDUnique();
|
2181 |
+
maybeReinit();
|
2182 |
+
}, 500);
|
2183 |
+
|
2184 |
+
// Support for Elementor popups
|
2185 |
+
if(
|
2186 |
+
typeof window.elementorFrontend != 'undefined'
|
2187 |
+
&& typeof window.elementorFrontend.documentsManager != 'undefined'
|
2188 |
+
&& typeof window.elementorFrontend.documentsManager.documents != 'undefined'
|
2189 |
+
){
|
2190 |
+
|
2191 |
+
$.each(elementorFrontend.documentsManager.documents, function (id, document) {
|
2192 |
+
if (typeof document.getModal != 'undefined' && document.getModal) {
|
2193 |
+
|
2194 |
+
document.getModal().on('show', function () {
|
2195 |
+
|
2196 |
+
setTimeout(function () {
|
2197 |
+
maybeReinit();
|
2198 |
+
}, 300);
|
2199 |
+
|
2200 |
+
});
|
2201 |
+
|
2202 |
+
}
|
2203 |
+
});
|
2204 |
+
|
2205 |
+
}
|
2206 |
});
|
2207 |
|
2208 |
/**
|
2209 |
+
* Fix duplicated ID created by some themes or builders
|
2210 |
*/
|
2211 |
+
function makeIDUnique() {
|
2212 |
|
2213 |
+
var $inputs = $('.dgwt-wcas-search-input');
|
2214 |
|
2215 |
+
var uniqueID = [];
|
2216 |
|
2217 |
+
if ($inputs.length > 1) {
|
2218 |
+
$inputs.each(function () {
|
2219 |
+
var id = $(this).attr('id');
|
2220 |
|
2221 |
+
if ($.inArray(id, uniqueID) == -1) {
|
2222 |
+
uniqueID.push(id);
|
2223 |
|
2224 |
} else {
|
2225 |
+
var newID = Math.random().toString(36).substring(2, 6);
|
2226 |
+
newID = 'dgwt-wcas-search-input-' + newID;
|
2227 |
|
2228 |
+
$(this).attr('id', newID);
|
2229 |
+
$(this).closest('form').find('label').attr('for', newID);
|
2230 |
|
2231 |
+
}
|
2232 |
+
});
|
2233 |
+
}
|
2234 |
|
2235 |
+
}
|
2236 |
+
/**
|
2237 |
+
* Init not initialized search bar
|
2238 |
+
*/
|
2239 |
+
function maybeReinit() {
|
2240 |
|
2241 |
+
var $inputs = $('.dgwt-wcas-search-input');
|
2242 |
+
|
2243 |
+
if ($inputs.length > 0) {
|
2244 |
+
$inputs.each(function () {
|
2245 |
+
|
2246 |
+
if (typeof $(this).data('autocomplete') != 'object') {
|
2247 |
+
$(this).dgwtWcasAutocomplete(window.dgwt_wcas.config);
|
2248 |
}
|
2249 |
+
|
2250 |
});
|
2251 |
}
|
2252 |
|
assets/js/search.min.js
CHANGED
@@ -1 +1 @@
|
|
1 |
-
!function(t){"use strict";"function"==typeof define&&define.amd?define(["jquery"],t):"object"==typeof exports&&"function"==typeof require?t(require("jquery")):t(jQuery)}(function(t){"use strict";var e={escapeRegExChars:function(t){return t.replace(/[|\\{}()[\]^$+*?.]/g,"\\$&")},createNode:function(t){var e=document.createElement("div");return e.className=t,e.style.position="absolute",e.style.display="none",e.setAttribute("unselectable","on"),e},highlight:function(t,s){if(dgwt_wcas.is_premium){var i,a=s.split(/ /);if(a)for(a=a.sort(function(t,e){return e.length-t.length}),i=0;i<a.length;i++)if(a[i]&&a[i].length>1){var o="("+e.escapeRegExChars(a[i].trim())+")";t=t.replace(new RegExp(o,"gi"),"<strong>$1</strong>")}}else o="("+e.escapeRegExChars(s)+")",t=t.replace(new RegExp(o,"gi"),"<strong>$1</strong>");return t},debounce:function(t,e){var i,a=(new Date).getUTCMilliseconds();if(0===s.id.length)return s.id=a,void t();s.id=a,i=setTimeout(function(){a===s.id?(t(),s.id=""):clearTimeout(i)},e)},mouseHoverDebounce:function(e,s,i){var a;a=setTimeout(function(){t(s+":hover").length>0?e():clearTimeout(a)},i)}},s={id:"",callback:null,ajaxSettings:null,object:null},i=27,a=9,o=13,n=38,l=39,r=40,c=t.noop;function d(e,s){this.element=e,this.el=t(e),this.suggestions=[],this.badQueries=[],this.selectedIndex=-1,this.currentValue=this.element.value,this.timeoutId=null,this.cachedResponse={},this.cachedDetails={},this.detailsRequestsSent=[],this.onChangeTimeout=null,this.onChange=null,this.isLocal=!1,this.suggestionsContainer=null,this.detailsContainer=null,this.autoAligmentprocess=null,this.noSuggestionsContainer=null,this.options=t.extend(!0,{},d.defaults,s),this.classes={selected:"dgwt-wcas-suggestion-selected",suggestion:"dgwt-wcas-suggestion",suggestionsContainerOrientTop:"dgwt-wcas-suggestions-wrapp--top"},this.hint=null,this.hintValue="",this.selection=null,this.overlayMobileState="off",this.initialize(),this.setOptions(s)}d.utils=e,t.Autocomplete=d,d.defaults={ajaxSettings:{},autoSelectFirst:!1,appendTo:"body",serviceUrl:null,lookup:null,onSelect: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:function(t,s,i){if(!s)return t;i&&(t=e.highlight(t,s));return t.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/<sup/g,"<sup").replace(/<\/sup/g,"</sup").replace(/sup>/g,"sup>").replace(/<(\/?strong)>/g,"<$1>")},delimiter:null,zIndex:999999999,type:"GET",noCache:!1,isRtl:!1,onSearchStart:c,onSearchComplete:c,onSearchError:c,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,isPremium:!1,overlayMobile:!1,preventBadQueries:!0,lookupFilter:function(t,e,s){return-1!==t.value.toLowerCase().indexOf(s)},paramName:"query",transformResult:function(e){return"string"==typeof e?t.parseJSON(e):e},noSuggestionNotice:"No results",orientation:"bottom",forceFixPosition:!1,positionFixed:!1,debounceWaitMs:400,sendGAEvents:!0},d.prototype={initialize:function(){var s,i,a=this,o="."+a.classes.suggestion,n=(a.classes.selected,a.options),l="."+n.closeTrigger,r=a.getFormWrapper();a.element.setAttribute("autocomplete","off");var c=a.el.closest("."+n.searchFormClass).data("wcas-context");(a.noSuggestionsContainer=t('<div class="dgwt-wcas-no-suggestion"></div>').html(this.options.noSuggestionNotice).get(0),a.suggestionsContainer=d.utils.createNode(n.containerClass),(s=t(a.suggestionsContainer)).attr("data-wcas-context",c),s.addClass("woocommerce"),s.appendTo(n.appendTo||"body"),!0===n.showImage&&s.addClass("dgwt-wcas-has-img"),!0===n.showPrice&&s.addClass("dgwt-wcas-has-price"),!0===n.showDescription&&s.addClass("dgwt-wcas-has-desc"),!0===n.showSKU&&s.addClass("dgwt-wcas-has-sku"),!0===n.showHeadings&&s.addClass("dgwt-wcas-has-headings"),"auto"!==n.width&&s.width(n.width),!0===n.showDetailsPanel&&(a.detailsContainer=d.utils.createNode(n.containerDetailsClass),(i=t(a.detailsContainer)).attr("data-wcas-context",c),i.addClass("woocommerce"),i.appendTo("body")),s.on("mouseenter.autocomplete",o,function(){var s=t(this).data("index"),i='.dgwt-wcas-suggestions-wrapp[data-wcas-context="'+a.getContext()+'"] .dgwt-wcas-suggestion[data-index="'+s+'"]';a.selectedIndex!=s&&e.mouseHoverDebounce(function(){a.selectedIndex!==s&&(a.getDetails(a.suggestions[s]),a.activate(s))},i,100)}),s.on("mouseout.autocomplete",function(){}),t(document).on("click.autocomplete",l,function(e){a.hide(),a.clear(!1),t(this).removeClass(n.closeTrigger),t(this).closest("."+n.searchFormClass).find("."+n.searchInputClass).val("").focus()}),a.options.overlayMobile&&a.isMobileMode())&&(r.hasClass("js-dgwt-wcas-icon-mobile")&&r.prepend('<div class="dgwt-wcas-icon-handler">'+dgwt_wcas.magnifier_icon+"</div>"),r.prepend('<div class="js-dgwt-wcas-enable-mobile-form dgwt-wcas-enable-mobile-form"></div>'),r.find(".js-dgwt-wcas-enable-mobile-form").on("click",function(t){a.enableOverlayMobile()}));s.on("click.autocomplete",o,function(){a.select(t(this).data("index"))}),s.on("click.autocomplete",function(){clearTimeout(a.blurTimeoutId)}),a.canShowDetailsBox()&&i.on("click.autocomplete",function(){clearTimeout(a.blurTimeoutId)}),a.hideAfterClickOutsideListener(),t(document).on("change",'[name="js-dgwt-wcas-quantity"]',function(e){t(this).closest(".js-dgwt-wcas-pd-addtc").find("[data-quantity]").attr("data-quantity",t(this).val())}),a.fixPositionCapture=function(){a.adjustContainerWidth(),a.visible&&a.fixPosition()},t(window).on("resize.autocomplete",a.fixPositionCapture),t(window).on("scroll",function(){if(a.suggestions.length>0&&a.elementOrParentIsFixed(a.getFormWrapper()))if(0===t(window).scrollTop()){[1,10,20,30,40,50,60,70,80,90,120,140,170,200,250,400,700,1e3,2e3].forEach(function(t){setTimeout(function(){a.fixHeight(),a.fixPositionCapture()},t)})}else a.fixHeight(),a.fixPositionCapture()}),a.el.on("keydown.autocomplete",function(t){a.onKeyPress(t)}),a.el.on("keyup.autocomplete",function(t){a.onKeyUp(t)}),a.el.on("blur.autocomplete",function(){a.onBlur()}),a.el.on("focus.autocomplete",function(){a.onFocus()}),a.el.on("change.autocomplete",function(t){a.onKeyUp(t)}),a.el.on("input.autocomplete",function(t){a.onKeyUp(t)})},onFocus:function(){this.fixPositionCapture(),this.el.val().length>=this.options.minChars&&this.onValueChange()},onBlur:function(){var e=this,s=e.options,i=e.el.val(),a=e.getQuery(i);e.blurTimeoutId=setTimeout(function(){e.hide(),e.selection&&e.currentValue!==a&&(s.onInvalidateSelection||t.noop).call(e.element)},200)},abortAjax:function(){this.currentRequest&&(this.currentRequest.abort(),this.currentRequest=null)},setOptions:function(e){var s=this,i=s.getSuggestionsContainer(),a=t.extend({},s.options,e);(s.isLocal=Array.isArray(a.lookup),s.isLocal&&(a.lookup=s.verifySuggestionsFormat(a.lookup)),a.orientation=s.validateOrientation(a.orientation,"bottom"),i.css({"max-height":s.canShowDetailsBox()?"none":a.maxHeight+"px",width:a.width+"px","z-index":a.zIndex}),!0===a.showDetailsPanel)&&s.getDetailsContainer().css({"z-index":a.zIndex-1});a.onSearchComplete=function(){s.getFormWrapper().removeClass("dgwt-wcas-processing"),s.preloader("hide","form","dgwt-wcas-inner-preloader"),s.preloader("show","form",a.closeTrigger)},this.options=a},clearCache:function(){this.cachedResponse={},this.cachedDetails={},this.badQueries=[]},clear:function(t){t&&this.clearCache(),this.currentValue="",this.suggestions=[]},disable:function(){this.disabled=!0,clearTimeout(this.onChangeTimeout),this.abortAjax()},enable:function(){this.disabled=!1},fixPosition:function(){var e=t("."+this.options.containerClass+'[data-wcas-context="'+this.getContext()+'"]'),s=this.getFormOffset();e.css(s),this.canShowDetailsBox()&&this.fixPositionDetailsBox()},fixPositionDetailsBox:function(){var e=this.el.closest("[data-wcas-context]"),s=t("."+this.options.containerDetailsClass+'[data-wcas-context="'+this.getContext()+'"]'),i=t("."+this.options.containerClass+'[data-wcas-context="'+this.getContext()+'"]'),a=this.getFormOffset(),o=a.left;if(0==s.length)return!1;var n=!0===this.options.isRtl?1:2,l=Math.round(a.left);if(a.left=l+Math.round(i.width()+n),s.css(a),e.width()>=550)return t("body").removeClass("dgwt-wcas-details-outside"),t("body").removeClass("dgwt-wcas-details-right"),t("body").removeClass("dgwt-wcas-details-left"),void(!0===this.options.isRtl&&(i.css("left",l+Math.round(s.width()+n)+"px"),s.css("left",o+"px")));var r=t(window).width(),c=s.width(),d=s.offset();t("body").addClass("dgwt-wcas-details-outside"),!0===this.options.isRtl&&(a.left=a.left+1);var g=!1,u=!1;r<d.left+c&&(g=!0,t("body").removeClass("dgwt-wcas-details-right"),t("body").addClass("dgwt-wcas-details-left"),s.css("left",Math.round(parseFloat(i.css("left").replace("px","")))-s.outerWidth()+"px")),(d=s.offset()).left<1&&(u=!0,t("body").removeClass("dgwt-wcas-details-left"),t("body").addClass("dgwt-wcas-details-right")),u&&g?(t("body").removeClass("dgwt-wcas-details-left"),t("body").removeClass("dgwt-wcas-details-right"),t("body").addClass("dgwt-wcas-details-notfit")):t("body").removeClass("dgwt-wcas-details-notfit")},fixHeight:function(){if(1!=this.options.showDetailsPanel)return!1;var t=this.getSuggestionsContainer(),e=this.getDetailsContainer();t.css("height","auto"),e.css("height","auto");var s=t.outerHeight(),i=e.outerHeight();return t.find(".dgwt-wcas-suggestion:last-child").removeClass("dgwt-wcas-suggestion-no-border-bottom"),!(s<=340&&i<=340)&&(t.find(".dgwt-wcas-suggestion:last-child").addClass("dgwt-wcas-suggestion-no-border-bottom"),i<s&&e.css("height",s+"px"),s<i&&t.css("height",i+"px"),!1)},automaticAlignment:function(){var t=this,e=t.getFormWrapper().find(".dgwt-wcas-search-input"),s=t.getSuggestionsContainer(),i=t.getDetailsContainer();if(null==t.autoAligmentprocess){var a=[e.width(),s.height()];t.options.showDetailsPanel&&(a[2]=i.height()),t.autoAligmentprocess=setInterval(function(){var o=[e.width(),s.height()];t.options.showDetailsPanel&&(o[2]=i.height());for(var n=0;n<a.length;n++)if(a[n]!=o[n]){t.fixHeight(),t.fixPositionCapture(),a=o;break}t.options.showDetailsPanel&&(i.find(".dgwt-wcas-details-inner").height()-i.height()>2&&t.fixHeight())},10)}},getFormOffset:function(){var e=this.getFormWrapper(),s=this.getSuggestionsContainer(),i=this.options.orientation,a=e.outerHeight(),o=this.el.outerHeight(),n=this.el.offset(),l={top:n.top,left:n.left};if("auto"===i){var r=t(window).height(),c=t(window).scrollTop(),d=-c+n.top-a,g=c+r-(n.top+o+a);i=Math.max(d,g)===d?"top":"bottom"}if("top"===i){s[0].getBoundingClientRect().top;var u=e[0].getBoundingClientRect().top;s.css("height","auto"),u<s.height()&&s.height(u-10),l.top+=-s.outerHeight()}else l.top+=o;return l},getContext:function(){var t=this.el.closest("[data-wcas-context]"),e="";return t.length>0&&(e=t.data("wcas-context")),e},getFormWrapper:function(){return this.el.closest("[data-wcas-context]")},getSuggestionsContainer:function(){return t("."+this.options.containerClass+'[data-wcas-context="'+this.getContext()+'"]')},getDetailsContainer:function(){return t("."+this.options.containerDetailsClass+'[data-wcas-context="'+this.getContext()+'"]')},scrollDownSuggestions:function(){var t=this.getSuggestionsContainer();t[0].scrollTop=t[0].scrollHeight},isCursorAtEnd:function(){var t,e=this.el.val().length,s=this.element.selectionStart;return"number"==typeof s?s===e:!document.selection||((t=document.selection.createRange()).moveStart("character",-e),e===t.text.length)},onKeyPress:function(t){if(this.disabled||this.visible||t.which!==r||!this.currentValue){if(!this.disabled&&this.visible){switch(t.which){case i:this.el.val(this.currentValue),this.hide();break;case l:if(this.hint&&this.options.onHint&&this.isCursorAtEnd()){this.selectHint();break}return;case a:if(this.hint&&this.options.onHint)return void this.selectHint();if(-1===this.selectedIndex)return void this.hide();if(this.select(this.selectedIndex),!1===this.options.tabDisabled)return;break;case o:return void this.hide();case n:this.moveUp();break;case r:this.moveDown();break;default:return}t.stopImmediatePropagation(),t.preventDefault()}}else this.suggest()},onKeyUp:function(t){var e=this;if(!e.disabled){switch(t.which){case n:case r:return}clearTimeout(e.onChangeTimeout),e.currentValue!==e.el.val()&&(e.findBestHint(),e.options.deferRequestBy>0?e.onChangeTimeout=setTimeout(function(){e.onValueChange()},e.options.deferRequestBy):e.onValueChange())}},onValueChange:function(){if(this.ignoreValueChange)this.ignoreValueChange=!1;else{var e=this.options,s=this.el.val(),i=this.getQuery(s);this.selection&&this.currentValue!==i&&(this.selection=null,(e.onInvalidateSelection||t.noop).call(this.element)),clearTimeout(this.onChangeTimeout),this.currentValue=s,this.selectedIndex=-1,e.triggerSelectOnValidInput&&this.isExactMatch(i)?this.select(0):i.length<e.minChars?(t("."+this.options.closeTrigger).removeClass(this.options.closeTrigger),this.hide()):this.getSuggestions(i)}},isExactMatch:function(t){var e=this.suggestions;return 1===e.length&&e[0].value.toLowerCase()===t.toLowerCase()},canShowDetailsBox:function(){return 1==this.options.showDetailsPanel&&!this.isMobileMode()},isMobileMode:function(){return t(window).width()<this.options.mobileBreakpoint},getQuery:function(e){var s,i=this.options.delimiter;return i?(s=e.split(i),t.trim(s[s.length-1])):e},getSuggestionsLocal:function(e){var s,i=this.options,a=e.toLowerCase(),o=i.lookupFilter,n=parseInt(i.lookupLimit,10);return s={suggestions:t.grep(i.lookup,function(t){return o(t,e,a)})},n&&s.suggestions.length>n&&(s.suggestions=s.suggestions.slice(0,n)),s},getSuggestions:function(i){var a,o,n,l,r=this,c=r.options,d=c.serviceUrl,g=r.getFormWrapper();c.params[c.paramName]=i,void 0!==dgwt_wcas.current_lang&&(c.params.l=dgwt_wcas.current_lang),r.preloader("show","form","dgwt-wcas-inner-preloader"),g.addClass("dgwt-wcas-processing"),!1!==c.onSearchStart.call(r.element,c.params)&&(o=c.ignoreParams?null:c.params,t.isFunction(c.lookup)?c.lookup(i,function(t){r.suggestions=t.suggestions,r.suggest(),r.selectFirstSuggestion(t.suggestions),c.onSearchComplete.call(r.element,i,t.suggestions)}):(r.isLocal?a=r.getSuggestionsLocal(i):(t.isFunction(d)&&(d=d.call(r.element,i)),n=d+"?"+t.param(o||{}),a=r.cachedResponse[n]),a&&Array.isArray(a.suggestions)?(r.suggestions=a.suggestions,r.suggest(),r.selectFirstSuggestion(a.suggestions),c.onSearchComplete.call(r.element,i,a.suggestions)):r.isBadQuery(i)?c.onSearchComplete.call(r.element,i,[]):(r.abortAjax(),l={url:d,data:o,type:c.type,dataType:c.dataType},t.extend(l,c.ajaxSettings),s.object=r,s.ajaxSettings=l,e.debounce(function(){var e=s.object,a=s.ajaxSettings;e.currentRequest=t.ajax(a).done(function(t){var s;e.currentRequest=null,void 0!==(s=e.options.transformResult(t,i)).suggestions&&(e.processResponse(s,i,n),e.selectFirstSuggestion(s.suggestions),1===s.suggestions.length&&void 0!==s.suggestions[0].type&&"no-results"===s.suggestions[0].type?e.gaEvent(i,"Autocomplete Search without results"):e.gaEvent(i,"Autocomplete Search with results")),e.fixPositionCapture(),e.options.onSearchComplete.call(e.element,i,s.suggestions)}).fail(function(t,s,a){e.options.onSearchError.call(e.element,i,t,s,a)})},c.debounceWaitMs))))},getDetails:function(e){var s=this;s.options;if(!s.canShowDetailsBox())return!1;if(null!=e&&void 0!==e.type&&("string"!=typeof e.more_products||"more_products"!==e.more_products)){s.fixHeight();var i,a=s.getDetailsContainer(),o=s.prepareSuggestionObjectID(e);if(null!=(i=s.cachedDetails[o]))a.html(i.html),s.fixHeight(),s.fixPositionCapture();else{var n={action:dgwt_wcas.action_result_details,items:[]};if(t.each(s.suggestions,function(t,e){if(void 0!==e.type&&"more_products"!=e.type&&"headline"!=e.type){var i={objectID:s.prepareSuggestionObjectID(e),value:null!=e.value?e.value:""};n.items.push(i)}}),a.html(""),s.preloader("show","details","",!0),-1!=t.inArray(o,s.detailsRequestsSent))return;s.detailsRequestsSent.push(o),t.ajax({data:n,type:"post",url:dgwt_wcas.ajax_details_endpoint,success:function(t){var e="string"==typeof t?jQuery.parseJSON(t):t;if(void 0!==e.items)for(var i=0;i<e.items.length;i++){var o=e.items[i].objectID;if(s.cachedDetails[o]={html:e.items[i].html},void 0!==e.items[i].imageSrc&&e.items[i].imageSrc.length>0)(new Image).src=e.items[i].imageSrc}s.preloader("hide","details","",!0);var n=s.prepareSuggestionObjectID(s.suggestions[s.selectedIndex]);null!=s.cachedDetails[n]?a.html(s.cachedDetails[n].html):a.html(""),s.fixPositionCapture(),s.fixHeight()},error:function(t,e){s.preloader("hide","details","",!0),a.html(t),s.fixPositionCapture(),s.fixHeight()}})}t(document).trigger("dgwtWcasDetailsPanelLoaded",s)}},prepareSuggestionObjectID:function(t){var e="";return void 0!==t&&void 0!==t.type&&(null!=t.post_id&&(e=t.type+"__"+t.post_id,"product_variation"===t.type&&(e+="__"+t.variation_id),void 0!==t.post_type&&(e=t.type+"__"+t.post_id+"__"+t.post_type)),null!=t.term_id&&null!=t.taxonomy&&(e=t.type+"__"+t.term_id+"__"+t.taxonomy)),e},selectFirstSuggestion:function(e){var s=0,i=!1;this.canShowDetailsBox()&&("undefined"!=e&&e.length>0&&t.each(this.suggestions,function(t,e){if(void 0!==e.type&&"more_products"!=e.type&&"headline"!=e.type&&"no-results"!=e.type)return s=t,!1;void 0!==e.type&&"no-results"!==e.type||(i=!0)}),i||(this.getDetails(e[s]),this.activate(s)))},isBadQuery:function(t){if(!this.options.preventBadQueries)return!1;for(var e=this.badQueries,s=e.length;s--;)if(0===t.indexOf(e[s]))return!0;return!1},hide:function(){var e=this.getSuggestionsContainer(),s=this.getDetailsContainer();t.isFunction(this.options.onHide)&&this.visible&&this.options.onHide.call(this.element,container),this.visible=!1,this.selectedIndex=-1,clearTimeout(this.onChangeTimeout),e.hide(),e.removeClass(this.classes.suggestionsContainerOrientTop),s.hide(),t("body").removeClass("dgwt-wcas-open"),t("body").removeClass("dgwt-wcas-block-scroll"),t("body").removeClass("dgwt-wcas-is-details"),t("body").removeClass("dgwt-wcas-full-width"),t("body").removeClass("dgwt-wcas-nores"),t("body").removeClass("dgwt-wcas-details-outside"),t("body").removeClass("dgwt-wcas-details-right"),t("body").removeClass("dgwt-wcas-details-left"),null!=this.autoAligmentprocess&&(clearInterval(this.autoAligmentprocess),this.autoAligmentprocess=null),this.signalHint(null)},hideAfterClickOutsideListener:function(){var e=this;e.isMobileMode()||t(document).mouseup(function(s){if(e.visible){e.getSuggestionsContainer(),e.getDetailsContainer();var i=!(t(s.target).closest("."+e.options.searchFormClass).length>0||t(s.target).hasClass(e.options.searchFormClass)),a=!(t(s.target).closest("."+e.options.containerClass).length>0||t(s.target).hasClass(e.options.containerClass));if(e.canShowDetailsBox()){var o=!(t(s.target).closest("."+e.options.containerDetailsClass).length>0||t(s.target).hasClass(e.options.containerDetailsClass));i&&a&&o&&e.hide()}else i&&a&&e.hide()}})},suggest:function(){if(this.suggestions.length){var e,s=this,i=s.options,a=i.groupBy,o=i.formatResult,n=s.getQuery(s.currentValue),l=s.classes.suggestion,r=s.classes.selected,c=s.getSuggestionsContainer(),d=s.getDetailsContainer(),g=t(s.noSuggestionsContainer),u=i.beforeRender,h="";i.triggerSelectOnValidInput&&s.isExactMatch(n)?s.select(0):(t("body").removeClass("dgwt-wcas-nores"),t.each(s.suggestions,function(s,r){var c="",g=!1;if(a&&(h+=function(t,s){var i=t.data[a];return e===i?"":'<div class="autocomplete-group"><strong>'+(e=i)+"</strong></div>"}(r,0)),void 0===r.type||"product"!=r.type&&"product_variation"!=r.type){var u=l,w="dgwt-wcas-st",p="",m="",f="",v=!0;"product_cat"===r.taxonomy?(u+=" dgwt-wcas-suggestion-tax dgwt-wcas-suggestion-cat",i.showHeadings||(p+='<span class="dgwt-wcas-st--direct-headline">'+dgwt_wcas.labels.category+"</span>"),void 0!==r.breadcrumbs&&r.breadcrumbs&&(f=r.breadcrumbs+" > "+r.value,m+='<span class="dgwt-wcas-st-breadcrumbs">'+dgwt_wcas.labels.in+" "+r.breadcrumbs+"</span>")):"product_tag"===r.taxonomy?(u+=" dgwt-wcas-suggestion-tax dgwt-wcas-suggestion-tag",i.showHeadings||(p+='<span class="dgwt-wcas-st--direct-headline">'+dgwt_wcas.labels.tag+"</span>")):i.isPremium&&r.taxonomy===i.taxonomyBrands?(u+=" dgwt-wcas-suggestion-tax dgwt-wcas-suggestion-brand",i.showHeadings||(p+='<span class="dgwt-wcas-st--direct-headline">'+dgwt_wcas.labels.brand+"</span>")):i.isPremium&&"post"===r.type?(u+=" dgwt-wcas-suggestion-pt dgwt-wcas-suggestion-tp-post",i.showHeadings||(p+='<span class="dgwt-wcas-st--direct-headline">'+dgwt_wcas.labels.post+"</span>")):i.isPremium&&"page"===r.type?(u+=" dgwt-wcas-suggestion-pt dgwt-wcas-suggestion-pt-page",i.showHeadings||(p+='<span class="dgwt-wcas-st--direct-headline">'+dgwt_wcas.labels.page+"</span>")):"more_products"===r.type?(u+=" js-dgwt-wcas-suggestion-more dgwt-wcas-suggestion-more",w="dgwt-wcas-st-more",r.value=dgwt_wcas.labels.show_more+" ("+r.total+")",v=!1):i.showHeadings&&"headline"===r.type?(u+=" js-dgwt-wcas-suggestion-headline dgwt-wcas-suggestion-headline",void 0!==dgwt_wcas.labels[r.value+"_plu"]&&(r.value=dgwt_wcas.labels[r.value+"_plu"]),v=!1):(u+=" dgwt-wcas-suggestion-nores",r.value=dgwt_wcas.labels.no_results,v=!1,!0===i.showDetailsPanel&&d.html(""),t("body").addClass("dgwt-wcas-nores")),f=f.length>0?' title="'+f+'"':"",h+='<div class="'+u+'" data-index="'+s+'">',h+="<span"+f+' class="'+w+'">'+p+o(r.value,n,v)+m+"</span>",h+="</div>"}else!0===i.showImage&&void 0!==r.thumb_html&&(g=!0),c+=void 0!==r.post_id?'data-post-id="'+r.post_id+'" ':"",c+=void 0!==r.taxonomy?'data-taxonomy="'+r.taxonomy+'" ':"",c+=void 0!==r.term_id?'data-term-id="'+r.term_id+'" ':"",h+='<div class="'+l+' dgwt-wcas-suggestion-product" data-index="'+s+'" '+c+">",g&&(h+='<span class="dgwt-wcas-si">'+r.thumb_html+"</span>"),h+=g?'<div class="dgwt-wcas-content-wrapp">':"",h+='<span class="dgwt-wcas-st">',h+='<span class="dgwt-wcas-st-title">'+o(r.value,n,!0)+"</span>",!0===i.showSKU&&void 0!==r.sku&&r.sku.length>0&&(h+='<span class="dgwt-wcas-sku">('+dgwt_wcas.labels.sku_label+" "+o(r.sku,n,!0)+")</span>"),!0===i.showDescription&&void 0!==r.desc&&r.desc&&(h+='<span class="dgwt-wcas-sd">'+o(r.desc,n,!0)+"</span>"),h+="</span>",!0===i.showPrice&&void 0!==r.price&&(h+='<span class="dgwt-wcas-sp">'+r.price+"</span>"),!0===i.showFeaturedBadge&&!0===r.on_sale&&(h+='<span class="dgwt-wcas-badge dgwt-wcas-badge-os">'+i.saleBadgeText+"</span>"),!0===i.showFeaturedBadge&&!0===r.featured&&(h+='<span class="dgwt-wcas-badge dgwt-wcas-badge-f">'+i.featuredBadgeText+"</span>"),h+=g?"</div>":"",h+="</div>"}),this.adjustContainerWidth(),g.detach(),c.html(h),t.isFunction(u)&&u.call(s.element,c,s.suggestions),c.show(),t("body").addClass("dgwt-wcas-open"),s.automaticAlignment(),!0===i.showDetailsPanel&&(t("body").addClass("dgwt-wcas-is-details"),d.show(),s.fixHeight()),i.autoSelectFirst&&(s.selectedIndex=0,c.scrollTop(0),c.children("."+l).first().addClass(r)),s.visible=!0,s.fixPositionCapture(),"top"===s.options.orientation&&(s.getSuggestionsContainer().addClass(s.classes.suggestionsContainerOrientTop),t("body").addClass("dgwt-wcas-block-scroll"),setTimeout(function(){s.scrollDownSuggestions()},300)),s.findBestHint())}else this.hide()},adjustContainerWidth:function(){var e,s=this.options,i=t("body"),a=this.getFormWrapper(),o=this.getSuggestionsContainer(),n=this.getDetailsContainer(),l=this.getFormOffset(),r=getComputedStyle(a[0]).width;if(r=Math.round(parseFloat(r.replace("px",""))),"auto"===s.width&&(e=this.el.outerWidth(),o.css("width",e+"px")),!0===s.showDetailsPanel){if(a.width()>=550)return i.addClass("dgwt-wcas-full-width"),r%2==0?(o.css("width",Math.round(r/2)),n.css("width",Math.round(r/2))):(o.css("width",Math.floor(r/2)),n.css("width",Math.ceil(r/2))),i.removeClass("dgwt-wcas-details-left"),i.removeClass("dgwt-wcas-details-right"),void(!0===s.isRtl?n.css("left","0"):o.css("left",r/2+l.left+"px"));i.addClass("dgwt-wcas-details-right")}},findBestHint:function(){var e=this.el.val().toLowerCase(),s=null;e&&(t.each(this.suggestions,function(t,i){var a=0===i.value.toLowerCase().indexOf(e);return a&&(s=i),!a}),this.signalHint(s))},signalHint:function(e){var s="";e&&(s=this.currentValue+e.value.substr(this.currentValue.length)),this.hintValue!==s&&(this.hintValue=s,this.hint=e,(this.options.onHint||t.noop)(s))},preloader:function(e,s,i,a){var o,n,l="dgwt-wcas-preloader-wrapp",r=null==i?l:l+" "+i;if("form"===s?n=this.getFormWrapper().find(".dgwt-wcas-preloader"):"details"===s&&(n=t(this.detailsContainer)),1==dgwt_wcas.show_preloader&&0!=n.length)if(!0===a)if("hide"!==e){if("show"===e){var c=this.options.isRtl?"-rtl":"";o='<div class="'+r+'"><img class="dgwt-wcas-placeholder-preloader" src="'+dgwt_wcas.img_url+"placeholder"+c+'.png" /></div>',n.html(o)}}else t(l).remove();else"hide"===e?n.removeClass(i):n.addClass(i)},verifySuggestionsFormat:function(e){return e.length&&"string"==typeof e[0]?t.map(e,function(t){return{value:t,data:null}}):e},validateOrientation:function(e,s){return e=t.trim(e||"").toLowerCase(),-1===t.inArray(e,["auto","bottom","top"])&&(e=s),e},processResponse:function(t,e,s){var i=this.options;t.suggestions=this.verifySuggestionsFormat(t.suggestions),i.noCache||(this.cachedResponse[s]=t,i.preventBadQueries&&!t.suggestions.length&&this.badQueries.push(e)),e===this.getQuery(this.currentValue)&&("top"===this.options.orientation&&t.suggestions.reverse(),this.suggestions=t.suggestions,this.suggest())},activate:function(e){var s,i=this.classes.selected,a=this.getSuggestionsContainer(),o=a.find("."+this.classes.suggestion);return a.find("."+i).removeClass(i),this.selectedIndex=e,-1!==this.selectedIndex&&o.length>this.selectedIndex?(s=o.get(this.selectedIndex),t(s).addClass(i),s):null},selectHint:function(){var e=t.inArray(this.hint,this.suggestions);this.select(e)},select:function(t){this.hide(),this.onSelect(t)},moveUp:function(){if(-1!==this.selectedIndex)return 0===this.selectedIndex?(this.getSuggestionsContainer().children("."+this.classes.suggestion).first().removeClass(this.classes.selected),this.selectedIndex=-1,this.ignoreValueChange=!1,this.el.val(this.currentValue),void this.findBestHint()):void this.adjustScroll(this.selectedIndex-1)},moveDown:function(){this.selectedIndex!==this.suggestions.length-1&&this.adjustScroll(this.selectedIndex+1)},adjustScroll:function(e){var s=this.activate(e);if(this.getDetails(this.suggestions[e]),s&&!this.canShowDetailsBox()){var i,a,o,n=this.getSuggestionsContainer(),l=t(s).outerHeight();i=s.offsetTop,o=(a=n.scrollTop())+this.options.maxHeight-l,i<a?n.scrollTop(i):i>o&&n.scrollTop(i-this.options.maxHeight+l),this.options.preserveInput||(this.ignoreValueChange=!0,this.el.val(this.getValue(this.suggestions[e].value))),this.signalHint(null)}},onSelect:function(e){var s=this.options.onSelect,i=this.suggestions[e];void 0===i.type||"more_products"!==i.type?(this.currentValue=this.getValue(i.value),this.currentValue===this.el.val()||this.options.preserveInput||this.el.val(this.currentValue),i.url.length>0&&(window.location.href=i.url),this.signalHint(null),this.suggestions=[],this.selection=i,t.isFunction(s)&&s.call(this.element,i)):this.el.closest("form").trigger("submit")},getValue:function(t){var e,s,i=this.options.delimiter;return i?1===(s=(e=this.currentValue).split(i)).length?t:e.substr(0,e.length-s[s.length-1].length)+t:t},dispose:function(){this.el.off(".autocomplete").removeData("autocomplete"),t(window).off("resize.autocomplete",this.fixPositionCapture),t("."+this.options.containerClass).remove(),t("."+this.options.containerDetailsClass).remove()},enableOverlayMobile:function(){var e=this;if("on"!==e.overlayMobileState){e.overlayMobileState="on";var s,i=e.getFormWrapper(),a=e.getSuggestionsContainer();t("html").addClass("dgwt-wcas-overlay-mobile-on"),'<div class="js-dgwt-wcas-overlay-mobile dgwt-wcas-overlay-mobile">','<div class="dgwt-wcas-om-bar js-dgwt-wcas-om-bar">','<span class="dgwt-wcas-om-return js-dgwt-wcas-om-return">','<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" color="#FFF">','<path fill="#FFF" d="M14 6.125H3.351l4.891-4.891L7 0 0 7l7 7 1.234-1.234L3.35 7.875H14z" fill-rule="evenodd"></path>',"</svg>","</span>","</div>","</div>",t(e.options.mobileOverlayWrapper).append('<div class="js-dgwt-wcas-overlay-mobile dgwt-wcas-overlay-mobile"><div class="dgwt-wcas-om-bar js-dgwt-wcas-om-bar"><span class="dgwt-wcas-om-return js-dgwt-wcas-om-return"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" color="#FFF"><path fill="#FFF" d="M14 6.125H3.351l4.891-4.891L7 0 0 7l7 7 1.234-1.234L3.35 7.875H14z" fill-rule="evenodd"></path></svg></span></div></div>'),(s=t(".js-dgwt-wcas-overlay-mobile")).css("zIndex",999999),i.after('<span class="js-dgwt-wcas-om-hook"></span>'),i.appendTo(".js-dgwt-wcas-om-bar"),a.appendTo(".js-dgwt-wcas-om-bar"),i.addClass("dgwt-wcas-search-wrapp-mobile"),i.hasClass("dgwt-wcas-has-submit")&&(i.addClass("dgwt-wcas-has-submit-off"),i.removeClass("dgwt-wcas-has-submit")),i.find("."+e.options.searchInputClass).focus(),t(document).on("click",".js-dgwt-wcas-om-return",function(t){e.disableOverlayMobile(s)})}},disableOverlayMobile:function(e){var s=this,i=s.getSuggestionsContainer(),a=t(".js-dgwt-wcas-om-bar").find("."+s.options.searchFormClass);a.hasClass("dgwt-wcas-has-submit-off")&&(a.removeClass("dgwt-wcas-has-submit-off"),a.addClass("dgwt-wcas-has-submit")),a.removeClass("dgwt-wcas-search-wrapp-mobile"),t("html").removeClass("dgwt-wcas-overlay-mobile-on"),i.appendTo("body"),i.removeAttr("body-scroll-lock-ignore"),t(".js-dgwt-wcas-om-hook").after(a),t(".js-dgwt-wcas-overlay-mobile").remove(),t(".js-dgwt-wcas-om-hook").remove(),setTimeout(function(){a.find("."+s.options.searchInputClass).val("");var t=a.find(".dgwt-wcas-close");a.length>0&&t.removeClass("dgwt-wcas-close")},150),s.overlayMobileState="off"},elementOrParentIsFixed:function(e){var s=e.add(e.parents()),i=!1;return s.each(function(){if("fixed"===t(this).css("position"))return i=!0,!1}),i},gaEvent:function(t,e){if(this.options.sendGAEvents)try{if("undefined"!=typeof gtag)return void gtag("event","autocomplete_search",{event_label:t,event_category:e});"undefined"!=typeof ga&&ga("send",{hitType:"event",eventCategory:e,eventAction:"autocomplete_search",eventLabel:t})}catch(t){}}},t.fn.dgwtWcasAutocomplete=function(e,s){return arguments.length?this.each(function(){var i=t(this),a=i.data("autocomplete");"string"==typeof e?a&&"function"==typeof a[e]&&a[e](s):(a&&a.dispose&&a.dispose(),a=new d(this,e),i.data("autocomplete",a))}):this.first().data("autocomplete")},t.fn.autocomplete||(t.fn.autocomplete=t.fn.dgwtWcasAutocomplete),function(){function e(e){var s=t(".dgwt-wcas-search-wrapp[data-wcas-context]"),i=[];s.length>0&&s.each(function(){var s=t(this).attr("data-wcas-context");if(-1==t.inArray(s,i))i.push(s);else{var a=Math.random().toString(36).substring(2,6);if(t(this).attr("data-wcas-context",a),!e){var o=t('.dgwt-wcas-suggestions-wrapp[data-wcas-context="'+s+'"]'),n=t('.dgwt-wcas-details-wrapp[data-wcas-context="'+s+'"]');o.length>0&&t(o[o.length-1]).attr("data-wcas-context",a),n.length>0&&t(n[n.length-1]).attr("data-wcas-context",a)}}})}t(window).on("load",function(){t(".dgwt-wcas-search-submit").length>0&&t(".dgwt-wcas-search-submit").each(function(){var e=t(this).closest(".dgwt-wcas-search-wrapp").find(".dgwt-wcas-preloader");1==dgwt_wcas.is_rtl?e.css("left",6+t(this).outerWidth()+"px"):e.css("right",t(this).outerWidth()+"px")})}),t(document).ready(function(){e(!0);var s=1==dgwt_wcas.show_details_box,i=dgwt_wcas.mobile_breakpoint;(jQuery(window).width()<i||"ontouchend"in document)&&(s=!1),t(".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:s,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.labels.sale_badge,featuredBadgeText:dgwt_wcas.labels.featured_badge,isRtl:1==dgwt_wcas.is_rtl,showHeadings:1==dgwt_wcas.show_headings,isPremium:1==dgwt_wcas.is_premium,taxonomyBrands:dgwt_wcas.taxonomy_brands,overlayMobile:1==dgwt_wcas.overlay_mobile,mobileBreakpoint:i,mobileOverlayWrapper:dgwt_wcas.mobile_overlay_wrapper,debounceWaitMs:dgwt_wcas.debounce_wait_ms,sendGAEvents:dgwt_wcas.send_ga_events})}),t(window).on("load",function(){e(!1)})}()});
|
1 |
+
!function(t){"use strict";"function"==typeof define&&define.amd?define(["jquery"],t):"object"==typeof exports&&"function"==typeof require?t(require("jquery")):t(jQuery)}(function(t){"use strict";var e={escapeRegExChars:function(t){return t.replace(/[|\\{}()[\]^$+*?.]/g,"\\$&")},createNode:function(t){var e=document.createElement("div");return e.className=t,e.style.position="absolute",e.style.display="none",e.setAttribute("unselectable","on"),e},highlight:function(t,s){if(dgwt_wcas.is_premium){var i,a=s.split(/ /);if(a)for(a=a.sort(function(t,e){return e.length-t.length}),i=0;i<a.length;i++)if(a[i]&&a[i].length>1){var o="("+e.escapeRegExChars(a[i].trim())+")";t=t.replace(new RegExp(o,"gi"),"<strong>$1</strong>")}}else o="("+e.escapeRegExChars(s)+")",t=t.replace(new RegExp(o,"gi"),"<strong>$1</strong>");return t},debounce:function(t,e){var i,a=(new Date).getUTCMilliseconds();if(0===s.id.length)return s.id=a,void t();s.id=a,i=setTimeout(function(){a===s.id?(t(),s.id=""):clearTimeout(i)},e)},mouseHoverDebounce:function(e,s,i){var a;a=setTimeout(function(){t(s+":hover").length>0?e():clearTimeout(a)},i)},getActiveInstance:function(){var e,s=t(".dgwt-wcas-search-wrapp.dgwt-wcas-active");return s.length>0&&s.each(function(){var s=t(this).find(".dgwt-wcas-search-input");if("object"==typeof s.data("autocomplete"))return e=s.data("autocomplete"),!1}),e}},s={id:"",callback:null,ajaxSettings:null,object:null},i=27,a=9,o=13,n=38,r=39,l=40,c=t.noop;function d(e,s){this.element=e,this.el=t(e),this.suggestions=[],this.badQueries=[],this.selectedIndex=-1,this.currentValue=this.element.value,this.timeoutId=null,this.cachedResponse={},this.cachedDetails={},this.detailsRequestsSent=[],this.onChangeTimeout=null,this.onChange=null,this.isLocal=!1,this.suggestionsContainer=null,this.detailsContainer=null,this.autoAligmentprocess=null,this.noSuggestionsContainer=null,this.options=t.extend(!0,{},d.defaults,s),this.classes={selected:"dgwt-wcas-suggestion-selected",suggestion:"dgwt-wcas-suggestion",suggestionsContainerOrientTop:"dgwt-wcas-suggestions-wrapp--top"},this.hint=null,this.hintValue="",this.selection=null,this.overlayMobileState="off",this.initialize(),this.setOptions(s)}d.utils=e,t.DgwtWcasAutocompleteSearch=d,d.defaults={ajaxSettings:{},autoSelectFirst:!1,appendTo:"body",serviceUrl:null,lookup:null,onSelect: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:function(t,s,i){if(!s)return t;i&&(t=e.highlight(t,s));return t.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/<sup/g,"<sup").replace(/<\/sup/g,"</sup").replace(/sup>/g,"sup>").replace(/<(\/?strong)>/g,"<$1>")},delimiter:null,zIndex:999999999,type:"GET",noCache:!1,isRtl:!1,onSearchStart:c,onSearchComplete:c,onSearchError:c,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,isPremium:!1,overlayMobile:!1,preventBadQueries:!0,lookupFilter:function(t,e,s){return-1!==t.value.toLowerCase().indexOf(s)},paramName:"query",transformResult:function(e){return"string"==typeof e?t.parseJSON(e):e},noSuggestionNotice:"No results",orientation:"bottom",forceFixPosition:!1,positionFixed:!1,debounceWaitMs:400,sendGAEvents:!0},d.prototype={initialize:function(){var e=this;e.element.setAttribute("autocomplete","off"),e.createContainers(),e.registerEventsSearchBar(),e.registerEventsSuggestions(),e.registerEventsDetailsPanel(),e.registerEventsFixedMenu(),e.fixPositionCapture=function(){e.adjustContainerWidth(),e.visible&&e.fixPosition()},t(window).on("resize.autocomplete",e.fixPositionCapture),e.initMobileMode(),e.hideAfterClickOutsideListener(),e.suggestionsContainer.addClass("js-dgwt-wcas-initialized"),e.detailsContainer&&e.detailsContainer.length>0&&e.detailsContainer.addClass("js-dgwt-wcas-initialized")},createContainers:function(e){var s=this.options;0==t("."+s.containerClass).length?(this.suggestionsContainer=t(d.utils.createNode(s.containerClass)),this.suggestionsContainer.appendTo(s.appendTo||"body"),this.suggestionsContainer.addClass("woocommerce"),!0===s.showImage&&this.suggestionsContainer.addClass("dgwt-wcas-has-img"),!0===s.showPrice&&this.suggestionsContainer.addClass("dgwt-wcas-has-price"),!0===s.showDescription&&this.suggestionsContainer.addClass("dgwt-wcas-has-desc"),!0===s.showSKU&&this.suggestionsContainer.addClass("dgwt-wcas-has-sku"),!0===s.showHeadings&&this.suggestionsContainer.addClass("dgwt-wcas-has-headings"),"auto"!==s.width&&this.suggestionsContainer.width(s.width)):this.suggestionsContainer=t("."+this.options.containerClass),this.canShowDetailsBox()&&(0==t("."+s.containerDetailsClass).length?(this.detailsContainer=t(d.utils.createNode(s.containerDetailsClass)),this.detailsContainer.appendTo(s.appendTo||"body"),this.detailsContainer.addClass("woocommerce")):this.detailsContainer=t("."+s.containerDetailsClass))},registerEventsSearchBar:function(){var s=this;t(document).on("click.autocomplete","."+s.options.closeTrigger,function(){var s=e.getActiveInstance();s.hide(),s.clear(!1),t(this).removeClass(s.options.closeTrigger),t(this).closest("."+s.options.searchFormClass).find("."+s.options.searchInputClass).val("").focus()}),s.el.on("keydown.autocomplete",function(t){s.onKeyPress(t)}),s.el.on("keyup.autocomplete",function(t){s.onKeyUp(t)}),s.el.on("blur.autocomplete",function(){s.onBlur()}),s.el.on("focus.autocomplete",function(){s.onFocus()}),s.el.on("change.autocomplete",function(t){s.onKeyUp(t)}),s.el.on("input.autocomplete",function(t){s.onKeyUp(t)})},registerEventsSuggestions:function(){var s="."+this.classes.suggestion;this.getSuggestionsContainer().hasClass("js-dgwt-wcas-initialized")||(t(document).on("mouseenter.autocomplete",s,function(){var s=e.getActiveInstance(),i=t(this).data("index"),a='.dgwt-wcas-suggestion[data-index="'+i+'"]';s.selectedIndex!=i&&e.mouseHoverDebounce(function(){s.selectedIndex!==i&&(s.getDetails(s.suggestions[i]),s.activate(i))},a,100)}),t(document).on("click.autocomplete",s,function(){e.getActiveInstance().select(t(this).data("index"))}),t(document).on("click.autocomplete","."+this.options.containerClass,function(){var t=e.getActiveInstance();clearTimeout(t.blurTimeoutId)}))},registerEventsDetailsPanel:function(){var s=this.getDetailsContainer();this.canShowDetailsBox()&&!s.hasClass("js-dgwt-wcas-initialized")&&(t(document).on("click.autocomplete","."+this.options.containerDetailsClass,function(){var t=e.getActiveInstance();clearTimeout(t.blurTimeoutId)}),t(document).on("change",'[name="js-dgwt-wcas-quantity"]',function(e){t(this).closest(".js-dgwt-wcas-pd-addtc").find("[data-quantity]").attr("data-quantity",t(this).val())}))},registerEventsFixedMenu:function(){var e=this;t(window).on("scroll",function(){if(e.suggestions.length>0&&e.elementOrParentIsFixed(e.getFormWrapper()))if(0===t(window).scrollTop()){[1,10,20,30,40,50,60,70,80,90,120,140,170,200,250,400,700,1e3,2e3].forEach(function(t){setTimeout(function(){e.fixHeight(),e.fixPositionCapture()},t)})}else e.fixHeight(),e.fixPositionCapture()})},initMobileMode:function(){var t=this;if(t.options.overlayMobile&&t.isMobileMode()){var e=t.getFormWrapper();e.hasClass("js-dgwt-wcas-icon-mobile")&&e.prepend('<div class="dgwt-wcas-icon-handler">'+dgwt_wcas.magnifier_icon+"</div>"),e.prepend('<div class="js-dgwt-wcas-enable-mobile-form dgwt-wcas-enable-mobile-form"></div>'),e.find(".js-dgwt-wcas-enable-mobile-form").on("click",function(e){t.enableOverlayMobile()})}},onFocus:function(){t("."+this.options.searchFormClass).removeClass("dgwt-wcas-active"),this.getFormWrapper().addClass("dgwt-wcas-active"),this.fixPositionCapture(),this.el.val().length>=this.options.minChars&&this.onValueChange()},onBlur:function(){var e=this,s=e.options,i=e.el.val(),a=e.getQuery(i);e.blurTimeoutId=setTimeout(function(){e.hide(),e.selection&&e.currentValue!==a&&(s.onInvalidateSelection||t.noop).call(e.element)},200)},abortAjax:function(){this.currentRequest&&(this.currentRequest.abort(),this.currentRequest=null)},setOptions:function(e){var s=this,i=s.getSuggestionsContainer(),a=t.extend({},s.options,e);(s.isLocal=Array.isArray(a.lookup),s.isLocal&&(a.lookup=s.verifySuggestionsFormat(a.lookup)),a.orientation=s.validateOrientation(a.orientation,"bottom"),i.css({"max-height":s.canShowDetailsBox()?"none":a.maxHeight+"px",width:a.width+"px","z-index":a.zIndex}),!0===a.showDetailsPanel)&&s.getDetailsContainer().css({"z-index":a.zIndex-1});a.onSearchComplete=function(){s.getFormWrapper().removeClass("dgwt-wcas-processing"),s.preloader("hide","form","dgwt-wcas-inner-preloader"),s.preloader("show","form",a.closeTrigger)},this.options=a},clearCache:function(){this.cachedResponse={},this.cachedDetails={},this.badQueries=[]},clear:function(t){t&&this.clearCache(),this.currentValue="",this.suggestions=[]},disable:function(){this.disabled=!0,clearTimeout(this.onChangeTimeout),this.abortAjax()},enable:function(){this.disabled=!1},fixPosition:function(){var t=this.getFormOffset();this.getSuggestionsContainer().css(t),this.canShowDetailsBox()&&this.fixPositionDetailsBox()},fixPositionDetailsBox:function(){var e=this.getFormWrapper(),s=this.getSuggestionsContainer(),i=this.getDetailsContainer(),a=this.getFormOffset(),o=a.left;if(0==i.length)return!1;var n=!0===this.options.isRtl?1:2,r=Math.round(a.left);if(a.left=r+Math.round(s.width()+n),i.css(a),e.width()>=550)return t("body").removeClass("dgwt-wcas-details-outside"),t("body").removeClass("dgwt-wcas-details-right"),t("body").removeClass("dgwt-wcas-details-left"),void(!0===this.options.isRtl&&(s.css("left",r+Math.round(i.width()+n)+"px"),i.css("left",o+"px")));var l=t(window).width(),c=i.width(),d=i.offset();t("body").addClass("dgwt-wcas-details-outside"),!0===this.options.isRtl&&(a.left=a.left+1);var g=!1,u=!1;l<d.left+c&&(g=!0,t("body").removeClass("dgwt-wcas-details-right"),t("body").addClass("dgwt-wcas-details-left"),i.css("left",Math.round(parseFloat(s.css("left").replace("px","")))-i.outerWidth()+"px")),(d=i.offset()).left<1&&(u=!0,t("body").removeClass("dgwt-wcas-details-left"),t("body").addClass("dgwt-wcas-details-right")),u&&g?(t("body").removeClass("dgwt-wcas-details-left"),t("body").removeClass("dgwt-wcas-details-right"),t("body").addClass("dgwt-wcas-details-notfit")):t("body").removeClass("dgwt-wcas-details-notfit")},fixHeight:function(){if(1!=this.options.showDetailsPanel)return!1;var t=this.getSuggestionsContainer(),e=this.getDetailsContainer();t.css("height","auto"),e.css("height","auto");var s=t.outerHeight(),i=e.outerHeight();return t.find(".dgwt-wcas-suggestion:last-child").removeClass("dgwt-wcas-suggestion-no-border-bottom"),!(s<=340&&i<=340)&&(t.find(".dgwt-wcas-suggestion:last-child").addClass("dgwt-wcas-suggestion-no-border-bottom"),i<s&&e.css("height",s+"px"),s<i&&t.css("height",i+"px"),!1)},automaticAlignment:function(){var t=this,e=t.getFormWrapper().find(".dgwt-wcas-search-input"),s=t.getSuggestionsContainer(),i=t.getDetailsContainer();if(null==t.autoAligmentprocess){var a=[e.width(),s.height()];t.options.showDetailsPanel&&(a[2]=i.height()),t.autoAligmentprocess=setInterval(function(){var o=[e.width(),s.height()];t.options.showDetailsPanel&&(o[2]=i.height());for(var n=0;n<a.length;n++)if(a[n]!=o[n]){t.fixHeight(),t.fixPositionCapture(),a=o;break}t.options.showDetailsPanel&&(i.find(".dgwt-wcas-details-inner").height()-i.height()>2&&t.fixHeight())},10)}},getFormOffset:function(){var e=this.getFormWrapper(),s=this.getSuggestionsContainer(),i=this.options.orientation,a=e.outerHeight(),o=this.el.outerHeight(),n=this.el.offset(),r={top:n.top,left:n.left};if("auto"===i){var l=t(window).height(),c=t(window).scrollTop(),d=-c+n.top-a,g=c+l-(n.top+o+a);i=Math.max(d,g)===d?"top":"bottom"}if("top"===i){s[0].getBoundingClientRect().top;var u=e[0].getBoundingClientRect().top;s.css("height","auto"),u<s.height()&&s.height(u-10),r.top+=-s.outerHeight()}else r.top+=o;return r},getFormWrapper:function(){return this.el.closest("."+this.options.searchFormClass)},getSuggestionsContainer:function(){return t("."+this.options.containerClass)},getDetailsContainer:function(){return t("."+this.options.containerDetailsClass)},scrollDownSuggestions:function(){var t=this.getSuggestionsContainer();t[0].scrollTop=t[0].scrollHeight},isCursorAtEnd:function(){var t,e=this.el.val().length,s=this.element.selectionStart;return"number"==typeof s?s===e:!document.selection||((t=document.selection.createRange()).moveStart("character",-e),e===t.text.length)},onKeyPress:function(t){if(this.disabled||this.visible||t.which!==l||!this.currentValue){if(!this.disabled&&this.visible){switch(t.which){case i:this.el.val(this.currentValue),this.hide();break;case r:if(this.hint&&this.options.onHint&&this.isCursorAtEnd()){this.selectHint();break}return;case a:if(this.hint&&this.options.onHint)return void this.selectHint();if(-1===this.selectedIndex)return void this.hide();if(this.select(this.selectedIndex),!1===this.options.tabDisabled)return;break;case o:return void this.hide();case n:this.moveUp();break;case l:this.moveDown();break;default:return}t.stopImmediatePropagation(),t.preventDefault()}}else this.suggest()},onKeyUp:function(t){var e=this;if(!e.disabled){switch(t.which){case n:case l:return}clearTimeout(e.onChangeTimeout),e.currentValue!==e.el.val()&&(e.findBestHint(),e.options.deferRequestBy>0?e.onChangeTimeout=setTimeout(function(){e.onValueChange()},e.options.deferRequestBy):e.onValueChange())}},onValueChange:function(){if(this.ignoreValueChange)this.ignoreValueChange=!1;else{var e=this.options,s=this.el.val(),i=this.getQuery(s);this.selection&&this.currentValue!==i&&(this.selection=null,(e.onInvalidateSelection||t.noop).call(this.element)),clearTimeout(this.onChangeTimeout),this.currentValue=s,this.selectedIndex=-1,e.triggerSelectOnValidInput&&this.isExactMatch(i)?this.select(0):i.length<e.minChars?(t("."+this.options.closeTrigger).removeClass(this.options.closeTrigger),this.hide()):this.getSuggestions(i)}},isExactMatch:function(t){var e=this.suggestions;return 1===e.length&&e[0].value.toLowerCase()===t.toLowerCase()},canShowDetailsBox:function(){return 1==this.options.showDetailsPanel&&!this.isMobileMode()},isMobileMode:function(){return t(window).width()<this.options.mobileBreakpoint},getQuery:function(e){var s,i=this.options.delimiter;return i?(s=e.split(i),t.trim(s[s.length-1])):e},getSuggestionsLocal:function(e){var s,i=this.options,a=e.toLowerCase(),o=i.lookupFilter,n=parseInt(i.lookupLimit,10);return s={suggestions:t.grep(i.lookup,function(t){return o(t,e,a)})},n&&s.suggestions.length>n&&(s.suggestions=s.suggestions.slice(0,n)),s},getSuggestions:function(i){var a,o,n,r,l=this,c=l.options,d=c.serviceUrl,g=l.getFormWrapper();c.params[c.paramName]=i,void 0!==dgwt_wcas.current_lang&&(c.params.l=dgwt_wcas.current_lang),l.preloader("show","form","dgwt-wcas-inner-preloader"),g.addClass("dgwt-wcas-processing"),!1!==c.onSearchStart.call(l.element,c.params)&&(o=c.ignoreParams?null:c.params,t.isFunction(c.lookup)?c.lookup(i,function(t){l.suggestions=t.suggestions,l.suggest(),l.selectFirstSuggestion(t.suggestions),c.onSearchComplete.call(l.element,i,t.suggestions)}):(l.isLocal?a=l.getSuggestionsLocal(i):(t.isFunction(d)&&(d=d.call(l.element,i)),n=d+"?"+t.param(o||{}),a=l.cachedResponse[n]),a&&Array.isArray(a.suggestions)?(l.suggestions=a.suggestions,l.suggest(),l.selectFirstSuggestion(a.suggestions),c.onSearchComplete.call(l.element,i,a.suggestions)):l.isBadQuery(i)?c.onSearchComplete.call(l.element,i,[]):(l.abortAjax(),r={url:d,data:o,type:c.type,dataType:c.dataType},t.extend(r,c.ajaxSettings),s.object=l,s.ajaxSettings=r,e.debounce(function(){var e=s.object,a=s.ajaxSettings;e.currentRequest=t.ajax(a).done(function(t){var s;e.currentRequest=null,void 0!==(s=e.options.transformResult(t,i)).suggestions&&(e.processResponse(s,i,n),e.selectFirstSuggestion(s.suggestions),1===s.suggestions.length&&void 0!==s.suggestions[0].type&&"no-results"===s.suggestions[0].type?e.gaEvent(i,"Autocomplete Search without results"):e.gaEvent(i,"Autocomplete Search with results")),e.fixPositionCapture(),e.options.onSearchComplete.call(e.element,i,s.suggestions)}).fail(function(t,s,a){e.options.onSearchError.call(e.element,i,t,s,a)})},c.debounceWaitMs))))},getDetails:function(e){var s=this;if(!s.canShowDetailsBox())return!1;if(null!=e&&void 0!==e.type&&("string"!=typeof e.more_products||"more_products"!==e.more_products)){s.fixHeight();var i,a=s.getDetailsContainer(),o=s.prepareSuggestionObjectID(e);if(null!=(i=s.cachedDetails[o]))a.html(i.html),s.fixHeight(),s.fixPositionCapture();else{var n={action:dgwt_wcas.action_result_details,items:[]};if(t.each(s.suggestions,function(t,e){if(void 0!==e.type&&"more_products"!=e.type&&"headline"!=e.type){var i={objectID:s.prepareSuggestionObjectID(e),value:null!=e.value?e.value:""};n.items.push(i)}}),a.html(""),s.preloader("show","details","",!0),-1!=t.inArray(o,s.detailsRequestsSent))return;s.detailsRequestsSent.push(o),t.ajax({data:n,type:"post",url:dgwt_wcas.ajax_details_endpoint,success:function(t){var e="string"==typeof t?jQuery.parseJSON(t):t;if(void 0!==e.items)for(var i=0;i<e.items.length;i++){var o=e.items[i].objectID;if(s.cachedDetails[o]={html:e.items[i].html},void 0!==e.items[i].imageSrc&&e.items[i].imageSrc.length>0)(new Image).src=e.items[i].imageSrc}s.preloader("hide","details","",!0);var n=s.prepareSuggestionObjectID(s.suggestions[s.selectedIndex]);null!=s.cachedDetails[n]?a.html(s.cachedDetails[n].html):a.html(""),s.fixPositionCapture(),s.fixHeight()},error:function(t,e){s.preloader("hide","details","",!0),a.html(t),s.fixPositionCapture(),s.fixHeight()}})}t(document).trigger("dgwtWcasDetailsPanelLoaded",s)}},prepareSuggestionObjectID:function(t){var e="";return void 0!==t&&void 0!==t.type&&(null!=t.post_id&&(e=t.type+"__"+t.post_id,"product_variation"===t.type&&(e+="__"+t.variation_id),void 0!==t.post_type&&(e=t.type+"__"+t.post_id+"__"+t.post_type)),null!=t.term_id&&null!=t.taxonomy&&(e=t.type+"__"+t.term_id+"__"+t.taxonomy)),e},selectFirstSuggestion:function(e){var s=0,i=!1;this.canShowDetailsBox()&&("undefined"!=e&&e.length>0&&t.each(this.suggestions,function(t,e){if(void 0!==e.type&&"more_products"!=e.type&&"headline"!=e.type&&"no-results"!=e.type)return s=t,!1;void 0!==e.type&&"no-results"!==e.type||(i=!0)}),i||(this.getDetails(e[s]),this.activate(s)))},isBadQuery:function(t){if(!this.options.preventBadQueries)return!1;for(var e=this.badQueries,s=e.length;s--;)if(0===t.indexOf(e[s]))return!0;return!1},hide:function(){var e=this.getSuggestionsContainer(),s=this.getDetailsContainer();t.isFunction(this.options.onHide)&&this.visible&&this.options.onHide.call(this.element,container),this.visible=!1,this.selectedIndex=-1,clearTimeout(this.onChangeTimeout),e.hide(),e.removeClass(this.classes.suggestionsContainerOrientTop),s.hide(),t("body").removeClass("dgwt-wcas-open"),t("body").removeClass("dgwt-wcas-block-scroll"),t("body").removeClass("dgwt-wcas-is-details"),t("body").removeClass("dgwt-wcas-full-width"),t("body").removeClass("dgwt-wcas-nores"),t("body").removeClass("dgwt-wcas-details-outside"),t("body").removeClass("dgwt-wcas-details-right"),t("body").removeClass("dgwt-wcas-details-left"),null!=this.autoAligmentprocess&&(clearInterval(this.autoAligmentprocess),this.autoAligmentprocess=null),this.signalHint(null)},hideAfterClickOutsideListener:function(){var e=this;e.isMobileMode()||t(document).mouseup(function(s){if(e.visible){e.getSuggestionsContainer(),e.getDetailsContainer();var i=!(t(s.target).closest("."+e.options.searchFormClass).length>0||t(s.target).hasClass(e.options.searchFormClass)),a=!(t(s.target).closest("."+e.options.containerClass).length>0||t(s.target).hasClass(e.options.containerClass));if(e.canShowDetailsBox()){var o=!(t(s.target).closest("."+e.options.containerDetailsClass).length>0||t(s.target).hasClass(e.options.containerDetailsClass));i&&a&&o&&e.hide()}else i&&a&&e.hide()}})},suggest:function(){if(this.suggestions.length){var e,s=this,i=s.options,a=i.groupBy,o=i.formatResult,n=s.getQuery(s.currentValue),r=s.classes.suggestion,l=s.classes.selected,c=s.getSuggestionsContainer(),d=s.getDetailsContainer(),g=t(s.noSuggestionsContainer),u=i.beforeRender,h="";i.triggerSelectOnValidInput&&s.isExactMatch(n)?s.select(0):(t("body").removeClass("dgwt-wcas-nores"),t.each(s.suggestions,function(s,l){var c="",g=!1;if(a&&(h+=function(t,s){var i=t.data[a];return e===i?"":'<div class="autocomplete-group"><strong>'+(e=i)+"</strong></div>"}(l,0)),void 0===l.type||"product"!=l.type&&"product_variation"!=l.type){var u=r,w="dgwt-wcas-st",p="",m="",f="",v=!0;"product_cat"===l.taxonomy?(u+=" dgwt-wcas-suggestion-tax dgwt-wcas-suggestion-cat",i.showHeadings||(p+='<span class="dgwt-wcas-st--direct-headline">'+dgwt_wcas.labels.category+"</span>"),void 0!==l.breadcrumbs&&l.breadcrumbs&&(f=l.breadcrumbs+" > "+l.value,m+='<span class="dgwt-wcas-st-breadcrumbs">'+dgwt_wcas.labels.in+" "+l.breadcrumbs+"</span>")):"product_tag"===l.taxonomy?(u+=" dgwt-wcas-suggestion-tax dgwt-wcas-suggestion-tag",i.showHeadings||(p+='<span class="dgwt-wcas-st--direct-headline">'+dgwt_wcas.labels.tag+"</span>")):i.isPremium&&l.taxonomy===i.taxonomyBrands?(u+=" dgwt-wcas-suggestion-tax dgwt-wcas-suggestion-brand",i.showHeadings||(p+='<span class="dgwt-wcas-st--direct-headline">'+dgwt_wcas.labels.brand+"</span>")):i.isPremium&&"post"===l.type?(u+=" dgwt-wcas-suggestion-pt dgwt-wcas-suggestion-tp-post",i.showHeadings||(p+='<span class="dgwt-wcas-st--direct-headline">'+dgwt_wcas.labels.post+"</span>")):i.isPremium&&"page"===l.type?(u+=" dgwt-wcas-suggestion-pt dgwt-wcas-suggestion-pt-page",i.showHeadings||(p+='<span class="dgwt-wcas-st--direct-headline">'+dgwt_wcas.labels.page+"</span>")):"more_products"===l.type?(u+=" js-dgwt-wcas-suggestion-more dgwt-wcas-suggestion-more",w="dgwt-wcas-st-more",l.value=dgwt_wcas.labels.show_more+" ("+l.total+")",v=!1):i.showHeadings&&"headline"===l.type?(u+=" js-dgwt-wcas-suggestion-headline dgwt-wcas-suggestion-headline",void 0!==dgwt_wcas.labels[l.value+"_plu"]&&(l.value=dgwt_wcas.labels[l.value+"_plu"]),v=!1):(u+=" dgwt-wcas-suggestion-nores",l.value=dgwt_wcas.labels.no_results,v=!1,!0===i.showDetailsPanel&&d.html(""),t("body").addClass("dgwt-wcas-nores")),f=f.length>0?' title="'+f+'"':"",h+='<div class="'+u+'" data-index="'+s+'">',h+="<span"+f+' class="'+w+'">'+p+o(l.value,n,v)+m+"</span>",h+="</div>"}else!0===i.showImage&&void 0!==l.thumb_html&&(g=!0),c+=void 0!==l.post_id?'data-post-id="'+l.post_id+'" ':"",c+=void 0!==l.taxonomy?'data-taxonomy="'+l.taxonomy+'" ':"",c+=void 0!==l.term_id?'data-term-id="'+l.term_id+'" ':"",h+='<div class="'+r+' dgwt-wcas-suggestion-product" data-index="'+s+'" '+c+">",g&&(h+='<span class="dgwt-wcas-si">'+l.thumb_html+"</span>"),h+=g?'<div class="dgwt-wcas-content-wrapp">':"",h+='<span class="dgwt-wcas-st">',h+='<span class="dgwt-wcas-st-title">'+o(l.value,n,!0)+"</span>",!0===i.showSKU&&void 0!==l.sku&&l.sku.length>0&&(h+='<span class="dgwt-wcas-sku">('+dgwt_wcas.labels.sku_label+" "+o(l.sku,n,!0)+")</span>"),!0===i.showDescription&&void 0!==l.desc&&l.desc&&(h+='<span class="dgwt-wcas-sd">'+o(l.desc,n,!0)+"</span>"),h+="</span>",!0===i.showPrice&&void 0!==l.price&&(h+='<span class="dgwt-wcas-sp">'+l.price+"</span>"),!0===i.showFeaturedBadge&&!0===l.on_sale&&(h+='<span class="dgwt-wcas-badge dgwt-wcas-badge-os">'+i.saleBadgeText+"</span>"),!0===i.showFeaturedBadge&&!0===l.featured&&(h+='<span class="dgwt-wcas-badge dgwt-wcas-badge-f">'+i.featuredBadgeText+"</span>"),h+=g?"</div>":"",h+="</div>"}),this.adjustContainerWidth(),g.detach(),c.html(h),t.isFunction(u)&&u.call(s.element,c,s.suggestions),c.show(),t("body").addClass("dgwt-wcas-open"),s.automaticAlignment(),!0===i.showDetailsPanel&&(t("body").addClass("dgwt-wcas-is-details"),d.show(),s.fixHeight()),i.autoSelectFirst&&(s.selectedIndex=0,c.scrollTop(0),c.children("."+r).first().addClass(l)),s.visible=!0,s.fixPositionCapture(),"top"===s.options.orientation&&(s.getSuggestionsContainer().addClass(s.classes.suggestionsContainerOrientTop),t("body").addClass("dgwt-wcas-block-scroll"),setTimeout(function(){s.scrollDownSuggestions()},300)),s.findBestHint())}else this.hide()},adjustContainerWidth:function(){var e,s=this.options,i=t("body"),a=this.getFormWrapper(),o=this.getSuggestionsContainer(),n=this.getDetailsContainer(),r=this.getFormOffset();if(a.length){var l=getComputedStyle(a[0]).width;if(l=Math.round(parseFloat(l.replace("px",""))),"auto"===s.width&&(e=this.el.outerWidth(),o.css("width",e+"px")),this.canShowDetailsBox()){if(a.width()>=550)return i.addClass("dgwt-wcas-full-width"),l%2==0?(o.css("width",Math.round(l/2)),n.css("width",Math.round(l/2))):(o.css("width",Math.floor(l/2)),n.css("width",Math.ceil(l/2))),i.removeClass("dgwt-wcas-details-left"),i.removeClass("dgwt-wcas-details-right"),void(!0===s.isRtl?n.css("left","0"):o.css("left",l/2+r.left+"px"));i.addClass("dgwt-wcas-details-right")}}},findBestHint:function(){var e=this.el.val().toLowerCase(),s=null;e&&(t.each(this.suggestions,function(t,i){var a=0===i.value.toLowerCase().indexOf(e);return a&&(s=i),!a}),this.signalHint(s))},signalHint:function(e){var s="";e&&(s=this.currentValue+e.value.substr(this.currentValue.length)),this.hintValue!==s&&(this.hintValue=s,this.hint=e,(this.options.onHint||t.noop)(s))},preloader:function(e,s,i,a){var o,n,r="dgwt-wcas-preloader-wrapp",l=null==i?r:r+" "+i;if("form"===s?n=this.getFormWrapper().find(".dgwt-wcas-preloader"):"details"===s&&(n=this.getDetailsContainer()),1==dgwt_wcas.show_preloader&&0!=n.length)if(!0===a)if("hide"!==e){if("show"===e){var c=this.options.isRtl?"-rtl":"";o='<div class="'+l+'"><img class="dgwt-wcas-placeholder-preloader" src="'+dgwt_wcas.img_url+"placeholder"+c+'.png" /></div>',n.html(o)}}else t(r).remove();else"hide"===e?n.removeClass(i):n.addClass(i)},verifySuggestionsFormat:function(e){return e.length&&"string"==typeof e[0]?t.map(e,function(t){return{value:t,data:null}}):e},validateOrientation:function(e,s){return e=t.trim(e||"").toLowerCase(),-1===t.inArray(e,["auto","bottom","top"])&&(e=s),e},processResponse:function(t,e,s){var i=this.options;t.suggestions=this.verifySuggestionsFormat(t.suggestions),i.noCache||(this.cachedResponse[s]=t,i.preventBadQueries&&!t.suggestions.length&&this.badQueries.push(e)),e===this.getQuery(this.currentValue)&&("top"===this.options.orientation&&t.suggestions.reverse(),this.suggestions=t.suggestions,this.suggest())},activate:function(e){var s,i=this.classes.selected,a=this.getSuggestionsContainer(),o=a.find("."+this.classes.suggestion);return a.find("."+i).removeClass(i),this.selectedIndex=e,-1!==this.selectedIndex&&o.length>this.selectedIndex?(s=o.get(this.selectedIndex),t(s).addClass(i),s):null},selectHint:function(){var e=t.inArray(this.hint,this.suggestions);this.select(e)},select:function(t){this.hide(),this.onSelect(t)},moveUp:function(){if(-1!==this.selectedIndex)return 0===this.selectedIndex?(this.getSuggestionsContainer().children("."+this.classes.suggestion).first().removeClass(this.classes.selected),this.selectedIndex=-1,this.ignoreValueChange=!1,this.el.val(this.currentValue),void this.findBestHint()):void this.adjustScroll(this.selectedIndex-1)},moveDown:function(){this.selectedIndex!==this.suggestions.length-1&&this.adjustScroll(this.selectedIndex+1)},adjustScroll:function(e){var s=this.activate(e);if(this.getDetails(this.suggestions[e]),s&&!this.canShowDetailsBox()){var i,a,o,n=this.getSuggestionsContainer(),r=t(s).outerHeight();i=s.offsetTop,o=(a=n.scrollTop())+this.options.maxHeight-r,i<a?n.scrollTop(i):i>o&&n.scrollTop(i-this.options.maxHeight+r),this.options.preserveInput||(this.ignoreValueChange=!0,this.el.val(this.getValue(this.suggestions[e].value))),this.signalHint(null)}},onSelect:function(e){var s=this.options.onSelect,i=this.suggestions[e];void 0===i.type||"more_products"!==i.type?(this.currentValue=this.getValue(i.value),this.currentValue===this.el.val()||this.options.preserveInput||this.el.val(this.currentValue),i.url.length>0&&(window.location.href=i.url),this.signalHint(null),this.suggestions=[],this.selection=i,t.isFunction(s)&&s.call(this.element,i)):this.el.closest("form").trigger("submit")},getValue:function(t){var e,s,i=this.options.delimiter;return i?1===(s=(e=this.currentValue).split(i)).length?t:e.substr(0,e.length-s[s.length-1].length)+t:t},dispose:function(){this.el.off(".autocomplete").removeData("autocomplete"),t(window).off("resize.autocomplete",this.fixPositionCapture),t("."+this.options.containerClass).remove(),t("."+this.options.containerDetailsClass).remove()},enableOverlayMobile:function(){var e=this;if("on"!==e.overlayMobileState){e.overlayMobileState="on";var s,i=e.getFormWrapper(),a=e.getSuggestionsContainer();t("html").addClass("dgwt-wcas-overlay-mobile-on"),'<div class="js-dgwt-wcas-overlay-mobile dgwt-wcas-overlay-mobile">','<div class="dgwt-wcas-om-bar js-dgwt-wcas-om-bar">','<span class="dgwt-wcas-om-return js-dgwt-wcas-om-return">','<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" color="#FFF">','<path fill="#FFF" d="M14 6.125H3.351l4.891-4.891L7 0 0 7l7 7 1.234-1.234L3.35 7.875H14z" fill-rule="evenodd"></path>',"</svg>","</span>","</div>","</div>",t(e.options.mobileOverlayWrapper).append('<div class="js-dgwt-wcas-overlay-mobile dgwt-wcas-overlay-mobile"><div class="dgwt-wcas-om-bar js-dgwt-wcas-om-bar"><span class="dgwt-wcas-om-return js-dgwt-wcas-om-return"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" color="#FFF"><path fill="#FFF" d="M14 6.125H3.351l4.891-4.891L7 0 0 7l7 7 1.234-1.234L3.35 7.875H14z" fill-rule="evenodd"></path></svg></span></div></div>'),(s=t(".js-dgwt-wcas-overlay-mobile")).css("zIndex",999999),i.after('<span class="js-dgwt-wcas-om-hook"></span>'),i.appendTo(".js-dgwt-wcas-om-bar"),a.appendTo(".js-dgwt-wcas-om-bar"),i.addClass("dgwt-wcas-search-wrapp-mobile"),i.hasClass("dgwt-wcas-has-submit")&&(i.addClass("dgwt-wcas-has-submit-off"),i.removeClass("dgwt-wcas-has-submit")),i.find("."+e.options.searchInputClass).focus(),t(document).on("click",".js-dgwt-wcas-om-return",function(t){e.disableOverlayMobile(s)})}},disableOverlayMobile:function(e){var s=this,i=s.getSuggestionsContainer(),a=t(".js-dgwt-wcas-om-bar").find("."+s.options.searchFormClass);a.hasClass("dgwt-wcas-has-submit-off")&&(a.removeClass("dgwt-wcas-has-submit-off"),a.addClass("dgwt-wcas-has-submit")),a.removeClass("dgwt-wcas-search-wrapp-mobile"),t("html").removeClass("dgwt-wcas-overlay-mobile-on"),i.appendTo("body"),i.removeAttr("body-scroll-lock-ignore"),t(".js-dgwt-wcas-om-hook").after(a),t(".js-dgwt-wcas-overlay-mobile").remove(),t(".js-dgwt-wcas-om-hook").remove(),setTimeout(function(){a.find("."+s.options.searchInputClass).val("");var t=a.find(".dgwt-wcas-close");a.length>0&&t.removeClass("dgwt-wcas-close")},150),s.overlayMobileState="off"},elementOrParentIsFixed:function(e){var s=e.add(e.parents()),i=!1;return s.each(function(){if("fixed"===t(this).css("position"))return i=!0,!1}),i},gaEvent:function(t,e){if(this.options.sendGAEvents)try{if("undefined"!=typeof gtag)return void gtag("event","autocomplete_search",{event_label:t,event_category:e});"undefined"!=typeof ga&&ga("send",{hitType:"event",eventCategory:e,eventAction:"autocomplete_search",eventLabel:t})}catch(t){}}},t.fn.dgwtWcasAutocomplete=function(e,s){return arguments.length?this.each(function(){var i=t(this),a=i.data("autocomplete");"string"==typeof e?a&&"function"==typeof a[e]&&a[e](s):(a&&a.dispose&&a.dispose(),a=new d(this,e),i.data("autocomplete",a))}):this.first().data("autocomplete")},t.fn.autocomplete||(t.fn.autocomplete=t.fn.dgwtWcasAutocomplete),function(){function e(){var e=t(".dgwt-wcas-search-input"),s=[];e.length>1&&e.each(function(){var e=t(this).attr("id");if(-1==t.inArray(e,s))s.push(e);else{var i=Math.random().toString(36).substring(2,6);i="dgwt-wcas-search-input-"+i,t(this).attr("id",i),t(this).closest("form").find("label").attr("for",i)}})}function s(){var e=t(".dgwt-wcas-search-input");e.length>0&&e.each(function(){"object"!=typeof t(this).data("autocomplete")&&t(this).dgwtWcasAutocomplete(window.dgwt_wcas.config)})}t(window).on("load",function(){t(".dgwt-wcas-search-submit").length>0&&t(".dgwt-wcas-search-submit").each(function(){var e=t(this).closest(".dgwt-wcas-search-wrapp").find(".dgwt-wcas-preloader");1==dgwt_wcas.is_rtl?e.css("left",6+t(this).outerWidth()+"px"):e.css("right",t(this).outerWidth()+"px")})}),t(document).ready(function(){var e=1==dgwt_wcas.show_details_box,s=dgwt_wcas.mobile_breakpoint;(jQuery(window).width()<s||"ontouchend"in document)&&(e=!1),window.dgwt_wcas.config={minChars:dgwt_wcas.min_chars,width:dgwt_wcas.sug_width,autoSelectFirst:!1,triggerSelectOnValidInput:!1,serviceUrl:dgwt_wcas.ajax_search_endpoint,paramName:"s",showDetailsPanel:e,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.labels.sale_badge,featuredBadgeText:dgwt_wcas.labels.featured_badge,isRtl:1==dgwt_wcas.is_rtl,showHeadings:1==dgwt_wcas.show_headings,isPremium:1==dgwt_wcas.is_premium,taxonomyBrands:dgwt_wcas.taxonomy_brands,overlayMobile:1==dgwt_wcas.overlay_mobile,mobileBreakpoint:s,mobileOverlayWrapper:dgwt_wcas.mobile_overlay_wrapper,debounceWaitMs:dgwt_wcas.debounce_wait_ms,sendGAEvents:dgwt_wcas.send_ga_events},t(".dgwt-wcas-search-input").dgwtWcasAutocomplete(window.dgwt_wcas.config)}),t(document).ready(function(){setTimeout(function(){e(),s()},500)}),t(window).on("load",function(){setTimeout(function(){e(),s()},500),void 0!==window.elementorFrontend&&void 0!==window.elementorFrontend.documentsManager&&void 0!==window.elementorFrontend.documentsManager.documents&&t.each(elementorFrontend.documentsManager.documents,function(t,e){void 0!==e.getModal&&e.getModal&&e.getModal().on("show",function(){setTimeout(function(){s()},300)})})})}()});
|
includes/Admin/RegenerateImages.php
CHANGED
@@ -4,12 +4,15 @@
|
|
4 |
namespace DgoraWcas\Admin;
|
5 |
|
6 |
|
|
|
7 |
use DgoraWcas\Helpers;
|
8 |
|
9 |
class RegenerateImages
|
10 |
{
|
11 |
|
12 |
const ALREADY_REGENERATED_OPT_KEY = 'dgwt_wcas_images_regenerated';
|
|
|
|
|
13 |
|
14 |
public function __construct()
|
15 |
{
|
@@ -18,19 +21,27 @@ class RegenerateImages
|
|
18 |
public function init()
|
19 |
{
|
20 |
|
21 |
-
|
22 |
-
return;
|
23 |
|
24 |
$regenerated = get_option(self::ALREADY_REGENERATED_OPT_KEY);
|
25 |
|
|
|
|
|
26 |
|
27 |
-
// Add image sizes to regenerate
|
28 |
add_filter('woocommerce_regenerate_images_intermediate_image_sizes', array($this, 'getImageSizes'), 10, 1);
|
29 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
30 |
|
31 |
-
if (Helpers::isSettingsPage() && empty($regenerated)) {
|
32 |
-
// regenerate Images
|
33 |
-
add_action('admin_init', array($this, 'regenerateImages'));
|
34 |
}
|
35 |
|
36 |
}
|
@@ -44,16 +55,18 @@ class RegenerateImages
|
|
44 |
{
|
45 |
if (class_exists('WC_Regenerate_Images')) {
|
46 |
|
47 |
-
if (
|
48 |
return;
|
49 |
}
|
50 |
|
51 |
-
if (
|
52 |
\WC_Regenerate_Images::queue_image_regeneration();
|
53 |
-
update_option(self::ALREADY_REGENERATED_OPT_KEY, true);
|
54 |
}
|
55 |
}
|
56 |
|
|
|
|
|
|
|
57 |
}
|
58 |
|
59 |
/**
|
@@ -65,10 +78,120 @@ class RegenerateImages
|
|
65 |
*/
|
66 |
public function getImageSizes($sizes)
|
67 |
{
|
|
|
68 |
array_push($sizes, 'dgwt-wcas-product-suggestion');
|
69 |
|
70 |
return $sizes;
|
71 |
|
72 |
}
|
73 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
74 |
}
|
4 |
namespace DgoraWcas\Admin;
|
5 |
|
6 |
|
7 |
+
use DgoraWcas\Admin\Promo\FeedbackNotice;
|
8 |
use DgoraWcas\Helpers;
|
9 |
|
10 |
class RegenerateImages
|
11 |
{
|
12 |
|
13 |
const ALREADY_REGENERATED_OPT_KEY = 'dgwt_wcas_images_regenerated';
|
14 |
+
const REGENERATE_ACTION = 'dgwt_wcas_regenerate_images';
|
15 |
+
const DISMISS_AJAX_ACTION = 'dgwt_wcas_dismiss_notice_regenerate_images';
|
16 |
|
17 |
public function __construct()
|
18 |
{
|
21 |
public function init()
|
22 |
{
|
23 |
|
24 |
+
$displayImages = DGWT_WCAS()->settings->getOption('show_product_image') === 'on';
|
|
|
25 |
|
26 |
$regenerated = get_option(self::ALREADY_REGENERATED_OPT_KEY);
|
27 |
|
28 |
+
add_action('wp_ajax_' . self::DISMISS_AJAX_ACTION, array($this, 'dismissNotice'));
|
29 |
+
add_action('wp_ajax_' . self::REGENERATE_ACTION, array($this, 'regenerateImages'));
|
30 |
|
|
|
31 |
add_filter('woocommerce_regenerate_images_intermediate_image_sizes', array($this, 'getImageSizes'), 10, 1);
|
32 |
|
33 |
+
if (
|
34 |
+
Helpers::isSettingsPage()
|
35 |
+
&& empty($regenerated)
|
36 |
+
&& $displayImages
|
37 |
+
&& $this->isTimeToDisplay()
|
38 |
+
) {
|
39 |
+
|
40 |
+
|
41 |
+
add_action('admin_notices', array($this, 'adminNotice'));
|
42 |
+
|
43 |
+
add_action('admin_footer', array($this, 'printJS'));
|
44 |
|
|
|
|
|
|
|
45 |
}
|
46 |
|
47 |
}
|
55 |
{
|
56 |
if (class_exists('WC_Regenerate_Images')) {
|
57 |
|
58 |
+
if (method_exists('Jetpack', 'is_module_active') && \Jetpack::is_module_active('photon')) {
|
59 |
return;
|
60 |
}
|
61 |
|
62 |
+
if (apply_filters('woocommerce_background_image_regeneration', true)) {
|
63 |
\WC_Regenerate_Images::queue_image_regeneration();
|
|
|
64 |
}
|
65 |
}
|
66 |
|
67 |
+
update_option(self::ALREADY_REGENERATED_OPT_KEY, true);
|
68 |
+
|
69 |
+
wp_send_json_success();
|
70 |
}
|
71 |
|
72 |
/**
|
78 |
*/
|
79 |
public function getImageSizes($sizes)
|
80 |
{
|
81 |
+
|
82 |
array_push($sizes, 'dgwt-wcas-product-suggestion');
|
83 |
|
84 |
return $sizes;
|
85 |
|
86 |
}
|
87 |
|
88 |
+
/**
|
89 |
+
* Notice: Maybe regenerate images
|
90 |
+
* @return void
|
91 |
+
*/
|
92 |
+
|
93 |
+
public function adminNotice()
|
94 |
+
{
|
95 |
+
?>
|
96 |
+
<div class="notice notice-info dgwt-wcas-notice is-dismissible js-dgwt-wcas-notice-regenerate-images">
|
97 |
+
<p>
|
98 |
+
<?php
|
99 |
+
$button = '<a href="#" class="button button-small js-dgwt-wcas-start-regenerate-images">' . __('Regenerate WooCommerce images') . '</a>';
|
100 |
+
$pluginLink = '<a target="_blank" href="https://wordpress.org/plugins/regenerate-thumbnails/">Regenerate Thumbnails</a>';
|
101 |
+
printf(__('<b>AJAX Search for WooCommerce</b>: It is recommended to generate a special small image size for existing products to ensure a better user experience. This is a one-time action. <br /><br />You can do it by clicking %s or use external plugin e.g. %s.',
|
102 |
+
'ajax-search-for-woocommerce'), $button, $pluginLink);
|
103 |
+
?>
|
104 |
+
</p>
|
105 |
+
</div>
|
106 |
+
<?php
|
107 |
+
}
|
108 |
+
|
109 |
+
|
110 |
+
/**
|
111 |
+
* Hide admin notice
|
112 |
+
*
|
113 |
+
* @return null
|
114 |
+
*/
|
115 |
+
public function dismissNotice()
|
116 |
+
{
|
117 |
+
|
118 |
+
if ( ! current_user_can('administrator')) {
|
119 |
+
return;
|
120 |
+
}
|
121 |
+
|
122 |
+
update_option(self::ALREADY_REGENERATED_OPT_KEY, true);
|
123 |
+
|
124 |
+
wp_send_json_success();
|
125 |
+
}
|
126 |
+
|
127 |
+
/**
|
128 |
+
* Check is is time to display
|
129 |
+
*
|
130 |
+
* @return void
|
131 |
+
*/
|
132 |
+
public function isTimeToDisplay()
|
133 |
+
{
|
134 |
+
|
135 |
+
$isTime = false;
|
136 |
+
|
137 |
+
$date = get_option(FeedbackNotice::ACTIVATION_DATE_OPT);
|
138 |
+
$offset = strtotime('-2 days');
|
139 |
+
|
140 |
+
if ( ! empty($date) && $offset >= $date) {
|
141 |
+
$isTime = true;
|
142 |
+
}
|
143 |
+
|
144 |
+
|
145 |
+
return $isTime;
|
146 |
+
}
|
147 |
+
|
148 |
+
/**
|
149 |
+
* Print JS for close admin notice
|
150 |
+
*
|
151 |
+
* @return void
|
152 |
+
*/
|
153 |
+
public function printJS()
|
154 |
+
{
|
155 |
+
?>
|
156 |
+
<script>
|
157 |
+
(function ($) {
|
158 |
+
|
159 |
+
$(document).on('click', '.js-dgwt-wcas-notice-regenerate-images .notice-dismiss', function () {
|
160 |
+
|
161 |
+
$.ajax({
|
162 |
+
url: ajaxurl,
|
163 |
+
data: {
|
164 |
+
action: '<?php echo self::DISMISS_AJAX_ACTION; ?>',
|
165 |
+
}
|
166 |
+
});
|
167 |
+
|
168 |
+
});
|
169 |
+
|
170 |
+
$(document).on('click', '.js-dgwt-wcas-start-regenerate-images', function () {
|
171 |
+
|
172 |
+
$('.js-dgwt-wcas-notice-regenerate-images p').html('<b>AJAX Search for WooCommerce</b>: (...)');
|
173 |
+
|
174 |
+
$.ajax({
|
175 |
+
url: ajaxurl,
|
176 |
+
data: {
|
177 |
+
action: '<?php echo self::REGENERATE_ACTION; ?>',
|
178 |
+
}
|
179 |
+
}).done(function (data) {
|
180 |
+
|
181 |
+
setTimeout(function () {
|
182 |
+
$('.js-dgwt-wcas-notice-regenerate-images p').html('<b>AJAX Search for WooCommerce</b>: <?php _e('Regeneration of images started. The process will continue in the background.'); ?>');
|
183 |
+
}, 700);
|
184 |
+
|
185 |
+
});
|
186 |
+
;
|
187 |
+
|
188 |
+
});
|
189 |
+
|
190 |
+
}(jQuery));
|
191 |
+
</script>
|
192 |
+
|
193 |
+
<?php
|
194 |
+
}
|
195 |
+
|
196 |
+
|
197 |
}
|
includes/Engines/WordPressNative/DetailsBox.php
CHANGED
@@ -77,7 +77,7 @@ class DetailsBox
|
|
77 |
|
78 |
// Get product details
|
79 |
|
80 |
-
if (
|
81 |
$productDetails = $this->getProductDetails( $postID );
|
82 |
$items[] = array(
|
83 |
'objectID' => $item['objectID'],
|
@@ -111,27 +111,28 @@ class DetailsBox
|
|
111 |
private function getProductDetails( $productID )
|
112 |
{
|
113 |
$product = new Product( $productID );
|
114 |
-
if ( empty($product) ) {
|
115 |
-
return;
|
116 |
-
}
|
117 |
$details = array(
|
118 |
'html' => '',
|
119 |
'imageSrc' => '',
|
120 |
);
|
|
|
|
|
|
|
121 |
$thumbSize = apply_filters( 'dgwt/wcas/suggestion_details/product/thumb_size', 'woocommerce_thumbnail' );
|
122 |
$wooProduct = $product->getWooObject();
|
123 |
$vars = array(
|
124 |
-
'ID'
|
125 |
-
'name'
|
126 |
-
'desc'
|
127 |
-
'link'
|
128 |
-
'imageSrc'
|
129 |
-
'sku'
|
130 |
-
'reviewCount'
|
131 |
-
'ratingHtml'
|
132 |
-
'priceHtml'
|
133 |
-
'showQuantity'
|
134 |
-
'
|
|
|
135 |
);
|
136 |
$details['imageSrc'] = $product->getThumbnailSrc( $thumbSize );
|
137 |
if ( $product->isType( 'simple' ) && $wooProduct->is_purchasable() && $wooProduct->is_in_stock() && !$wooProduct->is_sold_individually() && apply_filters( 'dgwt/wcas/suggestion_details/show_quantity', true ) ) {
|
77 |
|
78 |
// Get product details
|
79 |
|
80 |
+
if ( !empty($postID) && !empty($postType) && $postType === 'product' ) {
|
81 |
$productDetails = $this->getProductDetails( $postID );
|
82 |
$items[] = array(
|
83 |
'objectID' => $item['objectID'],
|
111 |
private function getProductDetails( $productID )
|
112 |
{
|
113 |
$product = new Product( $productID );
|
|
|
|
|
|
|
114 |
$details = array(
|
115 |
'html' => '',
|
116 |
'imageSrc' => '',
|
117 |
);
|
118 |
+
if ( !$product->isCorrect() ) {
|
119 |
+
return $details;
|
120 |
+
}
|
121 |
$thumbSize = apply_filters( 'dgwt/wcas/suggestion_details/product/thumb_size', 'woocommerce_thumbnail' );
|
122 |
$wooProduct = $product->getWooObject();
|
123 |
$vars = array(
|
124 |
+
'ID' => $product->getID(),
|
125 |
+
'name' => $product->getName(),
|
126 |
+
'desc' => $product->getDescription( 'details-panel' ),
|
127 |
+
'link' => $product->getPermalink(),
|
128 |
+
'imageSrc' => $product->getThumbnailSrc( $thumbSize ),
|
129 |
+
'sku' => $product->getSKU(),
|
130 |
+
'reviewCount' => $product->getReviewCount(),
|
131 |
+
'ratingHtml' => $product->getRatingHtml(),
|
132 |
+
'priceHtml' => $product->getPriceHTML(),
|
133 |
+
'showQuantity' => false,
|
134 |
+
'stockAvailability' => $product->getStockAvailability(),
|
135 |
+
'wooObject' => $product->getWooObject(),
|
136 |
);
|
137 |
$details['imageSrc'] = $product->getThumbnailSrc( $thumbSize );
|
138 |
if ( $product->isType( 'simple' ) && $wooProduct->is_purchasable() && $wooProduct->is_in_stock() && !$wooProduct->is_sold_individually() && apply_filters( 'dgwt/wcas/suggestion_details/show_quantity', true ) ) {
|
includes/Helpers.php
CHANGED
@@ -860,7 +860,7 @@ class Helpers
|
|
860 |
'show_more' => DGWT_WCAS()->settings->getOption( 'search_see_all_results_text', __( 'See all products...', 'ajax-search-for-woocommerce' ) ),
|
861 |
'show_more_details' => DGWT_WCAS()->settings->getOption( 'search_see_all_results_text', __( 'See all products...', 'ajax-search-for-woocommerce' ) ),
|
862 |
'search_placeholder' => DGWT_WCAS()->settings->getOption( 'search_placeholder', __( 'Search for products...', 'ajax-search-for-woocommerce' ) ),
|
863 |
-
'submit' => DGWT_WCAS()->settings->getOption( 'search_submit_text', '')
|
864 |
) );
|
865 |
return $labels;
|
866 |
}
|
860 |
'show_more' => DGWT_WCAS()->settings->getOption( 'search_see_all_results_text', __( 'See all products...', 'ajax-search-for-woocommerce' ) ),
|
861 |
'show_more_details' => DGWT_WCAS()->settings->getOption( 'search_see_all_results_text', __( 'See all products...', 'ajax-search-for-woocommerce' ) ),
|
862 |
'search_placeholder' => DGWT_WCAS()->settings->getOption( 'search_placeholder', __( 'Search for products...', 'ajax-search-for-woocommerce' ) ),
|
863 |
+
'submit' => DGWT_WCAS()->settings->getOption( 'search_submit_text', '' ),
|
864 |
) );
|
865 |
return $labels;
|
866 |
}
|
includes/Integrations/Brands.php
CHANGED
@@ -11,7 +11,8 @@ use DgoraWcas\Helpers;
|
|
11 |
*
|
12 |
* Support for plugins:
|
13 |
* 1. WooCommerce Brands 1.6.9 by WooCommerce
|
14 |
-
* 2. YITH WooCommerce Brands Add-on
|
|
|
15 |
*/
|
16 |
class Brands
|
17 |
{
|
@@ -82,9 +83,13 @@ class Brands
|
|
82 |
|
83 |
if ($this->hasBrands()) {
|
84 |
switch ($this->pluginSlug) {
|
85 |
-
case 'yith-woocommerce-brands-add-on-premium/init.php'
|
|
|
86 |
$brandTaxonomy = 'yith_product_brand';
|
87 |
break;
|
|
|
|
|
|
|
88 |
}
|
89 |
}
|
90 |
|
@@ -102,7 +107,9 @@ class Brands
|
|
102 |
{
|
103 |
return array(
|
104 |
'woocommerce-brands/woocommerce-brands.php',
|
|
|
105 |
'yith-woocommerce-brands-add-on-premium/init.php',
|
|
|
106 |
);
|
107 |
}
|
108 |
|
11 |
*
|
12 |
* Support for plugins:
|
13 |
* 1. WooCommerce Brands 1.6.9 by WooCommerce
|
14 |
+
* 2. YITH WooCommerce Brands Add-on 1.3.3 by YITH
|
15 |
+
* 3. Perfect WooCommerce Brands 1.7.9 by Alberto de Vera Sevilla
|
16 |
*/
|
17 |
class Brands
|
18 |
{
|
83 |
|
84 |
if ($this->hasBrands()) {
|
85 |
switch ($this->pluginSlug) {
|
86 |
+
case 'yith-woocommerce-brands-add-on-premium/init.php':
|
87 |
+
case 'yith-woocommerce-brands-add-on/init.php':
|
88 |
$brandTaxonomy = 'yith_product_brand';
|
89 |
break;
|
90 |
+
case 'perfect-woocommerce-brands/main.php':
|
91 |
+
$brandTaxonomy = 'pwb-brand';
|
92 |
+
break;
|
93 |
}
|
94 |
}
|
95 |
|
107 |
{
|
108 |
return array(
|
109 |
'woocommerce-brands/woocommerce-brands.php',
|
110 |
+
'yith-woocommerce-brands-add-on/init.php',
|
111 |
'yith-woocommerce-brands-add-on-premium/init.php',
|
112 |
+
'perfect-woocommerce-brands/main.php'
|
113 |
);
|
114 |
}
|
115 |
|
includes/Multilingual.php
CHANGED
@@ -7,6 +7,8 @@ namespace DgoraWcas;
|
|
7 |
class Multilingual
|
8 |
{
|
9 |
|
|
|
|
|
10 |
/**
|
11 |
* Check if the website is multilingual
|
12 |
*
|
@@ -163,8 +165,20 @@ class Multilingual
|
|
163 |
{
|
164 |
$permalink = $url;
|
165 |
|
166 |
-
if (self::isWPML()) {
|
167 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
168 |
}
|
169 |
|
170 |
return $permalink;
|
@@ -272,4 +286,78 @@ class Multilingual
|
|
272 |
return $term;
|
273 |
}
|
274 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
275 |
}
|
7 |
class Multilingual
|
8 |
{
|
9 |
|
10 |
+
public static $currentCurrency = '';
|
11 |
+
|
12 |
/**
|
13 |
* Check if the website is multilingual
|
14 |
*
|
165 |
{
|
166 |
$permalink = $url;
|
167 |
|
168 |
+
if (self::isWPML() && self::getDefaultLanguage() !== $lang) {
|
169 |
+
/**
|
170 |
+
* 1 if the option is *Different languages in directories*
|
171 |
+
* 2 if the option is *A different domain per language*
|
172 |
+
* 3 if the option is *Language name added as a parameter*.
|
173 |
+
*/
|
174 |
+
$urlType = apply_filters( 'wpml_setting', 0, 'language_negotiation_type' );
|
175 |
+
|
176 |
+
if($urlType == 3) {
|
177 |
+
$permalink = apply_filters('wpml_permalink', $url, $lang);
|
178 |
+
}else{
|
179 |
+
$permalink = apply_filters('wpml_permalink', $url, $lang, true);
|
180 |
+
}
|
181 |
+
|
182 |
}
|
183 |
|
184 |
return $permalink;
|
286 |
return $term;
|
287 |
}
|
288 |
|
289 |
+
/**
|
290 |
+
* Check if multicurrency module is enabled
|
291 |
+
*
|
292 |
+
* @return bool
|
293 |
+
*/
|
294 |
+
public static function isMultiCurrency()
|
295 |
+
{
|
296 |
+
|
297 |
+
$multiCurrency = false;
|
298 |
+
|
299 |
+
if (self::isWPML() && function_exists('wcml_is_multi_currency_on') && wcml_is_multi_currency_on()) {
|
300 |
+
$multiCurrency = true;
|
301 |
+
}
|
302 |
+
|
303 |
+
|
304 |
+
return $multiCurrency;
|
305 |
+
}
|
306 |
+
|
307 |
+
/**
|
308 |
+
* Get currency code assigned to language
|
309 |
+
*
|
310 |
+
* @param string $lang
|
311 |
+
*
|
312 |
+
* @return string
|
313 |
+
*/
|
314 |
+
public static function getCurrencyForLang($lang)
|
315 |
+
{
|
316 |
+
$currencyCode = '';
|
317 |
+
|
318 |
+
if (self::isWPML()) {
|
319 |
+
global $woocommerce_wpml;
|
320 |
+
if ( ! empty($woocommerce_wpml) && is_object($woocommerce_wpml) && ! empty($lang)) {
|
321 |
+
|
322 |
+
if ( ! empty($woocommerce_wpml->settings['default_currencies'][$lang])) {
|
323 |
+
$currencyCode = $woocommerce_wpml->settings['default_currencies'][$lang];
|
324 |
+
}
|
325 |
+
}
|
326 |
+
|
327 |
+
}
|
328 |
+
|
329 |
+
return $currencyCode;
|
330 |
+
}
|
331 |
+
|
332 |
+
/**
|
333 |
+
* Set currenct currency
|
334 |
+
*
|
335 |
+
* @return void
|
336 |
+
*/
|
337 |
+
public static function setCurrentCurrency($currency){
|
338 |
+
self::$currentCurrency = $currency;
|
339 |
+
}
|
340 |
+
|
341 |
+
/**
|
342 |
+
* Get currenct currency
|
343 |
+
*
|
344 |
+
* @return string
|
345 |
+
*/
|
346 |
+
public static function getCurrentCurrency()
|
347 |
+
{
|
348 |
+
return self::$currentCurrency;
|
349 |
+
}
|
350 |
+
|
351 |
+
/**
|
352 |
+
* Switch language
|
353 |
+
*
|
354 |
+
* @param $lang
|
355 |
+
*/
|
356 |
+
public static function switchLanguage($lang)
|
357 |
+
{
|
358 |
+
if (self::isWPML() && ! empty($lang)) {
|
359 |
+
do_action('wpml_switch_language', $lang);
|
360 |
+
}
|
361 |
+
}
|
362 |
+
|
363 |
}
|
includes/Personalization.php
CHANGED
@@ -42,6 +42,10 @@ class Personalization {
|
|
42 |
?>
|
43 |
<style type="text/css">
|
44 |
|
|
|
|
|
|
|
|
|
45 |
.dgwt-wcas-search-wrapp{
|
46 |
<?php if(!empty($max_form_width)): ?>
|
47 |
max-width: <?php echo $max_form_width; ?>px;
|
42 |
?>
|
43 |
<style type="text/css">
|
44 |
|
45 |
+
.dgwt-wcas-ico-magnifier {
|
46 |
+
max-width: 20px;
|
47 |
+
}
|
48 |
+
|
49 |
.dgwt-wcas-search-wrapp{
|
50 |
<?php if(!empty($max_form_width)): ?>
|
51 |
max-width: <?php echo $max_form_width; ?>px;
|
includes/Product.php
CHANGED
@@ -107,10 +107,10 @@ class Product
|
|
107 |
if ( ! empty($desc)) {
|
108 |
|
109 |
if($type === 'details-panel') {
|
110 |
-
$wordsLimit =
|
111 |
$output = Helpers::makeShortDescription($desc, $wordsLimit, '</br><b><strong>', false);
|
112 |
}elseif ($type === 'suggestions'){
|
113 |
-
$wordsLimit =
|
114 |
$output = Helpers::makeShortDescription($desc, $wordsLimit, '');
|
115 |
}
|
116 |
}
|
@@ -128,10 +128,6 @@ class Product
|
|
128 |
{
|
129 |
$permalink = $this->wcProduct->get_permalink();
|
130 |
|
131 |
-
if (Multilingual::isMultilingual()) {
|
132 |
-
$permalink = Multilingual::getPermalink($this->getID(), $permalink, $this->langCode);
|
133 |
-
}
|
134 |
-
|
135 |
return apply_filters('dgwt/wcas/product/permalink', $permalink, $this->productID, $this);
|
136 |
}
|
137 |
|
@@ -184,7 +180,14 @@ class Product
|
|
184 |
*/
|
185 |
public function getPriceHTML()
|
186 |
{
|
187 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
188 |
}
|
189 |
|
190 |
/**
|
@@ -502,6 +505,53 @@ class Product
|
|
502 |
|
503 |
}
|
504 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
505 |
/**
|
506 |
* Check product type
|
507 |
*
|
@@ -511,5 +561,19 @@ class Product
|
|
511 |
return $this->wcProduct->is_type($type);
|
512 |
}
|
513 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
514 |
|
515 |
}
|
107 |
if ( ! empty($desc)) {
|
108 |
|
109 |
if($type === 'details-panel') {
|
110 |
+
$wordsLimit = $forceWordsLimit > 0 ? $forceWordsLimit : 20;
|
111 |
$output = Helpers::makeShortDescription($desc, $wordsLimit, '</br><b><strong>', false);
|
112 |
}elseif ($type === 'suggestions'){
|
113 |
+
$wordsLimit = $forceWordsLimit > 0 ? $forceWordsLimit : 30;
|
114 |
$output = Helpers::makeShortDescription($desc, $wordsLimit, '');
|
115 |
}
|
116 |
}
|
128 |
{
|
129 |
$permalink = $this->wcProduct->get_permalink();
|
130 |
|
|
|
|
|
|
|
|
|
131 |
return apply_filters('dgwt/wcas/product/permalink', $permalink, $this->productID, $this);
|
132 |
}
|
133 |
|
180 |
*/
|
181 |
public function getPriceHTML()
|
182 |
{
|
183 |
+
|
184 |
+
$price = $this->wcProduct->get_price_html();
|
185 |
+
|
186 |
+
if(!empty($price) && is_string($price)){
|
187 |
+
$price = preg_replace('/(?<=\d)\s+(?=\d|\-)/', ' ', $price);
|
188 |
+
}
|
189 |
+
|
190 |
+
return (string) apply_filters('dgwt/wcas/product/html_price', $price, $this->productID, $this);
|
191 |
}
|
192 |
|
193 |
/**
|
505 |
|
506 |
}
|
507 |
|
508 |
+
/**
|
509 |
+
* Get product currency
|
510 |
+
*
|
511 |
+
* @return string
|
512 |
+
*/
|
513 |
+
public function getCurrency()
|
514 |
+
{
|
515 |
+
|
516 |
+
$currency = get_woocommerce_currency();
|
517 |
+
|
518 |
+
if (Multilingual::isMultilingual()) {
|
519 |
+
$currencyByLang = Multilingual::getCurrencyForLang($this->getLanguage());
|
520 |
+
if(!empty($currencyByLang)){
|
521 |
+
$currency = $currencyByLang;
|
522 |
+
}
|
523 |
+
}
|
524 |
+
|
525 |
+
|
526 |
+
return $currency;
|
527 |
+
}
|
528 |
+
|
529 |
+
/**
|
530 |
+
* Stock quantity message
|
531 |
+
*
|
532 |
+
* @return string
|
533 |
+
*/
|
534 |
+
public function getStockAvailability()
|
535 |
+
{
|
536 |
+
$html = '';
|
537 |
+
|
538 |
+
if ('yes' === get_option('woocommerce_manage_stock') && $this->wcProduct->get_manage_stock()) {
|
539 |
+
$data = $this->wcProduct->get_availability();
|
540 |
+
if(!empty($data) && is_array($data)){
|
541 |
+
$text = !empty($data['availability']) ? $data['availability'] : '';
|
542 |
+
$class = !empty($data['class']) ? ' ' . $data['class'] : '';
|
543 |
+
|
544 |
+
if($text) {
|
545 |
+
$html .= '<span class="dgwt-wcas-stock' . $class . '">';
|
546 |
+
$html .= $text;
|
547 |
+
$html .= '</span>';
|
548 |
+
}
|
549 |
+
}
|
550 |
+
}
|
551 |
+
|
552 |
+
return $html;
|
553 |
+
}
|
554 |
+
|
555 |
/**
|
556 |
* Check product type
|
557 |
*
|
561 |
return $this->wcProduct->is_type($type);
|
562 |
}
|
563 |
|
564 |
+
/**
|
565 |
+
* Check if the object was initialized properly
|
566 |
+
*
|
567 |
+
* @return bool
|
568 |
+
*/
|
569 |
+
public function isCorrect(){
|
570 |
+
$correct = true;
|
571 |
+
|
572 |
+
if(empty($this->wcProduct)){
|
573 |
+
$correct = false;
|
574 |
+
}
|
575 |
+
|
576 |
+
return $correct;
|
577 |
+
}
|
578 |
|
579 |
}
|
partials/details-panel/product.php
CHANGED
@@ -45,6 +45,10 @@ if ( ! defined('DGWT_WCAS_FILE')) {
|
|
45 |
|
46 |
<div class="dgwt-wcas-details-hr"></div>
|
47 |
|
|
|
|
|
|
|
|
|
48 |
<div class="dgwt-wcas-pd-addtc js-dgwt-wcas-pd-addtc">
|
49 |
<form class="dgwt-wcas-pd-addtc-form" action="" method="post" enctype="multipart/form-data">
|
50 |
<?php
|
45 |
|
46 |
<div class="dgwt-wcas-details-hr"></div>
|
47 |
|
48 |
+
<?php if ( ! empty($vars->stockAvailability)) {
|
49 |
+
echo $vars->stockAvailability;
|
50 |
+
}; ?>
|
51 |
+
|
52 |
<div class="dgwt-wcas-pd-addtc js-dgwt-wcas-pd-addtc">
|
53 |
<form class="dgwt-wcas-pd-addtc-form" action="" method="post" enctype="multipart/form-data">
|
54 |
<?php
|
partials/search-form.php
CHANGED
@@ -12,19 +12,20 @@ $hasSubmit = DGWT_WCAS()->settings->getOption( 'show_submit_button' );
|
|
12 |
$uniqueID = ++DGWT_WCAS()->searchInstances . substr(uniqid(), 10, 3);
|
13 |
?>
|
14 |
|
15 |
-
<div class="dgwt-wcas-search-wrapp <?php echo Helpers::searchWrappClasses( $args ); ?>"
|
16 |
<form class="dgwt-wcas-search-form" role="search" action="<?php echo Helpers::searchFormAction(); ?>" method="get">
|
17 |
<div class="dgwt-wcas-sf-wrapp">
|
18 |
<?php echo $hasSubmit !== 'on' ? Helpers::getMagnifierIco() : ''; ?>
|
19 |
<label class="screen-reader-text" for="dgwt-wcas-search-input-<?php echo $uniqueID; ?>"><?php _e( 'Products search', 'ajax-search-for-woocommerce' ) ?></label>
|
20 |
-
|
21 |
<input id="dgwt-wcas-search-input-<?php echo $uniqueID; ?>"
|
22 |
-
|
23 |
-
|
24 |
-
|
25 |
-
|
26 |
-
|
27 |
-
|
|
|
28 |
<div class="dgwt-wcas-preloader"></div>
|
29 |
|
30 |
<?php if($hasSubmit === 'on'): ?>
|
12 |
$uniqueID = ++DGWT_WCAS()->searchInstances . substr(uniqid(), 10, 3);
|
13 |
?>
|
14 |
|
15 |
+
<div class="dgwt-wcas-search-wrapp <?php echo Helpers::searchWrappClasses( $args ); ?>">
|
16 |
<form class="dgwt-wcas-search-form" role="search" action="<?php echo Helpers::searchFormAction(); ?>" method="get">
|
17 |
<div class="dgwt-wcas-sf-wrapp">
|
18 |
<?php echo $hasSubmit !== 'on' ? Helpers::getMagnifierIco() : ''; ?>
|
19 |
<label class="screen-reader-text" for="dgwt-wcas-search-input-<?php echo $uniqueID; ?>"><?php _e( 'Products search', 'ajax-search-for-woocommerce' ) ?></label>
|
20 |
+
|
21 |
<input id="dgwt-wcas-search-input-<?php echo $uniqueID; ?>"
|
22 |
+
type="search"
|
23 |
+
class="dgwt-wcas-search-input"
|
24 |
+
name="<?php echo Helpers::getSearchInputName(); ?>"
|
25 |
+
value="<?php echo get_search_query() ?>"
|
26 |
+
placeholder="<?php echo Helpers::getLabel('search_placeholder'); ?>"
|
27 |
+
autocomplete="off"
|
28 |
+
/>
|
29 |
<div class="dgwt-wcas-preloader"></div>
|
30 |
|
31 |
<?php if($hasSubmit === 'on'): ?>
|
readme.txt
CHANGED
@@ -3,9 +3,9 @@ Contributors: damian-gora
|
|
3 |
Donate link: https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=LD2ALVRLXPZPC
|
4 |
Tags: woocommerce search, ajax search, search by sku, product search, woocommerce
|
5 |
Requires at least: 5.0
|
6 |
-
Tested up to: 5.
|
7 |
Requires PHP: 5.5
|
8 |
-
Stable tag: 1.6.
|
9 |
License: GPLv2 or later
|
10 |
License URI: http://www.gnu.org/licenses/gpl-2.0.html
|
11 |
|
@@ -135,8 +135,19 @@ You can read more and compare Pro and Free features here: [feature comparison](h
|
|
135 |
|
136 |
== Changelog ==
|
137 |
|
138 |
-
= 1.6.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
139 |
|
|
|
140 |
* ADD: Details Panel - new layout for product overview and other UX improvements
|
141 |
* ADD: Automatically regenerates images after first plugin activation
|
142 |
* FIX: Highlighted no results suggestion
|
3 |
Donate link: https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=LD2ALVRLXPZPC
|
4 |
Tags: woocommerce search, ajax search, search by sku, product search, woocommerce
|
5 |
Requires at least: 5.0
|
6 |
+
Tested up to: 5.4
|
7 |
Requires PHP: 5.5
|
8 |
+
Stable tag: 1.6.3
|
9 |
License: GPLv2 or later
|
10 |
License URI: http://www.gnu.org/licenses/gpl-2.0.html
|
11 |
|
135 |
|
136 |
== Changelog ==
|
137 |
|
138 |
+
= 1.6.3, March 11, 2020 =
|
139 |
+
* ADD: Details panel - display stock quantity
|
140 |
+
* FIX: Better support for the Elementor including popups and sticky menu
|
141 |
+
* FIX: Better support for page builders. Late initialization.
|
142 |
+
* FIX: Disabling automatic regenerate thumbnails. Conditionally images regeneration.
|
143 |
+
* FIX: HTTP 500 on getResultDetails for some cases
|
144 |
+
* FIX: Too long description in live suggestions
|
145 |
+
* FIX: Add non-breaking space for prices
|
146 |
+
* FIX: JS errors Failed to execute 'getComputedStyle' on 'Window' (for some cases)
|
147 |
+
* CHANGE: Rename jQuery object from Autocomplete to DgwtWcasAutocompleteSearch because of namespaces conflicts
|
148 |
+
|
149 |
|
150 |
+
= 1.6.2, February 18, 2020 =
|
151 |
* ADD: Details Panel - new layout for product overview and other UX improvements
|
152 |
* ADD: Automatically regenerates images after first plugin activation
|
153 |
* FIX: Highlighted no results suggestion
|