Version Description
Download this release
Release Info
Developer | damian-gora |
Plugin | Ajax Search for WooCommerce |
Version | 1.8.2 |
Comparing to | |
See all releases |
Code changes from version 1.8.1 to 1.8.2
- ajax-search-for-woocommerce.php +9 -2
- assets/css/admin-style.css +68 -0
- assets/css/style.css +28 -7
- assets/css/style.min.css +1 -1
- assets/js/admin.js +141 -1
- assets/js/admin.min.js +1 -1
- assets/js/search.js +64 -7
- assets/js/search.min.js +1 -1
- includes/Admin/SettingsAPI.php +23 -0
- includes/Admin/Troubleshooting.php +47 -0
- includes/Engines/WordPressNative/DetailsBox.php +1 -1
- includes/Engines/WordPressNative/Search.php +19 -6
- includes/Helpers.php +10 -2
- includes/Integrations/Brands.php +34 -10
- includes/Integrations/Plugins/FacetWP/FacetWP.php +4 -0
- includes/Integrations/Plugins/JetSmartFilters/JetSmartFilters.php +4 -0
- includes/Integrations/Plugins/PluginsCompatibility.php +5 -0
- includes/Integrations/Plugins/WooCommerceProductTable/WooCommerceProductTable.php +6 -1
- includes/Integrations/Plugins/WooCommerceProductsVisibility/Filters.php +0 -57
- includes/Integrations/Plugins/WooCommerceProductsVisibility/WooCommerceProductsVisibility.php +0 -40
- includes/Integrations/Plugins/WooCommerceWholeSalePricesIntegration/Filters.php +0 -56
- includes/Integrations/Plugins/WooCommerceWholeSalePricesIntegration/WooCommerceWholeSalePricesIntegration.php +0 -56
- includes/Integrations/Plugins/WooProductFilter/WooProductFilter.php +4 -0
- includes/Integrations/Plugins/XforWooCommerceFilter/XforWooCommerceFilter.php +4 -0
- includes/Integrations/Themes/Avada/Avada.php +40 -1
- includes/Integrations/Themes/BigCart/BigCart.php +20 -0
- includes/Integrations/Themes/CiyaShop/CiyaShop.php +20 -0
- includes/Integrations/Themes/Divi/Divi.php +18 -0
- includes/Integrations/Themes/OpenShop/OpenShop.php +20 -0
- includes/Integrations/Themes/ThemesCompatibility.php +12 -0
- includes/Multilingual.php +74 -5
- includes/Product.php +0 -3
- includes/Scripts.php +2 -0
- includes/Settings.php +21 -36
- partials/themes/bigcart.php +67 -0
- partials/themes/ciyashop.php +50 -0
- partials/themes/divi.php +63 -4
- partials/themes/open-shop.php +100 -0
- readme.txt +18 -2
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.8.
|
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
|
@@ -38,9 +38,16 @@ if ( !class_exists( 'DGWT_WC_Ajax_Search' ) && !function_exists( 'dgoraAsfwFs' )
|
|
38 |
*/
|
39 |
public $themeCompatibility ;
|
40 |
public $brands ;
|
|
|
|
|
|
|
|
|
41 |
public $nativeSearch ;
|
42 |
public $tntsearch ;
|
43 |
public $tntsearchValid = false ;
|
|
|
|
|
|
|
44 |
public $tntsearchMySql ;
|
45 |
public $tntsearchMySqlValid = false ;
|
46 |
public $searchInstances = 0 ;
|
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.8.2
|
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: 5.0
|
14 |
*
|
15 |
*/
|
16 |
// Exit if accessed directly
|
38 |
*/
|
39 |
public $themeCompatibility ;
|
40 |
public $brands ;
|
41 |
+
/**
|
42 |
+
* @var \DgoraWcas\Integrations\Marketplace\Marketplace
|
43 |
+
*/
|
44 |
+
public $marketplace ;
|
45 |
public $nativeSearch ;
|
46 |
public $tntsearch ;
|
47 |
public $tntsearchValid = false ;
|
48 |
+
/**
|
49 |
+
* @var \DgoraWcas\Engines\TNTSearchMySQL\TNTSearch
|
50 |
+
*/
|
51 |
public $tntsearchMySql ;
|
52 |
public $tntsearchMySqlValid = false ;
|
53 |
public $searchInstances = 0 ;
|
assets/css/admin-style.css
CHANGED
@@ -41,6 +41,8 @@
|
|
41 |
.dgwt-wcas-settings > .warning:not(.dgwt-wcas-notice),
|
42 |
.dgwt-wcas-settings > .updated:not(.dgwt-wcas-notice),
|
43 |
.woocommerce_page_dgwt_wcas_settings .update-nag,
|
|
|
|
|
44 |
.dgwt-wcas-settings > .updated:not(.fs-slug-ajax-search-for-woocommerce) {
|
45 |
display: none!important;
|
46 |
}
|
@@ -1112,6 +1114,12 @@ td.dgwt-wcas-indexing-details-row a {
|
|
1112 |
display: inline-block;
|
1113 |
border-bottom: 1px solid #444;
|
1114 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
1115 |
|
1116 |
.dgwt_wcas_settings-group .wp-picker-clear {
|
1117 |
display: none;
|
@@ -1420,6 +1428,10 @@ td.dgwt-wcas-indexing-details-row a {
|
|
1420 |
color: #000;
|
1421 |
}
|
1422 |
|
|
|
|
|
|
|
|
|
1423 |
/**
|
1424 |
* Troubleshooting
|
1425 |
*/
|
@@ -1485,3 +1497,59 @@ h3.dgwt-wcas-troubleshooting-issue-title {
|
|
1485 |
.dgwt-wcas-troubleshooting-wrapper input[name="dgwt-wcas-reset-async-tests"] {
|
1486 |
margin-top: 30px;
|
1487 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
41 |
.dgwt-wcas-settings > .warning:not(.dgwt-wcas-notice),
|
42 |
.dgwt-wcas-settings > .updated:not(.dgwt-wcas-notice),
|
43 |
.woocommerce_page_dgwt_wcas_settings .update-nag,
|
44 |
+
.woocommerce_page_dgwt_wcas_settings .dup-updated,
|
45 |
+
.woocommerce_page_dgwt_wcas_settings .sbi_notice,
|
46 |
.dgwt-wcas-settings > .updated:not(.fs-slug-ajax-search-for-woocommerce) {
|
47 |
display: none!important;
|
48 |
}
|
1114 |
display: inline-block;
|
1115 |
border-bottom: 1px solid #444;
|
1116 |
}
|
1117 |
+
.dgwt_wcas_settings-group .selectize-dropdown-content .optgroup .optgroup-header {
|
1118 |
+
font-weight: bold;
|
1119 |
+
}
|
1120 |
+
.dgwt_wcas_settings-group .selectize-dropdown-content .optgroup .option {
|
1121 |
+
padding-left: 20px;
|
1122 |
+
}
|
1123 |
|
1124 |
.dgwt_wcas_settings-group .wp-picker-clear {
|
1125 |
display: none;
|
1428 |
color: #000;
|
1429 |
}
|
1430 |
|
1431 |
+
.dgwt-wcas-sgs-market-label label img {
|
1432 |
+
max-width: 64px;
|
1433 |
+
}
|
1434 |
+
|
1435 |
/**
|
1436 |
* Troubleshooting
|
1437 |
*/
|
1497 |
.dgwt-wcas-troubleshooting-wrapper input[name="dgwt-wcas-reset-async-tests"] {
|
1498 |
margin-top: 30px;
|
1499 |
}
|
1500 |
+
|
1501 |
+
/* Settings - Filters rules */
|
1502 |
+
#dgwt-wcas-settings-filters-rules .dgwt-wcas-select-group {
|
1503 |
+
margin-right: 10px;
|
1504 |
+
}
|
1505 |
+
|
1506 |
+
#dgwt-wcas-settings-filters-rules .dgwt-wcas-delete-rule {
|
1507 |
+
height: 24px;
|
1508 |
+
width: 24px;
|
1509 |
+
cursor: pointer;
|
1510 |
+
display: block;
|
1511 |
+
}
|
1512 |
+
|
1513 |
+
.dgwt-wcas-settings-filters-rules-container {
|
1514 |
+
display: flex;
|
1515 |
+
flex-wrap: wrap;
|
1516 |
+
flex-direction: row;
|
1517 |
+
justify-content: start;
|
1518 |
+
align-content: start;
|
1519 |
+
align-items: center;
|
1520 |
+
margin-bottom: 10px;
|
1521 |
+
}
|
1522 |
+
|
1523 |
+
.dgwt-wcas-settings-filters-rules-item {
|
1524 |
+
flex: 0 0 auto;
|
1525 |
+
}
|
1526 |
+
|
1527 |
+
.dgwt-wcas-settings-filters-rules-container .selectize-control {
|
1528 |
+
margin-right: 10px;
|
1529 |
+
}
|
1530 |
+
|
1531 |
+
.dgwt-wcas-settings-filters-rules-container .selectize-control.loading::before {
|
1532 |
+
opacity: 1;
|
1533 |
+
}
|
1534 |
+
|
1535 |
+
.dgwt-wcas-settings-filters-rules-container .selectize-control::before {
|
1536 |
+
-moz-transition: opacity 0.2s;
|
1537 |
+
-webkit-transition: opacity 0.2s;
|
1538 |
+
transition: opacity 0.2s;
|
1539 |
+
content: ' ';
|
1540 |
+
z-index: 2;
|
1541 |
+
position: absolute;
|
1542 |
+
display: block;
|
1543 |
+
top: 50%;
|
1544 |
+
right: 10px;
|
1545 |
+
width: 20px;
|
1546 |
+
height: 20px;
|
1547 |
+
margin: -12px 0 0 0;
|
1548 |
+
background: url(../img/preloader.gif);
|
1549 |
+
background-size: 20px 20px;
|
1550 |
+
opacity: 0;
|
1551 |
+
}
|
1552 |
+
|
1553 |
+
.dgwt-wcas-settings-filters-rules-container .selectize-control.single::before {
|
1554 |
+
right: 34px;
|
1555 |
+
}
|
assets/css/style.css
CHANGED
@@ -283,6 +283,17 @@ a.dgwt-wcas-product-details-readmore:hover {
|
|
283 |
font-size: 0.8em;
|
284 |
}
|
285 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
286 |
.dgwt-wcas-suggestion-selected {
|
287 |
background-color: #eeeeee;
|
288 |
}
|
@@ -1215,13 +1226,23 @@ body:not(.dgwt-wcas-is-details) .dgwt-wcas-suggestion:last-child {
|
|
1215 |
width: 100%;
|
1216 |
}
|
1217 |
|
1218 |
-
.dgwt-wcas-om-bar .dgwt-wcas-om-return
|
1219 |
-
|
1220 |
-
|
1221 |
-
|
1222 |
-
|
1223 |
-
|
1224 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1225 |
}
|
1226 |
|
1227 |
.dgwt-wcas-om-bar .dgwt-wcas-om-return svg {
|
283 |
font-size: 0.8em;
|
284 |
}
|
285 |
|
286 |
+
.dgwt-wcas-vendor-city{
|
287 |
+
margin-left:5px;
|
288 |
+
font-size: 0.8em;;
|
289 |
+
}
|
290 |
+
|
291 |
+
.dgwt-wcas-st > .dgwt-wcas-product-vendor{
|
292 |
+
font-size:12px;
|
293 |
+
margin-top:5px;
|
294 |
+
display: block;
|
295 |
+
}
|
296 |
+
|
297 |
.dgwt-wcas-suggestion-selected {
|
298 |
background-color: #eeeeee;
|
299 |
}
|
1226 |
width: 100%;
|
1227 |
}
|
1228 |
|
1229 |
+
.dgwt-wcas-om-bar button.dgwt-wcas-om-return,
|
1230 |
+
.dgwt-wcas-om-bar button.dgwt-wcas-om-return:hover,
|
1231 |
+
.dgwt-wcas-om-bar button.dgwt-wcas-om-return:focus,
|
1232 |
+
.dgwt-wcas-om-bar button.dgwt-wcas-om-return:active {
|
1233 |
+
width: 45px;
|
1234 |
+
height: 100%;
|
1235 |
+
display: block;
|
1236 |
+
background: #ccc;
|
1237 |
+
cursor: pointer;
|
1238 |
+
position: relative;
|
1239 |
+
margin: 0;
|
1240 |
+
padding: 0;
|
1241 |
+
box-shadow: none;
|
1242 |
+
outline: none;
|
1243 |
+
border: medium none;
|
1244 |
+
border-spacing: 0;
|
1245 |
+
border-radius: 0;
|
1246 |
}
|
1247 |
|
1248 |
.dgwt-wcas-om-bar .dgwt-wcas-om-return svg {
|
assets/css/style.min.css
CHANGED
@@ -1 +1 @@
|
|
1 |
-
.dgwt-wcas-block-scroll{overflow:hidden}.dgwt-wcas-search-wrapp{position:relative;line-height:100%;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;margin:0;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;overflow-y:auto}.dgwt-wcas-details-wrapp *,.dgwt-wcas-search-wrapp *,.dgwt-wcas-suggestions-wrapp *{-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box}.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;width:100%}.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;width:100%}.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-repeat:no-repeat;background-position:right 8px center;background-size:auto 22px;display:flex;align-items:center;justify-content:center}@media all and (-ms-high-contrast:none),(-ms-high-contrast:active){.dgwt-wcas-inner-preloader{background-image:url(../img/preloader.gif)}}.dgwt-wcas-loader-circular{height:24px;width:24px;-webkit-animation:2s linear infinite rotate;-moz-animation:2s linear infinite rotate;animation:2s linear infinite rotate}.dgwt-wcas-loader-circular-path{fill:transparent;stroke-linecap:round;stroke-width:4px;stroke-dasharray:1,200;stroke-dashoffset:0;-webkit-transform-origin:50% 50%;-moz-transform-origin:50% 50%;-ms-transform-origin:50% 50%;transform-origin:50% 50%;-webkit-animation:1s ease-in-out infinite dash;-moz-animation:1s ease-in-out infinite dash;animation:1s ease-in-out infinite dash}@-webkit-keyframes rotate{100%{-webkit-transform:rotate(360deg);transform:rotate(360deg)}}@-moz-keyframes rotate{100%{-moz-transform:rotate(360deg);transform:rotate(360deg)}}@keyframes rotate{100%{-webkit-transform:rotate(360deg);-moz-transform:rotate(360deg);transform:rotate(360deg)}}@-webkit-keyframes dash{0%{stroke-dasharray:1,200;stroke-dashoffset:0}50%{stroke-dasharray:89,200;stroke-dashoffset:-35px}100%{stroke-dasharray:89,200;stroke-dashoffset:-124px}}@-moz-keyframes dash{0%{stroke-dasharray:1,200;stroke-dashoffset:0}50%{stroke-dasharray:89,200;stroke-dashoffset:-35px}100%{stroke-dasharray:89,200;stroke-dashoffset:-124px}}@keyframes dash{0%{stroke-dasharray:1,200;stroke-dashoffset:0}50%{stroke-dasharray:89,200;stroke-dashoffset:-35px}100%{stroke-dasharray:89,200;stroke-dashoffset:-124px}}.dgwt-wcas-close:not(.dgwt-wcas-inner-preloader){cursor:pointer;display:flex;align-items:center;justify-content:center;-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);-webkit-transition:all 150ms ease-in;-moz-transition:all 150ms ease-in;-ms-transition:all 150ms ease-in;-o-transition:all 150ms ease-in;transition:all 150ms ease-in}.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;width:auto;line-height:100%;min-height:100%;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-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-ico-magnifier,.dgwt-wcas-ico-magnifier-handler{max-width:20px}.dgwt-wcas-no-submit .dgwt-wcas-ico-magnifier{height:50%;margin:auto;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;min-width:100vw;min-height:100vh}.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-has-submit .dgwt-wcas-search-submit svg path{fill:#fff}.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}@keyframes dgwt-wcas-preloader-price-anim{0%{background:rgba(128,128,128,.03)}50%{background:rgba(128,128,128,.1)}100%{background:rgba(128,128,128,.03)}}.dgwt-wcas-preloader-price-inner div:nth-child(1){left:0;animation-delay:-.1s}.dgwt-wcas-preloader-price-inner div:nth-child(2){left:13px;animation-delay:-.2s}.dgwt-wcas-preloader-price-inner div:nth-child(3){left:26px;animation-delay:-.3s}.dgwt-wcas-preloader-price{width:34px;height:10px;display:inline-block;overflow:hidden;background:0 0}.dgwt-wcas-preloader-price-inner{width:100%;height:100%;position:relative;transform:translateZ(0) scale(1);backface-visibility:hidden;transform-origin:0 0}.dgwt-wcas-preloader-price-inner div{position:absolute;width:8px;height:8px;background:rgba(128,128,128,.05);animation:dgwt-wcas-preloader-price-anim .8s cubic-bezier(0,.5,.5,1) infinite;-webkit-transition:all .2s ease-in-out;-moz-transition:all .2s ease-in-out;-ms-transition:all .2s ease-in-out;-o-transition:all .2s ease-in-out;transition:all .2s ease-in-out}.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;margin:0}.dgwt-wcas-overlay-mobile .dgwt-wcas-search-form{width:100%}.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;margin:0;display:block}.dgwt-wcas-overlay-mobile-on .dgwt-wcas-suggestion{width:100%}.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.dgwt-wcas-is-ios .dgwt-wcas-suggestions-wrapp{height:calc(100% - 45px)!important}.dgwt-wcas-overlay-mobile-on.dgwt-wcas-is-ios{overflow:visible}.dgwt-wcas-overlay-mobile-on.dgwt-wcas-is-ios .dgwt-wcas-suggestions-wrapp{max-height:none!important;height:auto!important}.dgwt-wcas-overlay-mobile-on.dgwt-wcas-is-ios body: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-search-wrapp.dgwt-wcas-layout-icon{min-width:unset}.dgwt-wcas-layout-icon-flexible .dgwt-wcas-search-form{opacity:0}.dgwt-wcas-layout-icon-flexible-loaded .dgwt-wcas-search-form{opacity:1}.dgwt-wcas-search-icon-arrow{display:none}html:not(.dgwt-wcas-overlay-mobile-on) .dgwt-wcas-search-wrapp.dgwt-wcas-layout-icon .dgwt-wcas-search-form{opacity:0;display:none;position:absolute;left:0;top:calc(100% + 8px);min-width:500px;z-index:1000}.dgwt-wcas-overlay-mobile .dgwt-wcas-search-icon,.dgwt-wcas-overlay-mobile .dgwt-wcas-search-icon-arrow{display:none}html:not(.dgwt-wcas-overlay-mobile-on) .dgwt-wcas-search-wrapp.dgwt-wcas-layout-icon.dgwt-wcas-layout-icon-open .dgwt-wcas-search-form{display:block;opacity:1}.dgwt-wcas-search-icon{width:20px;height:auto;cursor:pointer}.dgwt-wcas-ico-magnifier-handler{margin-bottom:-.2em;width:100%}.dgwt-wcas-search-wrapp.dgwt-wcas-layout-icon.dgwt-wcas-layout-icon-open .dgwt-wcas-search-icon{opacity:.6}.dgwt-wcas-search-wrapp.dgwt-wcas-layout-icon.dgwt-wcas-layout-icon-open:not(.dgwt-wcas-has-submit) .dgwt-wcas-sf-wrapp .dgwt-wcas-ico-magnifier{display:none}.dgwt-wcas-search-wrapp.dgwt-wcas-layout-icon.dgwt-wcas-layout-icon-open.dgwt-wcas-no-submit .dgwt-wcas-sf-wrapp input[type=search].dgwt-wcas-search-input{padding-left:15px}.dgwt-wcas-layout-icon-open .dgwt-wcas-search-icon-arrow{display:block;position:absolute;top:calc(100% + 2px);left:0;z-index:5;width:15px;height:15px;background:#fff;border:1px solid #ddd;-webkit-transform:rotate(45deg);-moz-transform:rotate(45deg);-o-transform:rotate(45deg);-ms-transform:rotate(45deg);transform:rotate(45deg)}.dgwt-wcas-layout-icon-flexible:not(.dgwt-wcas-layout-icon) .dgwt-wcas-search-icon,.dgwt-wcas-layout-icon-flexible:not(.dgwt-wcas-layout-icon) .dgwt-wcas-search-icon-arrow{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;line-height:100%;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;margin:0;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;overflow-y:auto}.dgwt-wcas-details-wrapp *,.dgwt-wcas-search-wrapp *,.dgwt-wcas-suggestions-wrapp *{-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box}.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;width:100%}.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;width:100%}.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-vendor-city{margin-left:5px;font-size:.8em}.dgwt-wcas-st>.dgwt-wcas-product-vendor{font-size:12px;margin-top:5px;display:block}.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-repeat:no-repeat;background-position:right 8px center;background-size:auto 22px;display:flex;align-items:center;justify-content:center}@media all and (-ms-high-contrast:none),(-ms-high-contrast:active){.dgwt-wcas-inner-preloader{background-image:url(../img/preloader.gif)}}.dgwt-wcas-loader-circular{height:24px;width:24px;-webkit-animation:2s linear infinite rotate;-moz-animation:2s linear infinite rotate;animation:2s linear infinite rotate}.dgwt-wcas-loader-circular-path{fill:transparent;stroke-linecap:round;stroke-width:4px;stroke-dasharray:1,200;stroke-dashoffset:0;-webkit-transform-origin:50% 50%;-moz-transform-origin:50% 50%;-ms-transform-origin:50% 50%;transform-origin:50% 50%;-webkit-animation:1s ease-in-out infinite dash;-moz-animation:1s ease-in-out infinite dash;animation:1s ease-in-out infinite dash}@-webkit-keyframes rotate{100%{-webkit-transform:rotate(360deg);transform:rotate(360deg)}}@-moz-keyframes rotate{100%{-moz-transform:rotate(360deg);transform:rotate(360deg)}}@keyframes rotate{100%{-webkit-transform:rotate(360deg);-moz-transform:rotate(360deg);transform:rotate(360deg)}}@-webkit-keyframes dash{0%{stroke-dasharray:1,200;stroke-dashoffset:0}50%{stroke-dasharray:89,200;stroke-dashoffset:-35px}100%{stroke-dasharray:89,200;stroke-dashoffset:-124px}}@-moz-keyframes dash{0%{stroke-dasharray:1,200;stroke-dashoffset:0}50%{stroke-dasharray:89,200;stroke-dashoffset:-35px}100%{stroke-dasharray:89,200;stroke-dashoffset:-124px}}@keyframes dash{0%{stroke-dasharray:1,200;stroke-dashoffset:0}50%{stroke-dasharray:89,200;stroke-dashoffset:-35px}100%{stroke-dasharray:89,200;stroke-dashoffset:-124px}}.dgwt-wcas-close:not(.dgwt-wcas-inner-preloader){cursor:pointer;display:flex;align-items:center;justify-content:center;-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);-webkit-transition:all 150ms ease-in;-moz-transition:all 150ms ease-in;-ms-transition:all 150ms ease-in;-o-transition:all 150ms ease-in;transition:all 150ms ease-in}.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;width:auto;line-height:100%;min-height:100%;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-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-ico-magnifier,.dgwt-wcas-ico-magnifier-handler{max-width:20px}.dgwt-wcas-no-submit .dgwt-wcas-ico-magnifier{height:50%;margin:auto;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;min-width:100vw;min-height:100vh}.dgwt-wcas-om-bar{display:flex;height:45px;width:100%}.dgwt-wcas-om-bar button.dgwt-wcas-om-return,.dgwt-wcas-om-bar button.dgwt-wcas-om-return:active,.dgwt-wcas-om-bar button.dgwt-wcas-om-return:focus,.dgwt-wcas-om-bar button.dgwt-wcas-om-return:hover{width:45px;height:100%;display:block;background:#ccc;cursor:pointer;position:relative;margin:0;padding:0;box-shadow:none;outline:0;border:medium none;border-spacing:0;border-radius:0}.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-has-submit .dgwt-wcas-search-submit svg path{fill:#fff}.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}@keyframes dgwt-wcas-preloader-price-anim{0%{background:rgba(128,128,128,.03)}50%{background:rgba(128,128,128,.1)}100%{background:rgba(128,128,128,.03)}}.dgwt-wcas-preloader-price-inner div:nth-child(1){left:0;animation-delay:-.1s}.dgwt-wcas-preloader-price-inner div:nth-child(2){left:13px;animation-delay:-.2s}.dgwt-wcas-preloader-price-inner div:nth-child(3){left:26px;animation-delay:-.3s}.dgwt-wcas-preloader-price{width:34px;height:10px;display:inline-block;overflow:hidden;background:0 0}.dgwt-wcas-preloader-price-inner{width:100%;height:100%;position:relative;transform:translateZ(0) scale(1);backface-visibility:hidden;transform-origin:0 0}.dgwt-wcas-preloader-price-inner div{position:absolute;width:8px;height:8px;background:rgba(128,128,128,.05);animation:dgwt-wcas-preloader-price-anim .8s cubic-bezier(0,.5,.5,1) infinite;-webkit-transition:all .2s ease-in-out;-moz-transition:all .2s ease-in-out;-ms-transition:all .2s ease-in-out;-o-transition:all .2s ease-in-out;transition:all .2s ease-in-out}.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;margin:0}.dgwt-wcas-overlay-mobile .dgwt-wcas-search-form{width:100%}.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;margin:0;display:block}.dgwt-wcas-overlay-mobile-on .dgwt-wcas-suggestion{width:100%}.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.dgwt-wcas-is-ios .dgwt-wcas-suggestions-wrapp{height:calc(100% - 45px)!important}.dgwt-wcas-overlay-mobile-on.dgwt-wcas-is-ios{overflow:visible}.dgwt-wcas-overlay-mobile-on.dgwt-wcas-is-ios .dgwt-wcas-suggestions-wrapp{max-height:none!important;height:auto!important}.dgwt-wcas-overlay-mobile-on.dgwt-wcas-is-ios body: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-search-wrapp.dgwt-wcas-layout-icon{min-width:unset}.dgwt-wcas-layout-icon-flexible .dgwt-wcas-search-form{opacity:0}.dgwt-wcas-layout-icon-flexible-loaded .dgwt-wcas-search-form{opacity:1}.dgwt-wcas-search-icon-arrow{display:none}html:not(.dgwt-wcas-overlay-mobile-on) .dgwt-wcas-search-wrapp.dgwt-wcas-layout-icon .dgwt-wcas-search-form{opacity:0;display:none;position:absolute;left:0;top:calc(100% + 8px);min-width:500px;z-index:1000}.dgwt-wcas-overlay-mobile .dgwt-wcas-search-icon,.dgwt-wcas-overlay-mobile .dgwt-wcas-search-icon-arrow{display:none}html:not(.dgwt-wcas-overlay-mobile-on) .dgwt-wcas-search-wrapp.dgwt-wcas-layout-icon.dgwt-wcas-layout-icon-open .dgwt-wcas-search-form{display:block;opacity:1}.dgwt-wcas-search-icon{width:20px;height:auto;cursor:pointer}.dgwt-wcas-ico-magnifier-handler{margin-bottom:-.2em;width:100%}.dgwt-wcas-search-wrapp.dgwt-wcas-layout-icon.dgwt-wcas-layout-icon-open .dgwt-wcas-search-icon{opacity:.6}.dgwt-wcas-search-wrapp.dgwt-wcas-layout-icon.dgwt-wcas-layout-icon-open:not(.dgwt-wcas-has-submit) .dgwt-wcas-sf-wrapp .dgwt-wcas-ico-magnifier{display:none}.dgwt-wcas-search-wrapp.dgwt-wcas-layout-icon.dgwt-wcas-layout-icon-open.dgwt-wcas-no-submit .dgwt-wcas-sf-wrapp input[type=search].dgwt-wcas-search-input{padding-left:15px}.dgwt-wcas-layout-icon-open .dgwt-wcas-search-icon-arrow{display:block;position:absolute;top:calc(100% + 2px);left:0;z-index:5;width:15px;height:15px;background:#fff;border:1px solid #ddd;-webkit-transform:rotate(45deg);-moz-transform:rotate(45deg);-o-transform:rotate(45deg);-ms-transform:rotate(45deg);transform:rotate(45deg)}.dgwt-wcas-layout-icon-flexible:not(.dgwt-wcas-layout-icon) .dgwt-wcas-search-icon,.dgwt-wcas-layout-icon-flexible:not(.dgwt-wcas-layout-icon) .dgwt-wcas-search-icon-arrow{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/admin.js
CHANGED
@@ -468,11 +468,12 @@
|
|
468 |
$tooltips.each(function () {
|
469 |
var element = $(this)[0];
|
470 |
var contentEl = $(this).data('tooltip-html-el');
|
|
|
471 |
|
472 |
if (contentEl) {
|
473 |
const instance = new DgwtWcasTooltip(element, {
|
474 |
title: $('.' + contentEl + ' > .dgwt-wcas-tooltip-wrapper')[0],
|
475 |
-
placement:
|
476 |
trigger: "hover",
|
477 |
html: true
|
478 |
});
|
@@ -1484,6 +1485,143 @@
|
|
1484 |
},
|
1485 |
}
|
1486 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1487 |
function automateSettingsColspan() {
|
1488 |
var $el = $('.js-dgwt-wcas-sgs-autocolspan');
|
1489 |
if ($el.length > 0) {
|
@@ -1542,6 +1680,8 @@
|
|
1542 |
TOOLTIP.init();
|
1543 |
ADVANCED_SETTINGS.init();
|
1544 |
TROUBLESHOOTING.init();
|
|
|
|
|
1545 |
window.DGWT_WCAS_SEARCH_PREVIEW.init();
|
1546 |
|
1547 |
});
|
468 |
$tooltips.each(function () {
|
469 |
var element = $(this)[0];
|
470 |
var contentEl = $(this).data('tooltip-html-el');
|
471 |
+
var placement = $(this).data('tooltip-placement');
|
472 |
|
473 |
if (contentEl) {
|
474 |
const instance = new DgwtWcasTooltip(element, {
|
475 |
title: $('.' + contentEl + ' > .dgwt-wcas-tooltip-wrapper')[0],
|
476 |
+
placement: placement,
|
477 |
trigger: "hover",
|
478 |
html: true
|
479 |
});
|
1485 |
},
|
1486 |
}
|
1487 |
|
1488 |
+
var SETTINGS_FILTERS_RULES = {
|
1489 |
+
init: function () {
|
1490 |
+
|
1491 |
+
if (typeof Vue == 'undefined') {
|
1492 |
+
return;
|
1493 |
+
}
|
1494 |
+
|
1495 |
+
var productSearchSettings = function ({nonce, options, type}) {
|
1496 |
+
return {
|
1497 |
+
persist: false,
|
1498 |
+
maxItems: null,
|
1499 |
+
valueField: 'key',
|
1500 |
+
labelField: 'label',
|
1501 |
+
searchField: ['label'],
|
1502 |
+
options: options,
|
1503 |
+
preload: true,
|
1504 |
+
create: function (input) {
|
1505 |
+
return {
|
1506 |
+
value: input.key,
|
1507 |
+
label: input.label
|
1508 |
+
}
|
1509 |
+
},
|
1510 |
+
load: function (query, callback) {
|
1511 |
+
$.ajax({
|
1512 |
+
url: ajaxurl,
|
1513 |
+
method: 'POST',
|
1514 |
+
data: {
|
1515 |
+
action: 'dgwt_wcas_settings_search_terms',
|
1516 |
+
query: query,
|
1517 |
+
type: type,
|
1518 |
+
_wpnonce: nonce
|
1519 |
+
},
|
1520 |
+
error: function () {
|
1521 |
+
callback();
|
1522 |
+
},
|
1523 |
+
success: function (res) {
|
1524 |
+
callback(res.data);
|
1525 |
+
}
|
1526 |
+
});
|
1527 |
+
}
|
1528 |
+
};
|
1529 |
+
};
|
1530 |
+
|
1531 |
+
Vue.component('dgwt-wcas-rule', {
|
1532 |
+
template: '#dgwt-wcas-settings-filters-rules-rule',
|
1533 |
+
components: {
|
1534 |
+
Selectize
|
1535 |
+
},
|
1536 |
+
props: ['nonce', 'rule', 'rules', 'index'],
|
1537 |
+
data() {
|
1538 |
+
return {
|
1539 |
+
isSelectActive: true,
|
1540 |
+
}
|
1541 |
+
},
|
1542 |
+
computed: {
|
1543 |
+
ruleValue(value) {
|
1544 |
+
return this.rule.group;
|
1545 |
+
},
|
1546 |
+
},
|
1547 |
+
watch: {
|
1548 |
+
rule: {
|
1549 |
+
handler: function () {
|
1550 |
+
this.$emit('update:rule', this.index);
|
1551 |
+
},
|
1552 |
+
deep: true,
|
1553 |
+
},
|
1554 |
+
ruleValue() {
|
1555 |
+
// Reset values on group change
|
1556 |
+
var vm = this;
|
1557 |
+
this.$emit('change:group', this.index);
|
1558 |
+
this.isSelectActive = false;
|
1559 |
+
setTimeout(function () {
|
1560 |
+
vm.isSelectActive = true;
|
1561 |
+
}, 0);
|
1562 |
+
},
|
1563 |
+
},
|
1564 |
+
methods: {
|
1565 |
+
deleteRule() {
|
1566 |
+
this.$emit('delete:rule', this.index)
|
1567 |
+
},
|
1568 |
+
getSelectizeSettings(type) {
|
1569 |
+
var options = (typeof dgwt_wcas_filters_rules_selected_options[type] === 'undefined') ? [] : dgwt_wcas_filters_rules_selected_options[type];
|
1570 |
+
return productSearchSettings({nonce: this.nonce, type: type, options: options});
|
1571 |
+
},
|
1572 |
+
},
|
1573 |
+
});
|
1574 |
+
|
1575 |
+
var FiltersRules = new Vue({
|
1576 |
+
el: '#dgwt-wcas-settings-filters-rules',
|
1577 |
+
components: {
|
1578 |
+
Selectize
|
1579 |
+
},
|
1580 |
+
data() {
|
1581 |
+
return {
|
1582 |
+
rules: []
|
1583 |
+
}
|
1584 |
+
},
|
1585 |
+
mounted() {
|
1586 |
+
try {
|
1587 |
+
const rules = JSON.parse(this.$refs['dgwt-wcas-settings-filters-rules-ref'].value);
|
1588 |
+
$.each(rules, function (index, rule) {
|
1589 |
+
rules[index].key = Math.random();
|
1590 |
+
});
|
1591 |
+
this.rules = rules;
|
1592 |
+
} catch (e) {
|
1593 |
+
}
|
1594 |
+
this.updateInput();
|
1595 |
+
},
|
1596 |
+
methods: {
|
1597 |
+
addRule() {
|
1598 |
+
this.rules.push({group: '', values: [], key: Math.random()});
|
1599 |
+
this.updateInput();
|
1600 |
+
},
|
1601 |
+
changeGroup(index) {
|
1602 |
+
this.rules[index].values = [];
|
1603 |
+
this.updateInput();
|
1604 |
+
},
|
1605 |
+
deleteRule(index) {
|
1606 |
+
this.rules = this.rules.filter(function (item, itemIndex) {
|
1607 |
+
return itemIndex !== index;
|
1608 |
+
});
|
1609 |
+
this.updateInput();
|
1610 |
+
},
|
1611 |
+
updateInput() {
|
1612 |
+
const rules = JSON.parse(JSON.stringify(this.rules));
|
1613 |
+
this.$refs['dgwt-wcas-settings-filters-rules-ref'].value = JSON.stringify(rules.map(function (rule) {
|
1614 |
+
if (typeof (rule['key'] !== 'undefined')) {
|
1615 |
+
delete (rule['key']);
|
1616 |
+
}
|
1617 |
+
return rule;
|
1618 |
+
}));
|
1619 |
+
}
|
1620 |
+
},
|
1621 |
+
});
|
1622 |
+
}
|
1623 |
+
};
|
1624 |
+
|
1625 |
function automateSettingsColspan() {
|
1626 |
var $el = $('.js-dgwt-wcas-sgs-autocolspan');
|
1627 |
if ($el.length > 0) {
|
1680 |
TOOLTIP.init();
|
1681 |
ADVANCED_SETTINGS.init();
|
1682 |
TROUBLESHOOTING.init();
|
1683 |
+
|
1684 |
+
SETTINGS_FILTERS_RULES.init();
|
1685 |
window.DGWT_WCAS_SEARCH_PREVIEW.init();
|
1686 |
|
1687 |
});
|
assets/js/admin.min.js
CHANGED
@@ -1 +1 @@
|
|
1 |
-
!function(s){var t={inputSel:"dgwt-wcas-options-toggle input[type=radio]",groupSel:"dgwt_wcas_settings-group",reloadChoices:function(t){var e=s('[name="'+t+'"]').closest("."+this.groupSel),a=s('[name="'+t+'"]:checked').val(),i="";this.hideAll(e),(a=a.replace("_","-")).length>0&&(i="wcas-opt-"+a),s("."+i).length>0&&s("."+i).fadeIn()},hideAll:function(s){s.find('tr[class*="wcas-opt-"]').hide()},registerListeners:function(){var t=this;s("."+t.inputSel).on("change",function(){t.reloadChoices(s(this).attr("name"))})},init:function(){var t=this,e=s("."+t.inputSel+":checked");e.length>0&&(t.registerListeners(),e.each(function(){t.reloadChoices(s(this).attr("name"))}))}},e={inputSel:"dgwt-wcas-options-cb-toggle input[type=checkbox]",groupSel:"dgwt_wcas_settings-group",reloadChoices:function(t){var e=t.is(":checked"),a=this.getGroupSelector(t);s("."+a+":not(.dgwt-wcas-options-cb-toggle)").hide(),e&&s("."+a).each(function(){s(this).hasClass("js-dgwt-wcas-adv-settings")&&s(".js-dgwt-wcas-adv-settings-toggle").hasClass("woocommerce-input-toggle--disabled")||s(this).fadeIn()})},getGroupSelector(t){var e=t.closest(".dgwt-wcas-options-cb-toggle"),a="",i=e.attr("class").split(/\s+/);return s.each(i,function(s,t){-1!==t.indexOf("js-dgwt-wcas-cbtgroup-")&&(a=t)}),a},registerListeners:function(){var t=this;s(document).on("change","."+t.inputSel,function(){t.reloadChoices(s(this))})},refresh:function(){var t=this,e=s("."+t.inputSel);e.length>0&&e.each(function(){var e=s(this).is(":checked"),a=t.getGroupSelector(s(this));e?s("."+a).fadeIn():s("."+a+":not(.dgwt-wcas-options-cb-toggle)").hide()})},init:function(){var t=this,e=s("."+t.inputSel);e.length>0&&(t.registerListeners(),e.each(function(){t.reloadChoices(s(this))}))}},a={layoutSelect:"select[id*='search_layout']",overlayMobile:"input[id*='enable_mobile_overlay']",mobileBreakpoint:"input[id*='mobile_breakpoint']",searchIconColor:"input[id*='search_icon_color']",$select:null,$overlayMobileEl:null,$mobileBreakpointEl:null,$searchIconColorEl:null,setConditions:function(){var t=this.$select.find("option:selected").val(),e=s(".js-dgwt-wcas-adv-settings-toggle").hasClass("woocommerce-input-toggle--enabled");switch(this.hideOption(this.$overlayMobileEl),this.hideOption(this.$mobileBreakpointEl),this.hideOption(this.$searchIconColorEl),s("input[id*='bg_search_icon_color']").closest("tr").show(),t){case"icon":e&&this.showOption(this.$searchIconColorEl);break;case"icon-flexible":e&&(this.showOption(this.$mobileBreakpointEl),this.showOption(this.$searchIconColorEl));break;default:e&&(this.showOption(this.$overlayMobileEl),s("input[id*='bg_search_icon_color']").closest("tr").hide(),this.$overlayMobileEl.is(":checked")&&this.showOption(this.$mobileBreakpointEl))}},hideOption:function(s){s.closest("tr").hide()},showOption:function(s){s.closest("tr").show()},registerListeners:function(){var s=this;s.$select.on("change",function(){s.setConditions()}),s.$overlayMobileEl.on("change",function(){s.setConditions()})},init:function(){var t=this,e=s(t.layoutSelect);e.length>0&&(t.$select=e,t.$overlayMobileEl=s(t.overlayMobile),t.$mobileBreakpointEl=s(t.mobileBreakpoint),t.$searchIconColorEl=s(t.searchIconColor),t.registerListeners(),setTimeout(function(){t.setConditions()},400))}},i={actionTriggerClass:"js-ajax-build-index",actionStopTriggerClass:"js-ajax-stop-build-index",indexingWrappoerClass:"js-dgwt-wcas-indexing-wrapper",getWrapper:function(){return s("."+this.indexingWrappoerClass).closest(".dgwt-wcas-settings-info")},registerListeners:function(){var t=this;s(document).on("click","."+t.actionTriggerClass,function(e){e.preventDefault();var a=s(this);a.attr("disabled","disabled"),s(".dgwt-wcas-settings-info").addClass("wcas-ajax-build-index-wait");var i=!!a.hasClass("js-ajax-build-index-emergency");i&&(s(".dgwt-wcas-indexing-header__title").text("[Emergency mode] Wait... Indexing in progress"),s(".dgwt-wcas-indexing-header__troubleshooting, .dgwt-wcas-indexing-header__actions, .js-dgwt-wcas-indexer-details").hide()),s.ajax({url:ajaxurl,type:"post",data:{action:"dgwt_wcas_build_index",emergency:i},success:function(s){void 0!==s&&s.success&&(t.getWrapper().html(s.data.html),t.heartbeat())},complete:function(){a.removeAttr("disabled"),s(".dgwt-wcas-settings-info").removeClass("wcas-ajax-build-index-wait"),i&&window.location.reload()}})}),s(document).on("click","."+t.actionStopTriggerClass,function(e){e.preventDefault();var a=s(this);a.attr("disabled","disabled"),s.ajax({url:ajaxurl,type:"post",data:{action:"dgwt_wcas_stop_build_index"},success:function(s){void 0!==s&&s.success&&(t.getWrapper().html(s.data.html),t.heartbeat())},complete:function(){a.removeAttr("disabled")}})})},heartbeat:function(){var t=this;setTimeout(function(){s.ajax({url:ajaxurl,type:"post",data:{action:"dgwt_wcas_build_index_heartbeat"},success:function(s){void 0!==s&&s.success&&(t.getWrapper().html(s.data.html),s.data.loop&&t.heartbeat())}})},1e3)},detailsToggle:function(){var t;s(document).on("click",".js-dgwt-wcas-indexing-details-trigger",function(e){e.preventDefault();var a=s(".js-dgwt-wcas-indexer-details");a.hasClass("show")?(a.removeClass("show"),a.addClass("hide"),s(".js-dgwt-wcas-indexing__showd").addClass("show").removeClass("hide"),s(".js-dgwt-wcas-indexing__hided").addClass("hide").removeClass("show"),t=!1):(a.addClass("show"),a.removeClass("hide"),s(".js-dgwt-wcas-indexing__showd").addClass("hide").removeClass("show"),s(".js-dgwt-wcas-indexing__hided").addClass("show").removeClass("hide"),t=!0),s.ajax({url:ajaxurl,type:"post",data:{action:"dgwt_wcas_index_details_toggle",display:t}})})},init:function(){this.registerListeners(),s("."+this.indexingWrappoerClass).length>0&&this.heartbeat(),this.detailsToggle()}},o={init:function(){var t=this;s(".dgwt-wcas-selectize").length>0&&s.ajax({url:ajaxurl,data:{action:"dgwt_wcas_settings_list_custom_fields",_wpnonce:s(".dgwt-wcas-selectize").data("security")},success:function(s){void 0!==s&&void 0!==s.data&&t.initSelectize(s.data)}})},initSelectize:function(t){var e=s(".dgwt-wcas-selectize");e.length>0&&e.each(function(){var e=s(this),a=e.data("options"),i=t;if(a.length>0){a=JSON.parse('["'+decodeURI(a.replace(/&/g,'","').replace(/=/g,'","'))+'"]');var o="";a.forEach(function(s,t){if((t+1)%2==0){var e={value:s,label:o};i.push(e),o=""}o=s})}s(this).selectize({persist:!1,maxItems:null,valueField:"key",labelField:"label",searchField:["value","label"],options:i,create:function(s){return{value:s.key,label:s.label}},load:function(t,a){if(!t.length)return a();s.ajax({url:ajaxurl,data:{action:"dgwt_wcas_settings_list_custom_fields",_wpnonce:e.data("security")},error:function(){a()},success:function(s){a(s.data)}})}})})}},n={init:function(){var t=s(".js-dgwt-wcas-tooltip");t.length>0&&t.each(function(){var t=s(this)[0],e=s(this).data("tooltip-html-el");if(e){new DgwtWcasTooltip(t,{title:s("."+e+" > .dgwt-wcas-tooltip-wrapper")[0],placement:"top",trigger:"hover",html:!0})}})}},c={advClass:"js-dgwt-wcas-adv-settings",highlightClass:"dgwt-wcas-opt-highlight",transClass:"dgwt-wcas-opt-transition",init:function(){this.clickListener(),this.setStartingState()},clickListener:function(){var t=this;s(document).on("click",".js-dgwt-wcas-settings__advanced",function(){var e;e=s(".js-dgwt-wcas-adv-settings-toggle").hasClass("woocommerce-input-toggle--disabled")?"show":"hide",t.saveChoice(e)})},setStartingState:function(){var t=s("."+this.advClass);t.length>0&&(s(".js-dgwt-wcas-adv-settings-toggle").hasClass("woocommerce-input-toggle--enabled")?(t.show(),e.refresh()):t.hide())},saveChoice:function(t){s(".js-dgwt-wcas-settings__advanced").append('<span class="dgwt-wcas-adv-settings-saving">saving...</span>'),s.ajax({url:ajaxurl,data:{action:"dgwt_wcas_adv_settings",adv_settings_value:t}}).done(function(t){s(".dgwt-wcas-adv-settings-saving").remove()});var e=s(".js-dgwt-wcas-adv-settings-toggle");"show"===t&&(e.removeClass("woocommerce-input-toggle--disabled"),e.addClass("woocommerce-input-toggle--enabled")),"hide"===t&&(e.removeClass("woocommerce-input-toggle--enabled"),e.addClass("woocommerce-input-toggle--disabled")),this.toggleAdvancedOpt(t)},toggleAdvancedOpt:function(t){var i=this,o=s("."+i.advClass);o.length>0&&(o.addClass(i.highlightClass),o.addClass(i.transClass),"show"===t&&o.fadeIn(500,function(){setTimeout(function(){o.removeClass(i.highlightClass),setTimeout(function(){o.removeClass(i.transClass),e.refresh(),a.setConditions()},500)},500)}),"hide"===t&&setTimeout(function(){o.removeClass(i.transClass),o.fadeOut(500,function(){o.removeClass(i.highlightClass)})},500))}};window.DGWT_WCAS_SEARCH_PREVIEW={previewWrapper:{},searchWrapp:{},suggestionWrapp:{},searchInput:{},init:function(){this.previewWrapper=s(".js-dgwt-wcas-preview"),this.searchWrapp=s(".js-dgwt-wcas-search-wrapp"),this.suggestionWrapp=s(".js-dgwt-wcas-suggestions-wrapp"),this.detailsWrapp=s(".js-dgwt-wcas-details-wrapp"),this.searchInput=s(".js-dgwt-wcas-search-input"),this.onChangeHandler(),this.onColorHandler(),this.onTypeHandler(),this.disableSubmit(),this.noResultsHandler(),this.fixSizesInit()},isChecked:function(s){return!!(s.length>0&&s.is(":checked"))},isColor:function(s){return"string"==typeof s&&7===s.length&&"#"===s.charAt(0)},camelCase:function(s){for(var t=s.split("_"),e="",a=0;a<t.length;a++)e+=t[a].charAt(0).toUpperCase()+t[a].slice(1);return e},disableSubmit:function(){var t,e;s(".js-dgwt-wcas-preview-source").on("click",function(a){a.preventDefault();var i=a.pageX-100,o=a.pageY+10;void 0!==t&&(clearTimeout(t),e&&e.remove()),s("body").append('<div class="dgwt-wcas-click-alert">No interaction! This is only a preview.</div>'),(e=s(".dgwt-wcas-click-alert")).css({left:i,top:o}),s(".dgwt-wcas-preview-source").addClass("dgwt-wcas-preview-source-no-click"),t=setTimeout(function(){e.fadeOut(500,function(){s(this).remove(),s(".dgwt-wcas-preview-source").removeClass("dgwt-wcas-preview-source-no-click")})},2e3)})},noResultsHandler:function(){var t=this,e=".js-dgwt-wcas-preview .dgwt-wcas-suggestion:not(.js-dgwt-wcas-suggestion-nores)",a="input[id*='search_no_results_text']";s(document).on("focus",a,function(){s(e).addClass("dgwt-wcas-hide"),s(".js-dgwt-wcas-suggestion-nores").removeClass("dgwt-wcas-hide"),t.detailsWrapp.addClass("dgwt-wcas-hide"),t.suggestionWrapp.addClass("dgwt-wcas-preview-nores")}),s(document).on("blur",a,function(){s(e).removeClass("dgwt-wcas-hide"),s(".js-dgwt-wcas-suggestion-nores").addClass("dgwt-wcas-hide"),t.detailsWrapp.removeClass("dgwt-wcas-hide"),t.suggestionWrapp.removeClass("dgwt-wcas-preview-nores")})},onChangeHandler:function(){for(var t=this,e=["show_submit_button","max_form_width","show_product_image","show_product_sku","show_product_desc","show_product_price","show_matching_categories","show_matching_tags","show_matching_brands","show_matching_posts","show_matching_pages","show_grouped_results","suggestions_limit","show_details_box"],a=0;a<e.length;a++){var i="input[id*='"+e[a]+"']",o=s(i),n="onChange"+t.camelCase(e[a]);"function"==typeof t[n]&&t[n](o,o.val()),s(document).on("change",i,function(){n=s(this).attr("id").replace("]","").replace("dgwt_wcas_settings[",""),n="onChange"+t.camelCase(n),t[n](s(this),this.value)})}},onColorHandler:function(){for(var t=this,e=["search_icon_color","bg_input_color","text_input_color","border_input_color","bg_submit_color","text_submit_color","sug_bg_color","sug_hover_color","sug_text_color","sug_highlight_color","sug_border_color"],a=0;a<e.length;a++){var i="input[id*='"+e[a]+"']",o=s(i),n="onColor"+t.camelCase(e[a]);t[n](o,o.val()),s(document).on("change",i,function(e){n=s(this).attr("id").replace("]","").replace("dgwt_wcas_settings[",""),n="onColor"+t.camelCase(n),t[n](s(this),this.value)})}},onColorChangeHandler:function(s,t){var e=s.attr("id").replace("]","").replace("dgwt_wcas_settings[","");this[e="onColor"+this.camelCase(e)](s,t)},onTypeHandler:function(){for(var t=this,e=["search_submit_text","search_placeholder","search_no_results_text","search_see_all_results_text"],a=0;a<e.length;a++){var i="input[id*='"+e[a]+"']",o=s(i),n="onType"+t.camelCase(e[a]);t[n](o,o.val()),s(document).on("input",i,function(e){n=s(e.target).attr("id").replace("]","").replace("dgwt_wcas_settings[",""),n="onType"+t.camelCase(n),t[n](s(e.target),this.value)})}},onChangeMaxFormWidth:function(t,e){e.length>0&&"0"!=e?(this.searchWrapp.css("max-width",e+"px"),this.suggestionWrapp.css("max-width",e+"px")):(this.searchWrapp.css("max-width","100%"),this.suggestionWrapp.css("max-width","100%")),this.onChangeShowDetailsBox(s("input[id*='show_details_box']"))},onChangeShowSubmitButton:function(t,e){var a=s(".js-dgwt-wcas-search-submit");if(this.isChecked(t)){this.searchWrapp.addClass("dgwt-wcas-has-submit"),this.searchWrapp.removeClass("dgwt-wcas-no-submit"),a.show(),s(".dgwt-wcas-sf-wrapp > .dgwt-wcas-ico-magnifier").hide();var i=s("input[id*='bg_submit_color']"),o=s("input[id*='text_submit_color']");this.onColorBgSubmitColor(i,i.val()),this.onColorTextSubmitColor(o,o.val())}else this.searchWrapp.addClass("dgwt-wcas-no-submit"),this.searchWrapp.removeClass("dgwt-wcas-has-submit"),a.hide(),s(".dgwt-wcas-sf-wrapp > .dgwt-wcas-ico-magnifier").show()},onChangeShowProductImage:function(t,e){var a=s(".js-dgwt-wcas-si"),i=s(".js-dgwt-wcas-content-wrapp");this.isChecked(t)?(this.suggestionWrapp.addClass("dgwt-wcas-has-img"),s(".dgwt-wcas-suggestion-product > .dgwt-wcas-st").remove(),s(".dgwt-wcas-suggestion-product > .dgwt-wcas-sp").remove(),i.show(),a.show()):(this.suggestionWrapp.removeClass("dgwt-wcas-has-img"),i.each(function(){s(this).closest(".dgwt-wcas-suggestion-product").append(s(this).html())}),i.hide(),a.hide())},onChangeShowProductSku:function(t,e){var a=s(".js-dgwt-wcas-sku");this.isChecked(t)?(this.suggestionWrapp.addClass("dgwt-wcas-has-sku"),a.show()):(this.suggestionWrapp.removeClass("dgwt-wcas-has-sku"),a.hide())},onChangeShowProductDesc:function(t,e){var a=s(".js-dgwt-wcas-sd");this.isChecked(t)?(this.suggestionWrapp.addClass("dgwt-wcas-has-desc"),a.show()):(this.suggestionWrapp.removeClass("dgwt-wcas-has-desc"),a.hide())},onChangeShowProductPrice:function(t,e){var a=s(".js-dgwt-wcas-sp");this.isChecked(t)?(this.suggestionWrapp.addClass("dgwt-wcas-has-price"),a.show()):(this.suggestionWrapp.removeClass("dgwt-wcas-has-price"),a.hide())},onChangeShowMatchingCategories:function(t,e){var a=s(".dgwt-wcas-suggestion-headline-cat"),i=s(".dgwt-wcas-suggestion-cat");this.isChecked(t)?(a.show(),i.show(),i.removeClass("js-dgwt-wcas-suggestion-hidden"),this.onChangeShowGroupedResults(s("input[id*='show_grouped_results']"))):(a.hide(),i.hide(),i.addClass("js-dgwt-wcas-suggestion-hidden"));var o=s("input[id*='suggestions_limit']");this.onChangeSuggestionsLimit(o,o.val())},onChangeShowMatchingTags:function(t,e){var a=s(".dgwt-wcas-suggestion-headline-tag"),i=s(".dgwt-wcas-suggestion-tag");this.isChecked(t)?(a.show(),i.show(),i.removeClass("js-dgwt-wcas-suggestion-hidden"),this.onChangeShowGroupedResults(s("input[id*='show_grouped_results']"))):(a.hide(),i.hide(),i.addClass("js-dgwt-wcas-suggestion-hidden"));var o=s("input[id*='suggestions_limit']");this.onChangeSuggestionsLimit(o,o.val())},onChangeShowMatchingBrands:function(t,e){var a=s(".dgwt-wcas-suggestion-headline-brand"),i=s(".dgwt-wcas-suggestion-brand");this.isChecked(t)?(a.show(),i.show(),i.removeClass("js-dgwt-wcas-suggestion-hidden"),this.onChangeShowGroupedResults(s("input[id*='show_grouped_results']"))):(a.hide(),i.hide(),i.addClass("js-dgwt-wcas-suggestion-hidden"));var o=s("input[id*='suggestions_limit']");this.onChangeSuggestionsLimit(o,o.val())},onChangeShowMatchingPosts:function(t,e){var a=s(".dgwt-wcas-suggestion-headline-post"),i=s(".dgwt-wcas-suggestion-post");this.isChecked(t)?(a.show(),i.show(),i.removeClass("js-dgwt-wcas-suggestion-hidden"),this.onChangeShowGroupedResults(s("input[id*='show_grouped_results']"))):(a.hide(),i.hide(),i.addClass("js-dgwt-wcas-suggestion-hidden"));var o=s("input[id*='suggestions_limit']");this.onChangeSuggestionsLimit(o,o.val())},onChangeShowMatchingPages:function(t,e){var a=s(".dgwt-wcas-suggestion-headline-page"),i=s(".dgwt-wcas-suggestion-page");this.isChecked(t)?(a.show(),i.show(),i.removeClass("js-dgwt-wcas-suggestion-hidden"),this.onChangeShowGroupedResults(s("input[id*='show_grouped_results']"))):(a.hide(),i.hide(),i.addClass("js-dgwt-wcas-suggestion-hidden"));var o=s("input[id*='suggestions_limit']");this.onChangeSuggestionsLimit(o,o.val())},onChangeShowGroupedResults:function(t,e){var a=s(".dgwt-wcas-st--direct-headline"),i=s(".dgwt-wcas-suggestion-headline");this.isChecked(t)?(a.addClass("dgwt-wcas-hidden"),this.suggestionWrapp.addClass("dgwt-wcas-has-headings"),s(".dgwt-wcas-suggestion-headline").show(),this.isChecked(s("input[id*='show_matching_categories']"))||s(".dgwt-wcas-suggestion-headline-cat").hide(),this.isChecked(s("input[id*='show_matching_tags']"))||s(".dgwt-wcas-suggestion-headline-tag").hide(),this.isChecked(s("input[id*='show_matching_brands']"))||s(".dgwt-wcas-suggestion-headline-brand").hide(),this.isChecked(s("input[id*='show_matching_posts']"))||s(".dgwt-wcas-suggestion-headline-post").hide(),this.isChecked(s("input[id*='show_matching_pages']"))||s(".dgwt-wcas-suggestion-headline-page").hide()):(a.removeClass("dgwt-wcas-hidden"),i.hide(),this.suggestionWrapp.removeClass("dgwt-wcas-has-headings"))},onChangeSuggestionsLimit:function(t,e){setTimeout(function(){var a=0,i=7,o=s(".dgwt-wcas-suggestion-duplicated"),n=["brand","cat","tag","post","page","product"];e.length>0&&"0"!=e&&(i=Math.abs(e)),o.length>0&&o.remove();var c=[];for(a=0;a<n.length;a++){var r=s(".dgwt-wcas-suggestion-"+n[a]+":not(.js-dgwt-wcas-suggestion-hidden)");r.length>0&&c.push(r)}var d=c.length;if(c.length>0)for(var g=i-c.length,l=c.length-1;g>0;){var h=c[l].clone();h.addClass("dgwt-wcas-suggestion-duplicated"),h.removeClass("dgwt-wcas-suggestion-selected"),c[l].after(h),d++,--l<0&&(l=c.length-1),g--}d>i&&t.val(d)},10)},onChangeShowDetailsBox:function(t,e){var a=this;a.isChecked(t)?(a.detailsWrapp.show(),a.searchWrapp.addClass("dgwt-wcas-is-detail-box"),a.previewWrapper.addClass("dgwt-wcas-is-details"),a.previewWrapper.addClass("dgwt-wcas-details-right"),setTimeout(function(){if(s(".dgwt-wcas-suggestion-product:not(.dgwt-wcas-suggestion-duplicated)").addClass("dgwt-wcas-suggestion-selected"),a.searchWrapp.width()>=550){a.previewWrapper.addClass("dgwt-wcas-full-width");var t=getComputedStyle(a.searchWrapp[0]).width;(t=Math.round(parseFloat(t.replace("px",""))))%2==0?(a.suggestionWrapp.css("width",Math.round(t/2)),a.detailsWrapp.css("width",Math.round(t/2))):(a.suggestionWrapp.css("width",Math.floor(t/2)),a.detailsWrapp.css("width",Math.ceil(t/2)))}else a.suggestionWrapp.width(a.searchWrapp.width())},10)):(a.detailsWrapp.hide(),a.searchWrapp.removeClass("dgwt-wcas-is-detail-box"),a.previewWrapper.removeClass("dgwt-wcas-is-details"),a.previewWrapper.removeClass("dgwt-wcas-details-right"),a.previewWrapper.removeClass("dgwt-wcas-full-width"),s(".dgwt-wcas-suggestion-product").removeClass("dgwt-wcas-suggestion-selected"),a.suggestionWrapp.css("width",""),a.detailsWrapp.css("width",""))},onColorSearchIconColor:function(s,t){},onColorBgInputColor:function(s,t){this.isColor(t)?this.searchInput.css("background-color",t):this.searchInput.css("background-color","")},onColorTextInputColor:function(t,e){var a="dgwt-wcas-preview-placeholder-style";if(this.isColor(e)){var i='<style class="'+a+'">';i+=".dgwt-wcas-search-input::placeholder{opacity: 0.3; color:"+e+"!important;}",i+=".dgwt-wcas-search-input::-webkit-input-placeholder{opacity: 0.3; color:"+e+"!important;}",i+=".dgwt-wcas-search-input:-moz-placeholder{opacity: 0.3; color:"+e+"!important;}",i+=".dgwt-wcas-search-input::-moz-placeholder{opacity: 0.3; color:"+e+"!important;}",i+=".dgwt-wcas-search-input:-ms-input-placeholder{opacity: 0.3; color:"+e+"!important;}",i+=".dgwt-wcas-ico-magnifier path {fill:"+e+"}",i+="</style>",s("head").append(i),this.searchInput.css("color",e)}else{this.searchInput.css("color","");var o=s("."+a);o.length>0&&o.remove()}},onColorBorderInputColor:function(s,t){this.isColor(t)?this.searchInput.css("border-color",t):this.searchInput.css("border-color","")},onColorBgSubmitColor:function(t,e){if(this.isChecked(s("input[id*='show_submit_button']"))&&this.isColor(e)){var a='<style class="dgwt-wcas-preview-submit-style">';a+=".dgwt-wcas-search-submit::before{border-color: transparent "+e+"!important;}",a+=".dgwt-wcas-search-submit:hover::before{border-right-color: "+e+"!important;}",a+=".dgwt-wcas-search-submit:focus::before{border-right-color: "+e+"!important;}",a+=".dgwt-wcas-search-submit{background-color: "+e+"!important;}",a+=".dgwt-wcas-om-bar .dgwt-wcas-om-return{background-color: "+e+"!important;}",a+="</style>",s("head").append(a)}else{var i=s(".dgwt-wcas-preview-submit-style");i.length>0&&i.remove()}},onColorTextSubmitColor:function(t,e){this.isChecked(s("input[id*='show_submit_button']"))&&this.isColor(e)?(s(".js-dgwt-wcas-search-submit").css("color",e),s(".dgwt-wcas-search-submit .dgwt-wcas-ico-magnifier path").css("fill",e)):(this.searchInput.css("background-color",""),s(".js-dgwt-wcas-search-submit").css("color",""),s(".dgwt-wcas-search-submit .dgwt-wcas-ico-magnifier path").css("fill",""))},onColorSugBgColor:function(t,e){var a="dgwt-wcas-preview-sugbgcol-style";if(this.isColor(e)){var i='<style class="'+a+'">';i+=".dgwt-wcas-suggestions-wrapp,",i+=".dgwt-wcas-details-wrapp",i+="{background-color: "+e+"!important;}",i+="</style>",s("head").append(i)}else{var o=s("."+a);o.length>0&&o.remove()}},onColorSugHoverColor:function(t,e){this.isColor(e)?setTimeout(function(){s(".dgwt-wcas-suggestion-selected").css("background-color",e)},50):s(".dgwt-wcas-suggestion-selected").css("background-color","")},onColorSugTextColor:function(t,e){var a="dgwt-wcas-preview-sugtextcol-style";if(this.isColor(e)){var i='<style class="'+a+'">';i+=".dgwt-wcas-suggestions-wrapp *,",i+=".dgwt-wcas-details-wrapp *,",i+=".dgwt-wcas-sd,",i+=".dgwt-wcas-suggestion *",i+="{color: "+e+"!important;}",i+="</style>",s("head").append(i)}else{var o=s("."+a);o.length>0&&o.remove()}},onColorSugHighlightColor:function(t,e){var a="dgwt-wcas-preview-sughighlight-style";if(this.isColor(e)){var i='<style class="'+a+'">';i+=".dgwt-wcas-st strong,",i+=".dgwt-wcas-sd strong",i+="{color: "+e+"!important;}",i+="</style>",s("head").append(i)}else{var o=s("."+a);o.length>0&&o.remove()}},onColorSugBorderColor:function(t,e){var a="dgwt-wcas-preview-sugborder-style";if(this.isColor(e)){var i='<style class="'+a+'">';i+=".dgwt-wcas-suggestions-wrapp,",i+=".dgwt-wcas-details-wrapp,",i+=".dgwt-wcas-suggestion,",i+=".dgwt-wcas-datails-title,",i+=".dgwt-wcas-details-more-products",i+="{border-color: "+e+"!important;}",i+="</style>",s("head").append(i)}else{var o=s("."+a);o.length>0&&o.remove()}},onTypeSearchSubmitText:function(t,e){var a=s(".js-dgwt-wcas-search-submit-l"),i=s(".js-dgwt-wcas-search-submit-m");e.length>0?(a.text(e),a.show(),i.hide()):(a.text(""),a.hide(),i.show())},onTypeSearchPlaceholder:function(s,t){0==t.length&&(t=dgwt_wcas.labels.search_placeholder),this.searchInput.attr("placeholder",t)},onTypeSearchNoResultsText:function(t,e){0==e.length&&(e=dgwt_wcas.labels.no_results),s(".js-dgwt-wcas-suggestion-nores span").text(e)},onTypeSearchSeeAllResultsText:function(t,e){0==e.length&&(e=dgwt_wcas.labels.show_more),s(".js-dgwt-wcas-st-more-label").text(e)},fixSizesInit:function(){var t=this;s(document).on("click","#dgwt_wcas_autocomplete-tab",function(){t.onChangeShowDetailsBox(s("input[id*='show_details_box']"))})}};var r={settingsTab:"#dgwt_wcas_troubleshooting-tab",noIssuesClass:".js-dgwt-wcas-troubleshooting-no-issues",counterClass:".js-dgwt-wcas-troubleshooting-count",issuesListClass:".js-dgwt-wcas-troubleshooting-issues",progressBar:".dgwt-wcas-troubleshooting-wrapper .progress_bar",progressBarInner:".dgwt-wcas-troubleshooting-wrapper .progress-bar-inner",resetButtonName:"dgwt-wcas-reset-async-tests",init:function(){var t=this;if(void 0===dgwt_wcas.troubleshooting)return;const e=dgwt_wcas.troubleshooting.tests.issues.critical+dgwt_wcas.troubleshooting.tests.issues.recommended;e>0&&(s(t.counterClass).text(e),s(t.settingsTab).addClass("enabled")),dgwt_wcas.troubleshooting.tests.results_async.length>0&&s.each(dgwt_wcas.troubleshooting.tests.results_async,function(){t.appendIssue(this,!1)}),dgwt_wcas.troubleshooting.tests.direct.length>0&&s.each(dgwt_wcas.troubleshooting.tests.direct,function(){t.appendIssue(this,!1)}),dgwt_wcas.troubleshooting.tests.async.length>0&&t.maybeRunNextAsyncTest(),s(document).on("click",'input[name="'+t.resetButtonName+'"]',function(e){s('input[name="'+t.resetButtonName+'"]').attr("disabled","disabled");var a={action:"dgwt_wcas_troubleshooting_reset_async_tests",_wpnonce:dgwt_wcas.troubleshooting.nonce.troubleshooting_reset_async_tests};return s.post(ajaxurl,a,function(){location.reload()}),!1})},appendIssue:function(t,e){var a,i=wp.template("dgwt-wcas-troubleshooting-issue"),o=s(this.issuesListClass+"-"+t.status);"good"!==t.status&&(s(this.noIssuesClass).hide(),e&&dgwt_wcas.troubleshooting.tests.issues[t.status]++,(a=dgwt_wcas.troubleshooting.tests.issues.critical+dgwt_wcas.troubleshooting.tests.issues.recommended)>0&&(s(this.counterClass).text(a),s(this.settingsTab).addClass("enabled")),s(o).append(i(t)))},maybeRunNextAsyncTest:function(){var t=this;dgwt_wcas.troubleshooting.tests.async.length>0&&s.each(dgwt_wcas.troubleshooting.tests.async,function(){var e={action:"dgwt_wcas_troubleshooting_test",test:this.test,_wpnonce:dgwt_wcas.troubleshooting.nonce.troubleshooting_async_test};return!!this.completed||(this.completed=!0,s(t.progressBar).show(),s.post(ajaxurl,e,function(s){s.success&&t.appendIssue(s.data,!0),t.maybeRunNextAsyncTest()}),!1)}),t.recalculateProgression()},recalculateProgression:function(){var t=this,e=dgwt_wcas.troubleshooting.tests.async.length,a=0;s.each(dgwt_wcas.troubleshooting.tests.async,function(){this.completed&&a++});var i=Math.ceil(a/e*100);s(t.progressBarInner).css("width",i+"%"),100===i&&setTimeout(function(){s(t.progressBar).slideUp()},2e3)}};s(document).ready(function(){var d,g;(d=s(".js-dgwt-wcas-settings-margin-nob")).length>0&&d.each(function(){var t=s(this).find("td .dgwt-wcas-fieldset");if(t.length>0){var e=s(this).prev(".js-dgwt-wcas-settings-margin");if(e.length>0){var a=s(this).attr("class").split(/\s+/),i="";s.each(a,function(s,t){-1!==t.indexOf("js-dgwt-wcas-cbtgroup-")&&(i=t)});var o=t.clone(!0,!0);o.addClass("dgwt-wcas-settings-margin-nob"),i&&o.addClass(i),o.appendTo(e.find("td")),s(this).remove()}}}),t.init(),e.init(),a.init(),(g=s(".js-dgwt-wcas-sgs-autocolspan")).length>0&&g.find("td").attr("colspan",2),i.init(),o.init(),n.init(),c.init(),r.init(),window.DGWT_WCAS_SEARCH_PREVIEW.init()})}(jQuery);
|
1 |
+
!function(s){var t={inputSel:"dgwt-wcas-options-toggle input[type=radio]",groupSel:"dgwt_wcas_settings-group",reloadChoices:function(t){var e=s('[name="'+t+'"]').closest("."+this.groupSel),a=s('[name="'+t+'"]:checked').val(),i="";this.hideAll(e),(a=a.replace("_","-")).length>0&&(i="wcas-opt-"+a),s("."+i).length>0&&s("."+i).fadeIn()},hideAll:function(s){s.find('tr[class*="wcas-opt-"]').hide()},registerListeners:function(){var t=this;s("."+t.inputSel).on("change",function(){t.reloadChoices(s(this).attr("name"))})},init:function(){var t=this,e=s("."+t.inputSel+":checked");e.length>0&&(t.registerListeners(),e.each(function(){t.reloadChoices(s(this).attr("name"))}))}},e={inputSel:"dgwt-wcas-options-cb-toggle input[type=checkbox]",groupSel:"dgwt_wcas_settings-group",reloadChoices:function(t){var e=t.is(":checked"),a=this.getGroupSelector(t);s("."+a+":not(.dgwt-wcas-options-cb-toggle)").hide(),e&&s("."+a).each(function(){s(this).hasClass("js-dgwt-wcas-adv-settings")&&s(".js-dgwt-wcas-adv-settings-toggle").hasClass("woocommerce-input-toggle--disabled")||s(this).fadeIn()})},getGroupSelector(t){var e=t.closest(".dgwt-wcas-options-cb-toggle"),a="",i=e.attr("class").split(/\s+/);return s.each(i,function(s,t){-1!==t.indexOf("js-dgwt-wcas-cbtgroup-")&&(a=t)}),a},registerListeners:function(){var t=this;s(document).on("change","."+t.inputSel,function(){t.reloadChoices(s(this))})},refresh:function(){var t=this,e=s("."+t.inputSel);e.length>0&&e.each(function(){var e=s(this).is(":checked"),a=t.getGroupSelector(s(this));e?s("."+a).fadeIn():s("."+a+":not(.dgwt-wcas-options-cb-toggle)").hide()})},init:function(){var t=this,e=s("."+t.inputSel);e.length>0&&(t.registerListeners(),e.each(function(){t.reloadChoices(s(this))}))}},a={layoutSelect:"select[id*='search_layout']",overlayMobile:"input[id*='enable_mobile_overlay']",mobileBreakpoint:"input[id*='mobile_breakpoint']",searchIconColor:"input[id*='search_icon_color']",$select:null,$overlayMobileEl:null,$mobileBreakpointEl:null,$searchIconColorEl:null,setConditions:function(){var t=this.$select.find("option:selected").val(),e=s(".js-dgwt-wcas-adv-settings-toggle").hasClass("woocommerce-input-toggle--enabled");switch(this.hideOption(this.$overlayMobileEl),this.hideOption(this.$mobileBreakpointEl),this.hideOption(this.$searchIconColorEl),s("input[id*='bg_search_icon_color']").closest("tr").show(),t){case"icon":e&&this.showOption(this.$searchIconColorEl);break;case"icon-flexible":e&&(this.showOption(this.$mobileBreakpointEl),this.showOption(this.$searchIconColorEl));break;default:e&&(this.showOption(this.$overlayMobileEl),s("input[id*='bg_search_icon_color']").closest("tr").hide(),this.$overlayMobileEl.is(":checked")&&this.showOption(this.$mobileBreakpointEl))}},hideOption:function(s){s.closest("tr").hide()},showOption:function(s){s.closest("tr").show()},registerListeners:function(){var s=this;s.$select.on("change",function(){s.setConditions()}),s.$overlayMobileEl.on("change",function(){s.setConditions()})},init:function(){var t=this,e=s(t.layoutSelect);e.length>0&&(t.$select=e,t.$overlayMobileEl=s(t.overlayMobile),t.$mobileBreakpointEl=s(t.mobileBreakpoint),t.$searchIconColorEl=s(t.searchIconColor),t.registerListeners(),setTimeout(function(){t.setConditions()},400))}},i={actionTriggerClass:"js-ajax-build-index",actionStopTriggerClass:"js-ajax-stop-build-index",indexingWrappoerClass:"js-dgwt-wcas-indexing-wrapper",getWrapper:function(){return s("."+this.indexingWrappoerClass).closest(".dgwt-wcas-settings-info")},registerListeners:function(){var t=this;s(document).on("click","."+t.actionTriggerClass,function(e){e.preventDefault();var a=s(this);a.attr("disabled","disabled"),s(".dgwt-wcas-settings-info").addClass("wcas-ajax-build-index-wait");var i=!!a.hasClass("js-ajax-build-index-emergency");i&&(s(".dgwt-wcas-indexing-header__title").text("[Emergency mode] Wait... Indexing in progress"),s(".dgwt-wcas-indexing-header__troubleshooting, .dgwt-wcas-indexing-header__actions, .js-dgwt-wcas-indexer-details").hide()),s.ajax({url:ajaxurl,type:"post",data:{action:"dgwt_wcas_build_index",emergency:i},success:function(s){void 0!==s&&s.success&&(t.getWrapper().html(s.data.html),t.heartbeat())},complete:function(){a.removeAttr("disabled"),s(".dgwt-wcas-settings-info").removeClass("wcas-ajax-build-index-wait"),i&&window.location.reload()}})}),s(document).on("click","."+t.actionStopTriggerClass,function(e){e.preventDefault();var a=s(this);a.attr("disabled","disabled"),s.ajax({url:ajaxurl,type:"post",data:{action:"dgwt_wcas_stop_build_index"},success:function(s){void 0!==s&&s.success&&(t.getWrapper().html(s.data.html),t.heartbeat())},complete:function(){a.removeAttr("disabled")}})})},heartbeat:function(){var t=this;setTimeout(function(){s.ajax({url:ajaxurl,type:"post",data:{action:"dgwt_wcas_build_index_heartbeat"},success:function(s){void 0!==s&&s.success&&(t.getWrapper().html(s.data.html),s.data.loop&&t.heartbeat())}})},1e3)},detailsToggle:function(){var t;s(document).on("click",".js-dgwt-wcas-indexing-details-trigger",function(e){e.preventDefault();var a=s(".js-dgwt-wcas-indexer-details");a.hasClass("show")?(a.removeClass("show"),a.addClass("hide"),s(".js-dgwt-wcas-indexing__showd").addClass("show").removeClass("hide"),s(".js-dgwt-wcas-indexing__hided").addClass("hide").removeClass("show"),t=!1):(a.addClass("show"),a.removeClass("hide"),s(".js-dgwt-wcas-indexing__showd").addClass("hide").removeClass("show"),s(".js-dgwt-wcas-indexing__hided").addClass("show").removeClass("hide"),t=!0),s.ajax({url:ajaxurl,type:"post",data:{action:"dgwt_wcas_index_details_toggle",display:t}})})},init:function(){this.registerListeners(),s("."+this.indexingWrappoerClass).length>0&&this.heartbeat(),this.detailsToggle()}},o={init:function(){var t=this;s(".dgwt-wcas-selectize").length>0&&s.ajax({url:ajaxurl,data:{action:"dgwt_wcas_settings_list_custom_fields",_wpnonce:s(".dgwt-wcas-selectize").data("security")},success:function(s){void 0!==s&&void 0!==s.data&&t.initSelectize(s.data)}})},initSelectize:function(t){var e=s(".dgwt-wcas-selectize");e.length>0&&e.each(function(){var e=s(this),a=e.data("options"),i=t;if(a.length>0){a=JSON.parse('["'+decodeURI(a.replace(/&/g,'","').replace(/=/g,'","'))+'"]');var o="";a.forEach(function(s,t){if((t+1)%2==0){var e={value:s,label:o};i.push(e),o=""}o=s})}s(this).selectize({persist:!1,maxItems:null,valueField:"key",labelField:"label",searchField:["value","label"],options:i,create:function(s){return{value:s.key,label:s.label}},load:function(t,a){if(!t.length)return a();s.ajax({url:ajaxurl,data:{action:"dgwt_wcas_settings_list_custom_fields",_wpnonce:e.data("security")},error:function(){a()},success:function(s){a(s.data)}})}})})}},n={init:function(){var t=s(".js-dgwt-wcas-tooltip");t.length>0&&t.each(function(){var t=s(this)[0],e=s(this).data("tooltip-html-el"),a=s(this).data("tooltip-placement");if(e){new DgwtWcasTooltip(t,{title:s("."+e+" > .dgwt-wcas-tooltip-wrapper")[0],placement:a,trigger:"hover",html:!0})}})}},r={advClass:"js-dgwt-wcas-adv-settings",highlightClass:"dgwt-wcas-opt-highlight",transClass:"dgwt-wcas-opt-transition",init:function(){this.clickListener(),this.setStartingState()},clickListener:function(){var t=this;s(document).on("click",".js-dgwt-wcas-settings__advanced",function(){var e;e=s(".js-dgwt-wcas-adv-settings-toggle").hasClass("woocommerce-input-toggle--disabled")?"show":"hide",t.saveChoice(e)})},setStartingState:function(){var t=s("."+this.advClass);t.length>0&&(s(".js-dgwt-wcas-adv-settings-toggle").hasClass("woocommerce-input-toggle--enabled")?(t.show(),e.refresh()):t.hide())},saveChoice:function(t){s(".js-dgwt-wcas-settings__advanced").append('<span class="dgwt-wcas-adv-settings-saving">saving...</span>'),s.ajax({url:ajaxurl,data:{action:"dgwt_wcas_adv_settings",adv_settings_value:t}}).done(function(t){s(".dgwt-wcas-adv-settings-saving").remove()});var e=s(".js-dgwt-wcas-adv-settings-toggle");"show"===t&&(e.removeClass("woocommerce-input-toggle--disabled"),e.addClass("woocommerce-input-toggle--enabled")),"hide"===t&&(e.removeClass("woocommerce-input-toggle--enabled"),e.addClass("woocommerce-input-toggle--disabled")),this.toggleAdvancedOpt(t)},toggleAdvancedOpt:function(t){var i=this,o=s("."+i.advClass);o.length>0&&(o.addClass(i.highlightClass),o.addClass(i.transClass),"show"===t&&o.fadeIn(500,function(){setTimeout(function(){o.removeClass(i.highlightClass),setTimeout(function(){o.removeClass(i.transClass),e.refresh(),a.setConditions()},500)},500)}),"hide"===t&&setTimeout(function(){o.removeClass(i.transClass),o.fadeOut(500,function(){o.removeClass(i.highlightClass)})},500))}};window.DGWT_WCAS_SEARCH_PREVIEW={previewWrapper:{},searchWrapp:{},suggestionWrapp:{},searchInput:{},init:function(){this.previewWrapper=s(".js-dgwt-wcas-preview"),this.searchWrapp=s(".js-dgwt-wcas-search-wrapp"),this.suggestionWrapp=s(".js-dgwt-wcas-suggestions-wrapp"),this.detailsWrapp=s(".js-dgwt-wcas-details-wrapp"),this.searchInput=s(".js-dgwt-wcas-search-input"),this.onChangeHandler(),this.onColorHandler(),this.onTypeHandler(),this.disableSubmit(),this.noResultsHandler(),this.fixSizesInit()},isChecked:function(s){return!!(s.length>0&&s.is(":checked"))},isColor:function(s){return"string"==typeof s&&7===s.length&&"#"===s.charAt(0)},camelCase:function(s){for(var t=s.split("_"),e="",a=0;a<t.length;a++)e+=t[a].charAt(0).toUpperCase()+t[a].slice(1);return e},disableSubmit:function(){var t,e;s(".js-dgwt-wcas-preview-source").on("click",function(a){a.preventDefault();var i=a.pageX-100,o=a.pageY+10;void 0!==t&&(clearTimeout(t),e&&e.remove()),s("body").append('<div class="dgwt-wcas-click-alert">No interaction! This is only a preview.</div>'),(e=s(".dgwt-wcas-click-alert")).css({left:i,top:o}),s(".dgwt-wcas-preview-source").addClass("dgwt-wcas-preview-source-no-click"),t=setTimeout(function(){e.fadeOut(500,function(){s(this).remove(),s(".dgwt-wcas-preview-source").removeClass("dgwt-wcas-preview-source-no-click")})},2e3)})},noResultsHandler:function(){var t=this,e=".js-dgwt-wcas-preview .dgwt-wcas-suggestion:not(.js-dgwt-wcas-suggestion-nores)",a="input[id*='search_no_results_text']";s(document).on("focus",a,function(){s(e).addClass("dgwt-wcas-hide"),s(".js-dgwt-wcas-suggestion-nores").removeClass("dgwt-wcas-hide"),t.detailsWrapp.addClass("dgwt-wcas-hide"),t.suggestionWrapp.addClass("dgwt-wcas-preview-nores")}),s(document).on("blur",a,function(){s(e).removeClass("dgwt-wcas-hide"),s(".js-dgwt-wcas-suggestion-nores").addClass("dgwt-wcas-hide"),t.detailsWrapp.removeClass("dgwt-wcas-hide"),t.suggestionWrapp.removeClass("dgwt-wcas-preview-nores")})},onChangeHandler:function(){for(var t=this,e=["show_submit_button","max_form_width","show_product_image","show_product_sku","show_product_desc","show_product_price","show_matching_categories","show_matching_tags","show_matching_brands","show_matching_posts","show_matching_pages","show_grouped_results","suggestions_limit","show_details_box"],a=0;a<e.length;a++){var i="input[id*='"+e[a]+"']",o=s(i),n="onChange"+t.camelCase(e[a]);"function"==typeof t[n]&&t[n](o,o.val()),s(document).on("change",i,function(){n=s(this).attr("id").replace("]","").replace("dgwt_wcas_settings[",""),n="onChange"+t.camelCase(n),t[n](s(this),this.value)})}},onColorHandler:function(){for(var t=this,e=["search_icon_color","bg_input_color","text_input_color","border_input_color","bg_submit_color","text_submit_color","sug_bg_color","sug_hover_color","sug_text_color","sug_highlight_color","sug_border_color"],a=0;a<e.length;a++){var i="input[id*='"+e[a]+"']",o=s(i),n="onColor"+t.camelCase(e[a]);t[n](o,o.val()),s(document).on("change",i,function(e){n=s(this).attr("id").replace("]","").replace("dgwt_wcas_settings[",""),n="onColor"+t.camelCase(n),t[n](s(this),this.value)})}},onColorChangeHandler:function(s,t){var e=s.attr("id").replace("]","").replace("dgwt_wcas_settings[","");this[e="onColor"+this.camelCase(e)](s,t)},onTypeHandler:function(){for(var t=this,e=["search_submit_text","search_placeholder","search_no_results_text","search_see_all_results_text"],a=0;a<e.length;a++){var i="input[id*='"+e[a]+"']",o=s(i),n="onType"+t.camelCase(e[a]);t[n](o,o.val()),s(document).on("input",i,function(e){n=s(e.target).attr("id").replace("]","").replace("dgwt_wcas_settings[",""),n="onType"+t.camelCase(n),t[n](s(e.target),this.value)})}},onChangeMaxFormWidth:function(t,e){e.length>0&&"0"!=e?(this.searchWrapp.css("max-width",e+"px"),this.suggestionWrapp.css("max-width",e+"px")):(this.searchWrapp.css("max-width","100%"),this.suggestionWrapp.css("max-width","100%")),this.onChangeShowDetailsBox(s("input[id*='show_details_box']"))},onChangeShowSubmitButton:function(t,e){var a=s(".js-dgwt-wcas-search-submit");if(this.isChecked(t)){this.searchWrapp.addClass("dgwt-wcas-has-submit"),this.searchWrapp.removeClass("dgwt-wcas-no-submit"),a.show(),s(".dgwt-wcas-sf-wrapp > .dgwt-wcas-ico-magnifier").hide();var i=s("input[id*='bg_submit_color']"),o=s("input[id*='text_submit_color']");this.onColorBgSubmitColor(i,i.val()),this.onColorTextSubmitColor(o,o.val())}else this.searchWrapp.addClass("dgwt-wcas-no-submit"),this.searchWrapp.removeClass("dgwt-wcas-has-submit"),a.hide(),s(".dgwt-wcas-sf-wrapp > .dgwt-wcas-ico-magnifier").show()},onChangeShowProductImage:function(t,e){var a=s(".js-dgwt-wcas-si"),i=s(".js-dgwt-wcas-content-wrapp");this.isChecked(t)?(this.suggestionWrapp.addClass("dgwt-wcas-has-img"),s(".dgwt-wcas-suggestion-product > .dgwt-wcas-st").remove(),s(".dgwt-wcas-suggestion-product > .dgwt-wcas-sp").remove(),i.show(),a.show()):(this.suggestionWrapp.removeClass("dgwt-wcas-has-img"),i.each(function(){s(this).closest(".dgwt-wcas-suggestion-product").append(s(this).html())}),i.hide(),a.hide())},onChangeShowProductSku:function(t,e){var a=s(".js-dgwt-wcas-sku");this.isChecked(t)?(this.suggestionWrapp.addClass("dgwt-wcas-has-sku"),a.show()):(this.suggestionWrapp.removeClass("dgwt-wcas-has-sku"),a.hide())},onChangeShowProductDesc:function(t,e){var a=s(".js-dgwt-wcas-sd");this.isChecked(t)?(this.suggestionWrapp.addClass("dgwt-wcas-has-desc"),a.show()):(this.suggestionWrapp.removeClass("dgwt-wcas-has-desc"),a.hide())},onChangeShowProductPrice:function(t,e){var a=s(".js-dgwt-wcas-sp");this.isChecked(t)?(this.suggestionWrapp.addClass("dgwt-wcas-has-price"),a.show()):(this.suggestionWrapp.removeClass("dgwt-wcas-has-price"),a.hide())},onChangeShowMatchingCategories:function(t,e){var a=s(".dgwt-wcas-suggestion-headline-cat"),i=s(".dgwt-wcas-suggestion-cat");this.isChecked(t)?(a.show(),i.show(),i.removeClass("js-dgwt-wcas-suggestion-hidden"),this.onChangeShowGroupedResults(s("input[id*='show_grouped_results']"))):(a.hide(),i.hide(),i.addClass("js-dgwt-wcas-suggestion-hidden"));var o=s("input[id*='suggestions_limit']");this.onChangeSuggestionsLimit(o,o.val())},onChangeShowMatchingTags:function(t,e){var a=s(".dgwt-wcas-suggestion-headline-tag"),i=s(".dgwt-wcas-suggestion-tag");this.isChecked(t)?(a.show(),i.show(),i.removeClass("js-dgwt-wcas-suggestion-hidden"),this.onChangeShowGroupedResults(s("input[id*='show_grouped_results']"))):(a.hide(),i.hide(),i.addClass("js-dgwt-wcas-suggestion-hidden"));var o=s("input[id*='suggestions_limit']");this.onChangeSuggestionsLimit(o,o.val())},onChangeShowMatchingBrands:function(t,e){var a=s(".dgwt-wcas-suggestion-headline-brand"),i=s(".dgwt-wcas-suggestion-brand");this.isChecked(t)?(a.show(),i.show(),i.removeClass("js-dgwt-wcas-suggestion-hidden"),this.onChangeShowGroupedResults(s("input[id*='show_grouped_results']"))):(a.hide(),i.hide(),i.addClass("js-dgwt-wcas-suggestion-hidden"));var o=s("input[id*='suggestions_limit']");this.onChangeSuggestionsLimit(o,o.val())},onChangeShowMatchingPosts:function(t,e){var a=s(".dgwt-wcas-suggestion-headline-post"),i=s(".dgwt-wcas-suggestion-post");this.isChecked(t)?(a.show(),i.show(),i.removeClass("js-dgwt-wcas-suggestion-hidden"),this.onChangeShowGroupedResults(s("input[id*='show_grouped_results']"))):(a.hide(),i.hide(),i.addClass("js-dgwt-wcas-suggestion-hidden"));var o=s("input[id*='suggestions_limit']");this.onChangeSuggestionsLimit(o,o.val())},onChangeShowMatchingPages:function(t,e){var a=s(".dgwt-wcas-suggestion-headline-page"),i=s(".dgwt-wcas-suggestion-page");this.isChecked(t)?(a.show(),i.show(),i.removeClass("js-dgwt-wcas-suggestion-hidden"),this.onChangeShowGroupedResults(s("input[id*='show_grouped_results']"))):(a.hide(),i.hide(),i.addClass("js-dgwt-wcas-suggestion-hidden"));var o=s("input[id*='suggestions_limit']");this.onChangeSuggestionsLimit(o,o.val())},onChangeShowGroupedResults:function(t,e){var a=s(".dgwt-wcas-st--direct-headline"),i=s(".dgwt-wcas-suggestion-headline");this.isChecked(t)?(a.addClass("dgwt-wcas-hidden"),this.suggestionWrapp.addClass("dgwt-wcas-has-headings"),s(".dgwt-wcas-suggestion-headline").show(),this.isChecked(s("input[id*='show_matching_categories']"))||s(".dgwt-wcas-suggestion-headline-cat").hide(),this.isChecked(s("input[id*='show_matching_tags']"))||s(".dgwt-wcas-suggestion-headline-tag").hide(),this.isChecked(s("input[id*='show_matching_brands']"))||s(".dgwt-wcas-suggestion-headline-brand").hide(),this.isChecked(s("input[id*='show_matching_posts']"))||s(".dgwt-wcas-suggestion-headline-post").hide(),this.isChecked(s("input[id*='show_matching_pages']"))||s(".dgwt-wcas-suggestion-headline-page").hide()):(a.removeClass("dgwt-wcas-hidden"),i.hide(),this.suggestionWrapp.removeClass("dgwt-wcas-has-headings"))},onChangeSuggestionsLimit:function(t,e){setTimeout(function(){var a=0,i=7,o=s(".dgwt-wcas-suggestion-duplicated"),n=["brand","cat","tag","post","page","product"];e.length>0&&"0"!=e&&(i=Math.abs(e)),o.length>0&&o.remove();var r=[];for(a=0;a<n.length;a++){var c=s(".dgwt-wcas-suggestion-"+n[a]+":not(.js-dgwt-wcas-suggestion-hidden)");c.length>0&&r.push(c)}var d=r.length;if(r.length>0)for(var l=i-r.length,g=r.length-1;l>0;){var h=r[g].clone();h.addClass("dgwt-wcas-suggestion-duplicated"),h.removeClass("dgwt-wcas-suggestion-selected"),r[g].after(h),d++,--g<0&&(g=r.length-1),l--}d>i&&t.val(d)},10)},onChangeShowDetailsBox:function(t,e){var a=this;a.isChecked(t)?(a.detailsWrapp.show(),a.searchWrapp.addClass("dgwt-wcas-is-detail-box"),a.previewWrapper.addClass("dgwt-wcas-is-details"),a.previewWrapper.addClass("dgwt-wcas-details-right"),setTimeout(function(){if(s(".dgwt-wcas-suggestion-product:not(.dgwt-wcas-suggestion-duplicated)").addClass("dgwt-wcas-suggestion-selected"),a.searchWrapp.width()>=550){a.previewWrapper.addClass("dgwt-wcas-full-width");var t=getComputedStyle(a.searchWrapp[0]).width;(t=Math.round(parseFloat(t.replace("px",""))))%2==0?(a.suggestionWrapp.css("width",Math.round(t/2)),a.detailsWrapp.css("width",Math.round(t/2))):(a.suggestionWrapp.css("width",Math.floor(t/2)),a.detailsWrapp.css("width",Math.ceil(t/2)))}else a.suggestionWrapp.width(a.searchWrapp.width())},10)):(a.detailsWrapp.hide(),a.searchWrapp.removeClass("dgwt-wcas-is-detail-box"),a.previewWrapper.removeClass("dgwt-wcas-is-details"),a.previewWrapper.removeClass("dgwt-wcas-details-right"),a.previewWrapper.removeClass("dgwt-wcas-full-width"),s(".dgwt-wcas-suggestion-product").removeClass("dgwt-wcas-suggestion-selected"),a.suggestionWrapp.css("width",""),a.detailsWrapp.css("width",""))},onColorSearchIconColor:function(s,t){},onColorBgInputColor:function(s,t){this.isColor(t)?this.searchInput.css("background-color",t):this.searchInput.css("background-color","")},onColorTextInputColor:function(t,e){var a="dgwt-wcas-preview-placeholder-style";if(this.isColor(e)){var i='<style class="'+a+'">';i+=".dgwt-wcas-search-input::placeholder{opacity: 0.3; color:"+e+"!important;}",i+=".dgwt-wcas-search-input::-webkit-input-placeholder{opacity: 0.3; color:"+e+"!important;}",i+=".dgwt-wcas-search-input:-moz-placeholder{opacity: 0.3; color:"+e+"!important;}",i+=".dgwt-wcas-search-input::-moz-placeholder{opacity: 0.3; color:"+e+"!important;}",i+=".dgwt-wcas-search-input:-ms-input-placeholder{opacity: 0.3; color:"+e+"!important;}",i+=".dgwt-wcas-ico-magnifier path {fill:"+e+"}",i+="</style>",s("head").append(i),this.searchInput.css("color",e)}else{this.searchInput.css("color","");var o=s("."+a);o.length>0&&o.remove()}},onColorBorderInputColor:function(s,t){this.isColor(t)?this.searchInput.css("border-color",t):this.searchInput.css("border-color","")},onColorBgSubmitColor:function(t,e){if(this.isChecked(s("input[id*='show_submit_button']"))&&this.isColor(e)){var a='<style class="dgwt-wcas-preview-submit-style">';a+=".dgwt-wcas-search-submit::before{border-color: transparent "+e+"!important;}",a+=".dgwt-wcas-search-submit:hover::before{border-right-color: "+e+"!important;}",a+=".dgwt-wcas-search-submit:focus::before{border-right-color: "+e+"!important;}",a+=".dgwt-wcas-search-submit{background-color: "+e+"!important;}",a+=".dgwt-wcas-om-bar .dgwt-wcas-om-return{background-color: "+e+"!important;}",a+="</style>",s("head").append(a)}else{var i=s(".dgwt-wcas-preview-submit-style");i.length>0&&i.remove()}},onColorTextSubmitColor:function(t,e){this.isChecked(s("input[id*='show_submit_button']"))&&this.isColor(e)?(s(".js-dgwt-wcas-search-submit").css("color",e),s(".dgwt-wcas-search-submit .dgwt-wcas-ico-magnifier path").css("fill",e)):(this.searchInput.css("background-color",""),s(".js-dgwt-wcas-search-submit").css("color",""),s(".dgwt-wcas-search-submit .dgwt-wcas-ico-magnifier path").css("fill",""))},onColorSugBgColor:function(t,e){var a="dgwt-wcas-preview-sugbgcol-style";if(this.isColor(e)){var i='<style class="'+a+'">';i+=".dgwt-wcas-suggestions-wrapp,",i+=".dgwt-wcas-details-wrapp",i+="{background-color: "+e+"!important;}",i+="</style>",s("head").append(i)}else{var o=s("."+a);o.length>0&&o.remove()}},onColorSugHoverColor:function(t,e){this.isColor(e)?setTimeout(function(){s(".dgwt-wcas-suggestion-selected").css("background-color",e)},50):s(".dgwt-wcas-suggestion-selected").css("background-color","")},onColorSugTextColor:function(t,e){var a="dgwt-wcas-preview-sugtextcol-style";if(this.isColor(e)){var i='<style class="'+a+'">';i+=".dgwt-wcas-suggestions-wrapp *,",i+=".dgwt-wcas-details-wrapp *,",i+=".dgwt-wcas-sd,",i+=".dgwt-wcas-suggestion *",i+="{color: "+e+"!important;}",i+="</style>",s("head").append(i)}else{var o=s("."+a);o.length>0&&o.remove()}},onColorSugHighlightColor:function(t,e){var a="dgwt-wcas-preview-sughighlight-style";if(this.isColor(e)){var i='<style class="'+a+'">';i+=".dgwt-wcas-st strong,",i+=".dgwt-wcas-sd strong",i+="{color: "+e+"!important;}",i+="</style>",s("head").append(i)}else{var o=s("."+a);o.length>0&&o.remove()}},onColorSugBorderColor:function(t,e){var a="dgwt-wcas-preview-sugborder-style";if(this.isColor(e)){var i='<style class="'+a+'">';i+=".dgwt-wcas-suggestions-wrapp,",i+=".dgwt-wcas-details-wrapp,",i+=".dgwt-wcas-suggestion,",i+=".dgwt-wcas-datails-title,",i+=".dgwt-wcas-details-more-products",i+="{border-color: "+e+"!important;}",i+="</style>",s("head").append(i)}else{var o=s("."+a);o.length>0&&o.remove()}},onTypeSearchSubmitText:function(t,e){var a=s(".js-dgwt-wcas-search-submit-l"),i=s(".js-dgwt-wcas-search-submit-m");e.length>0?(a.text(e),a.show(),i.hide()):(a.text(""),a.hide(),i.show())},onTypeSearchPlaceholder:function(s,t){0==t.length&&(t=dgwt_wcas.labels.search_placeholder),this.searchInput.attr("placeholder",t)},onTypeSearchNoResultsText:function(t,e){0==e.length&&(e=dgwt_wcas.labels.no_results),s(".js-dgwt-wcas-suggestion-nores span").text(e)},onTypeSearchSeeAllResultsText:function(t,e){0==e.length&&(e=dgwt_wcas.labels.show_more),s(".js-dgwt-wcas-st-more-label").text(e)},fixSizesInit:function(){var t=this;s(document).on("click","#dgwt_wcas_autocomplete-tab",function(){t.onChangeShowDetailsBox(s("input[id*='show_details_box']"))})}};var c={settingsTab:"#dgwt_wcas_troubleshooting-tab",noIssuesClass:".js-dgwt-wcas-troubleshooting-no-issues",counterClass:".js-dgwt-wcas-troubleshooting-count",issuesListClass:".js-dgwt-wcas-troubleshooting-issues",progressBar:".dgwt-wcas-troubleshooting-wrapper .progress_bar",progressBarInner:".dgwt-wcas-troubleshooting-wrapper .progress-bar-inner",resetButtonName:"dgwt-wcas-reset-async-tests",init:function(){var t=this;if(void 0===dgwt_wcas.troubleshooting)return;const e=dgwt_wcas.troubleshooting.tests.issues.critical+dgwt_wcas.troubleshooting.tests.issues.recommended;e>0&&(s(t.counterClass).text(e),s(t.settingsTab).addClass("enabled")),dgwt_wcas.troubleshooting.tests.results_async.length>0&&s.each(dgwt_wcas.troubleshooting.tests.results_async,function(){t.appendIssue(this,!1)}),dgwt_wcas.troubleshooting.tests.direct.length>0&&s.each(dgwt_wcas.troubleshooting.tests.direct,function(){t.appendIssue(this,!1)}),dgwt_wcas.troubleshooting.tests.async.length>0&&t.maybeRunNextAsyncTest(),s(document).on("click",'input[name="'+t.resetButtonName+'"]',function(e){s('input[name="'+t.resetButtonName+'"]').attr("disabled","disabled");var a={action:"dgwt_wcas_troubleshooting_reset_async_tests",_wpnonce:dgwt_wcas.troubleshooting.nonce.troubleshooting_reset_async_tests};return s.post(ajaxurl,a,function(){location.reload()}),!1})},appendIssue:function(t,e){var a,i=wp.template("dgwt-wcas-troubleshooting-issue"),o=s(this.issuesListClass+"-"+t.status);"good"!==t.status&&(s(this.noIssuesClass).hide(),e&&dgwt_wcas.troubleshooting.tests.issues[t.status]++,(a=dgwt_wcas.troubleshooting.tests.issues.critical+dgwt_wcas.troubleshooting.tests.issues.recommended)>0&&(s(this.counterClass).text(a),s(this.settingsTab).addClass("enabled")),s(o).append(i(t)))},maybeRunNextAsyncTest:function(){var t=this;dgwt_wcas.troubleshooting.tests.async.length>0&&s.each(dgwt_wcas.troubleshooting.tests.async,function(){var e={action:"dgwt_wcas_troubleshooting_test",test:this.test,_wpnonce:dgwt_wcas.troubleshooting.nonce.troubleshooting_async_test};return!!this.completed||(this.completed=!0,s(t.progressBar).show(),s.post(ajaxurl,e,function(s){s.success&&t.appendIssue(s.data,!0),t.maybeRunNextAsyncTest()}),!1)}),t.recalculateProgression()},recalculateProgression:function(){var t=this,e=dgwt_wcas.troubleshooting.tests.async.length,a=0;s.each(dgwt_wcas.troubleshooting.tests.async,function(){this.completed&&a++});var i=Math.ceil(a/e*100);s(t.progressBarInner).css("width",i+"%"),100===i&&setTimeout(function(){s(t.progressBar).slideUp()},2e3)}},d=function(){if("undefined"!=typeof Vue){Vue.component("dgwt-wcas-rule",{template:"#dgwt-wcas-settings-filters-rules-rule",components:{Selectize:Selectize},props:["nonce","rule","rules","index"],data:()=>({isSelectActive:!0}),computed:{ruleValue(s){return this.rule.group}},watch:{rule:{handler:function(){this.$emit("update:rule",this.index)},deep:!0},ruleValue(){var s=this;this.$emit("change:group",this.index),this.isSelectActive=!1,setTimeout(function(){s.isSelectActive=!0},0)}},methods:{deleteRule(){this.$emit("delete:rule",this.index)},getSelectizeSettings(t){var e=void 0===dgwt_wcas_filters_rules_selected_options[t]?[]:dgwt_wcas_filters_rules_selected_options[t];return function({nonce:t,options:e,type:a}){return{persist:!1,maxItems:null,valueField:"key",labelField:"label",searchField:["label"],options:e,preload:!0,create:function(s){return{value:s.key,label:s.label}},load:function(e,i){s.ajax({url:ajaxurl,method:"POST",data:{action:"dgwt_wcas_settings_search_terms",query:e,type:a,_wpnonce:t},error:function(){i()},success:function(s){i(s.data)}})}}}({nonce:this.nonce,type:t,options:e})}}});new Vue({el:"#dgwt-wcas-settings-filters-rules",components:{Selectize:Selectize},data:()=>({rules:[]}),mounted(){try{const t=JSON.parse(this.$refs["dgwt-wcas-settings-filters-rules-ref"].value);s.each(t,function(s,e){t[s].key=Math.random()}),this.rules=t}catch(s){}this.updateInput()},methods:{addRule(){this.rules.push({group:"",values:[],key:Math.random()}),this.updateInput()},changeGroup(s){this.rules[s].values=[],this.updateInput()},deleteRule(s){this.rules=this.rules.filter(function(t,e){return e!==s}),this.updateInput()},updateInput(){const s=JSON.parse(JSON.stringify(this.rules));this.$refs["dgwt-wcas-settings-filters-rules-ref"].value=JSON.stringify(s.map(function(s){return s.key,delete s.key,s}))}}})}};s(document).ready(function(){var l,g;(l=s(".js-dgwt-wcas-settings-margin-nob")).length>0&&l.each(function(){var t=s(this).find("td .dgwt-wcas-fieldset");if(t.length>0){var e=s(this).prev(".js-dgwt-wcas-settings-margin");if(e.length>0){var a=s(this).attr("class").split(/\s+/),i="";s.each(a,function(s,t){-1!==t.indexOf("js-dgwt-wcas-cbtgroup-")&&(i=t)});var o=t.clone(!0,!0);o.addClass("dgwt-wcas-settings-margin-nob"),i&&o.addClass(i),o.appendTo(e.find("td")),s(this).remove()}}}),t.init(),e.init(),a.init(),(g=s(".js-dgwt-wcas-sgs-autocolspan")).length>0&&g.find("td").attr("colspan",2),i.init(),o.init(),n.init(),r.init(),c.init(),d(),window.DGWT_WCAS_SEARCH_PREVIEW.init()})}(jQuery);
|
assets/js/search.js
CHANGED
@@ -258,6 +258,7 @@
|
|
258 |
debounceWaitMs: 400,
|
259 |
sendGAEvents: true,
|
260 |
enableGASiteSearchModule: false,
|
|
|
261 |
}
|
262 |
|
263 |
function _lookupFilter(suggestion, originalQuery, queryLowerCase) {
|
@@ -609,9 +610,13 @@
|
|
609 |
that.applyFlexibleMode();
|
610 |
});
|
611 |
|
612 |
-
|
613 |
that.applyFlexibleMode();
|
614 |
-
}
|
|
|
|
|
|
|
|
|
615 |
|
616 |
},
|
617 |
registerEventsFixedMenu: function () {
|
@@ -1801,7 +1806,8 @@
|
|
1801 |
prepend = '',
|
1802 |
append = '',
|
1803 |
title = '',
|
1804 |
-
highlight = true
|
|
|
1805 |
|
1806 |
if (suggestion.taxonomy === 'product_cat') {
|
1807 |
classes += ' dgwt-wcas-suggestion-tax dgwt-wcas-suggestion-cat';
|
@@ -1824,7 +1830,12 @@
|
|
1824 |
if (!options.showHeadings) {
|
1825 |
prepend += '<span class="dgwt-wcas-st--direct-headline">' + dgwt_wcas.labels.brand + '</span>';
|
1826 |
}
|
1827 |
-
} else if (options.isPremium && suggestion.type === '
|
|
|
|
|
|
|
|
|
|
|
1828 |
classes += ' dgwt-wcas-suggestion-pt dgwt-wcas-suggestion-tp-post';
|
1829 |
if (!options.showHeadings) {
|
1830 |
prepend += '<span class="dgwt-wcas-st--direct-headline">' + dgwt_wcas.labels.post + '</span>';
|
@@ -1855,10 +1866,42 @@
|
|
1855 |
$('body').addClass('dgwt-wcas-nores');
|
1856 |
}
|
1857 |
|
|
|
|
|
|
|
|
|
|
|
1858 |
title = title.length > 0 ? ' title="' + title + '"' : '';
|
1859 |
|
1860 |
html += '<div class="' + classes + '" data-index="' + i + '">';
|
1861 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1862 |
html += '</div>';
|
1863 |
} else {
|
1864 |
|
@@ -1897,6 +1940,18 @@
|
|
1897 |
html += '<span class="dgwt-wcas-sd">' + formatResult(suggestion.desc, value, true, options) + '</span>';
|
1898 |
}
|
1899 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1900 |
html += '</span>';
|
1901 |
|
1902 |
// Price
|
@@ -2361,7 +2416,7 @@
|
|
2361 |
$('html').addClass('dgwt-wcas-overlay-mobile-on');
|
2362 |
html += '<div class="js-dgwt-wcas-overlay-mobile dgwt-wcas-overlay-mobile">';
|
2363 |
html += '<div class="dgwt-wcas-om-bar js-dgwt-wcas-om-bar">';
|
2364 |
-
html += '<
|
2365 |
if (typeof dgwt_wcas.back_icon == 'string') {
|
2366 |
html += dgwt_wcas.back_icon;
|
2367 |
} else {
|
@@ -2370,7 +2425,7 @@
|
|
2370 |
html += '<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>';
|
2371 |
html += '</svg>';
|
2372 |
}
|
2373 |
-
html += '</
|
2374 |
html += '</div>';
|
2375 |
html += '</div>';
|
2376 |
|
@@ -2599,6 +2654,8 @@
|
|
2599 |
sendGAEvents: dgwt_wcas.send_ga_events,
|
2600 |
convertHtml: dgwt_wcas.convert_html,
|
2601 |
enableGASiteSearchModule: dgwt_wcas.enable_ga_site_search_module,
|
|
|
|
|
2602 |
};
|
2603 |
|
2604 |
$('.dgwt-wcas-search-input').dgwtWcasAutocomplete(window.dgwt_wcas.config);
|
258 |
debounceWaitMs: 400,
|
259 |
sendGAEvents: true,
|
260 |
enableGASiteSearchModule: false,
|
261 |
+
showProductVendor: false
|
262 |
}
|
263 |
|
264 |
function _lookupFilter(suggestion, originalQuery, queryLowerCase) {
|
610 |
that.applyFlexibleMode();
|
611 |
});
|
612 |
|
613 |
+
if (document.readyState == 'complete') {
|
614 |
that.applyFlexibleMode();
|
615 |
+
} else {
|
616 |
+
$(window).on('load', function () {
|
617 |
+
that.applyFlexibleMode();
|
618 |
+
});
|
619 |
+
}
|
620 |
|
621 |
},
|
622 |
registerEventsFixedMenu: function () {
|
1806 |
prepend = '',
|
1807 |
append = '',
|
1808 |
title = '',
|
1809 |
+
highlight = true,
|
1810 |
+
isImg;
|
1811 |
|
1812 |
if (suggestion.taxonomy === 'product_cat') {
|
1813 |
classes += ' dgwt-wcas-suggestion-tax dgwt-wcas-suggestion-cat';
|
1830 |
if (!options.showHeadings) {
|
1831 |
prepend += '<span class="dgwt-wcas-st--direct-headline">' + dgwt_wcas.labels.brand + '</span>';
|
1832 |
}
|
1833 |
+
} else if (options.isPremium && suggestion.type === 'vendor') {
|
1834 |
+
classes += ' dgwt-wcas-suggestion-vendor dgwt-wcas-suggestion-vendor';
|
1835 |
+
if (!options.showHeadings) {
|
1836 |
+
prepend += '<span class="dgwt-wcas-st--direct-headline">' + dgwt_wcas.labels.vendor + '</span>';
|
1837 |
+
}
|
1838 |
+
} else if (options.isPremium && suggestion.type === 'post') {
|
1839 |
classes += ' dgwt-wcas-suggestion-pt dgwt-wcas-suggestion-tp-post';
|
1840 |
if (!options.showHeadings) {
|
1841 |
prepend += '<span class="dgwt-wcas-st--direct-headline">' + dgwt_wcas.labels.post + '</span>';
|
1866 |
$('body').addClass('dgwt-wcas-nores');
|
1867 |
}
|
1868 |
|
1869 |
+
// Image
|
1870 |
+
if (typeof suggestion.image_src != 'undefined' && suggestion.image_src) {
|
1871 |
+
isImg = true;
|
1872 |
+
}
|
1873 |
+
|
1874 |
title = title.length > 0 ? ' title="' + title + '"' : '';
|
1875 |
|
1876 |
html += '<div class="' + classes + '" data-index="' + i + '">';
|
1877 |
+
|
1878 |
+
if(isImg) {
|
1879 |
+
html += '<span class="dgwt-wcas-si"><img src="' + suggestion.image_src + '" /></span>';
|
1880 |
+
html += '<div class="dgwt-wcas-content-wrapp">';
|
1881 |
+
}
|
1882 |
+
|
1883 |
+
html += '<span' + title + ' class="' + innerClass + '">';
|
1884 |
+
|
1885 |
+
if (suggestion.type === 'vendor') {
|
1886 |
+
html += '<span class="dgwt-wcas-st-title">' + prepend + formatResult(suggestion.value, value, highlight, options) + append + '</span>';
|
1887 |
+
|
1888 |
+
// Vendor city
|
1889 |
+
if (suggestion.shop_city) {
|
1890 |
+
html += '<span class="dgwt-wcas-vendor-city"><span> - </span>' + formatResult(suggestion.shop_city, value, true, options) + '</span>';
|
1891 |
+
}
|
1892 |
+
|
1893 |
+
// Description
|
1894 |
+
if (typeof suggestion.desc != 'undefined' && suggestion.desc) {
|
1895 |
+
html += '<span class="dgwt-wcas-sd">' + formatResult(suggestion.desc, value, true, options) + '</span>';
|
1896 |
+
}
|
1897 |
+
|
1898 |
+
}else{
|
1899 |
+
html += prepend + formatResult(suggestion.value, value, highlight, options) + append;
|
1900 |
+
}
|
1901 |
+
|
1902 |
+
html += '</span>';
|
1903 |
+
|
1904 |
+
html += isImg ? '</div>' : '';
|
1905 |
html += '</div>';
|
1906 |
} else {
|
1907 |
|
1940 |
html += '<span class="dgwt-wcas-sd">' + formatResult(suggestion.desc, value, true, options) + '</span>';
|
1941 |
}
|
1942 |
|
1943 |
+
// Vendor
|
1944 |
+
if (options.showProductVendor === true && typeof suggestion.vendor != 'undefined' && suggestion.vendor) {
|
1945 |
+
var vendorBody = '<span class="dgwt-wcas-product-vendor"><span class="dgwt-wcas-product-vendor-label">' + dgwt_wcas.labels.vendor_sold_by + ' </span>' + suggestion.vendor + '</span>'
|
1946 |
+
|
1947 |
+
if (typeof suggestion.vendor_url != 'undefined' && suggestion.vendor_url) {
|
1948 |
+
html += '<a href="' + suggestion.vendor_url + '">' + vendorBody + '</a>';
|
1949 |
+
} else {
|
1950 |
+
html += vendorBody;
|
1951 |
+
}
|
1952 |
+
|
1953 |
+
}
|
1954 |
+
|
1955 |
html += '</span>';
|
1956 |
|
1957 |
// Price
|
2416 |
$('html').addClass('dgwt-wcas-overlay-mobile-on');
|
2417 |
html += '<div class="js-dgwt-wcas-overlay-mobile dgwt-wcas-overlay-mobile">';
|
2418 |
html += '<div class="dgwt-wcas-om-bar js-dgwt-wcas-om-bar">';
|
2419 |
+
html += '<button class="dgwt-wcas-om-return js-dgwt-wcas-om-return">'
|
2420 |
if (typeof dgwt_wcas.back_icon == 'string') {
|
2421 |
html += dgwt_wcas.back_icon;
|
2422 |
} else {
|
2425 |
html += '<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>';
|
2426 |
html += '</svg>';
|
2427 |
}
|
2428 |
+
html += '</button>';
|
2429 |
html += '</div>';
|
2430 |
html += '</div>';
|
2431 |
|
2654 |
sendGAEvents: dgwt_wcas.send_ga_events,
|
2655 |
convertHtml: dgwt_wcas.convert_html,
|
2656 |
enableGASiteSearchModule: dgwt_wcas.enable_ga_site_search_module,
|
2657 |
+
appendTo: typeof dgwt_wcas.suggestions_wrapper != 'undefined' ? dgwt_wcas.suggestions_wrapper : 'body',
|
2658 |
+
showProductVendor: typeof dgwt_wcas.show_product_vendor != 'undefined' && dgwt_wcas.show_product_vendor ? true : false
|
2659 |
};
|
2660 |
|
2661 |
$('.dgwt-wcas-search-input').dgwtWcasAutocomplete(window.dgwt_wcas.config);
|
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,o=s.split(/ /),a=!1;if(o)for(o=o.sort(function(t,e){return e.length-t.length}),i=0;i<o.length;i++)if(o[i]&&o[i].length>1){var n=o[i].replace(/[\^\@]/g,"");if(n.length>0){var r="("+e.escapeRegExChars(n.trim())+")";t=t.replace(new RegExp(r,"gi"),"^^$1@@"),a=!0}}a&&(t=(t=t.replace(/\^\^/g,"<strong>")).replace(/@@/g,"</strong>"))}else r="("+e.escapeRegExChars(s)+")",t=t.replace(new RegExp(r,"gi"),"<strong>$1</strong>");return t},debounce:function(t,e){var i,o=(new Date).getUTCMilliseconds();if(0===s.id.length)return s.id=o,void t();s.id=o,i=setTimeout(function(){o===s.id?(t(),s.id=""):clearTimeout(i)},e)},mouseHoverDebounce:function(e,s,i){var o;o=setTimeout(function(){t(s+":hover").length>0?e():clearTimeout(o)},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,o=9,a=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.cachedPrices={},this.detailsRequestsSent=[],this.onChangeTimeout=null,this.onChange=null,this.isLocal=!1,this.suggestionsContainer=null,this.detailsContainer=null,this.autoAligmentprocess=null,this.noSuggestionsContainer=null,this.latestActivateSource="",this.actionTriggerSource="",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,dynamicPrices:!1,saleBadgeText:"sale",featuredBadgeText:"featured",minChars:3,maxHeight:600,deferRequestBy:0,params:{},formatResult:function(t,s,i,o){if(!s)return t;i&&(t=e.highlight(t,s));if(!o.convertHtml)return t;return t.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/<sup/g,"<sup").replace(/<\/sup/g,"</sup").replace(/sup>/g,"sup>").replace(/<(\/?(strong|b|br))>/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",formClass:"dgwt-wcas-search-form",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,enableGASiteSearchModule:!1},d.prototype={initialize:function(){var s=this;s.element.setAttribute("autocomplete","off"),s.createContainers(),s.registerEventsSearchBar(),s.registerEventsSuggestions(),s.registerEventsDetailsPanel(),s.registerIconHandler(),s.registerEventsFixedMenu(),s.fixPositionCapture=function(){s.adjustContainerWidth(),s.visible&&s.fixPosition()},t(window).on("resize.autocomplete",function(){var t=e.getActiveInstance();void 0!==t&&t.fixPositionCapture()}),s.initMobileMode(),s.hideAfterClickOutsideListener(),s.suggestionsContainer.addClass("js-dgwt-wcas-initialized"),s.detailsContainer&&s.detailsContainer.length>0&&s.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),s.hideCloseButton(),t(this).closest("."+s.options.searchFormClass).find("."+s.options.searchInputClass).val("").focus()}),s.el.closest("."+s.options.formClass).on("submit.autocomplete",function(e){s.suggestions.length>0&&t.each(s.suggestions,function(t,i){if(void 0!==i.type&&"product_variation"==i.type)return s.select(t),e.preventDefault(),!1})}),t(window).on("load",function(){s.positionPreloader()}),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;if(!this.getSuggestionsContainer().hasClass("js-dgwt-wcas-initialized")){t(document).on("mouseenter.autocomplete",s,function(){var s=e.getActiveInstance();if(void 0!==s){var i=t(this).data("index"),o='.dgwt-wcas-suggestion[data-index="'+i+'"]',a=s.canShowDetailsBox()?100:1;s.selectedIndex!=i&&e.mouseHoverDebounce(function(){s.selectedIndex!==i&&(s.latestActivateSource="mouse",s.getDetails(s.suggestions[i]),s.activate(i))},o,a)}});var i=!1;t(document).on("click.autocomplete",s,function(){if(!i){var s=e.getActiveInstance();s.actionTriggerSource="click",i=!0,s.select(t(this).data("index"))}}),t(document).on("mousedown.autocomplete",s,function(e){"number"==typeof e.which&&1===e.which&&t(e.target)[0].click()}),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())}))},registerIconHandler:function(){var s=this,i=s.getFormWrapper(),o=i.find("."+s.options.formClass);i.on("click",".js-dgwt-wcas-search-icon-handler",function(t){var e=i.find("."+s.options.searchInputClass);if(i.hasClass("dgwt-wcas-layout-icon-open"))s.hide(),o.hide(!0),i.removeClass("dgwt-wcas-layout-icon-open");else{var a=i.find(".dgwt-wcas-search-icon-arrow");o.hide(),a.hide(),i.addClass("dgwt-wcas-layout-icon-open"),s.positionIconSearchMode(i),o.fadeIn(200,function(){a.show(),s.positionPreloader(i),e.focus()})}}),0==t(".js-dgwt-wcas-initialized").length&&t(".js-dgwt-wcas-search-icon-handler").length>0&&t(document).click(function(i){if(t(".dgwt-wcas-layout-icon-open").length){var o=t(i.target);if(!(o.closest("."+s.options.searchFormClass).length>0||o.closest("."+s.options.containerClass).length>0||o.closest("."+s.options.containerDetailsClass).length>0)){var a=e.getActiveInstance();if(void 0!==a){var n=a.getFormWrapper().find("."+s.options.formClass);n.hide(),a.hide(!0),n.css({left:"0"})}s.hideIconModeSearch()}}}),t(window).on("resize.autocomplete",function(){s.applyFlexibleMode()}),t(window).on("load",function(){s.applyFlexibleMode()})},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,e=t.getFormWrapper();e.hasClass("js-dgwt-wcas-mobile-overlay-enabled")&&t.isMobileMode()&&(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()}))},applyFlexibleMode:function(){var e=t(".js-dgwt-wcas-layout-icon-flexible");e.length&&(this.isMobileMode()?(e.addClass("js-dgwt-wcas-layout-icon"),e.addClass("dgwt-wcas-layout-icon")):(e.removeClass("js-dgwt-wcas-layout-icon"),e.removeClass("dgwt-wcas-layout-icon")),e.addClass("dgwt-wcas-layout-icon-flexible-loaded"))},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(),o=e.getQuery(i);e.isMobileMode()||(e.blurTimeoutId=setTimeout(function(){e.hide(),e.selection&&e.currentValue!==o&&(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(),o=t.extend({},s.options,e);(s.isLocal=Array.isArray(o.lookup),s.isLocal&&(o.lookup=s.verifySuggestionsFormat(o.lookup)),o.orientation=s.validateOrientation(o.orientation,"bottom"),i.css({"max-height":s.canShowDetailsBox()?"none":o.maxHeight+"px",width:o.width+"px","z-index":o.zIndex}),!0===o.showDetailsPanel)&&s.getDetailsContainer().css({"z-index":o.zIndex-1});o.onSearchComplete=function(){s.getFormWrapper().removeClass("dgwt-wcas-processing"),s.preloader("hide","form","dgwt-wcas-inner-preloader"),s.showCloseButton()},this.options=o},clearCache:function(){this.cachedResponse={},this.cachedDetails={},this.cachedPrices={},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(),o=this.getFormOffset(),a=o.left;if(0==i.length)return!1;var n=!0===this.options.isRtl?1:2,r=Math.round(o.left);if(o.left=r+Math.round(s.width()+n),i.css(o),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",a+"px")));var l=t(window).width(),c=i.width(),d=i.offset();t("body").addClass("dgwt-wcas-details-outside"),!0===this.options.isRtl&&(o.left=o.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 o=[e.width(),s.height()];t.options.showDetailsPanel&&(o[2]=i.height()),t.autoAligmentprocess=setInterval(function(){var a=[e.width(),s.height()];t.options.showDetailsPanel&&(a[2]=i.height());for(var n=0;n<o.length;n++)if(o[n]!=a[n]){t.fixHeight(),t.fixPositionCapture(),o=a;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,o=e.outerHeight(),a=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-o,g=c+l-(n.top+a+o);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+=a;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 o: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 a:if(-1===this.selectedIndex)return void this.hide();this.actionTriggerSource="enter",this.select(this.selectedIndex);break;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?(this.hideCloseButton(),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,o=e.toLowerCase(),a=i.lookupFilter,n=parseInt(i.lookupLimit,10);return s={suggestions:t.grep(i.lookup,function(t){return a(t,e,o)})},n&&s.suggestions.length>n&&(s.suggestions=s.suggestions.slice(0,n)),s},getSuggestions:function(i){var o,a,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),c.params=l.applyCustomParams(c.params),l.preloader("show","form","dgwt-wcas-inner-preloader"),g.addClass("dgwt-wcas-processing"),!1!==c.onSearchStart.call(l.element,c.params)&&(a=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?o=l.getSuggestionsLocal(i):(t.isFunction(d)&&(d=d.call(l.element,i)),n=d+"?"+t.param(a||{}),o=l.cachedResponse[n]),o&&Array.isArray(o.suggestions)?(l.suggestions=o.suggestions,l.suggest(),l.selectFirstSuggestion(o.suggestions),c.onSearchComplete.call(l.element,i,o.suggestions)):l.isBadQuery(i)?c.onSearchComplete.call(l.element,i,[]):(l.abortAjax(),r={url:d,data:a,type:c.type,dataType:c.dataType},t.extend(r,c.ajaxSettings),s.object=l,s.ajaxSettings=r,e.debounce(function(){var e=s.object,o=s.ajaxSettings;e.currentRequest=t.ajax(o).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),e.updatePrices()}).fail(function(t,s,o){e.options.onSearchError.call(e.element,i,t,s,o)})},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,o=s.getDetailsContainer(),a=s.prepareSuggestionObjectID(e);if(null!=(i=s.cachedDetails[a]))o.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)}}),o.html(""),s.preloader("show","details","",!0),-1!=t.inArray(a,s.detailsRequestsSent))return;s.detailsRequestsSent.push(a),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 a=e.items[i].objectID;if(s.cachedDetails[a]={html:e.items[i].html},void 0!==e.items[i].price&&e.items[i].price.length>0&&(s.cachedPrices[a]=e.items[i].price),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]?o.html(s.cachedDetails[n].html):o.html(""),s.fixPositionCapture(),s.fixHeight(),s.updatePrices(!0)},error:function(t,e){s.preloader("hide","details","",!0),o.html(t),s.fixPositionCapture(),s.fixHeight()}})}t(document).trigger("dgwtWcasDetailsPanelLoaded",s)}},updatePrices:function(e){var s,i,o=this,a=[];if(o.options.showPrice&&o.options.dynamicPrices&&0!=o.suggestions.length){for(s=0;s<o.suggestions.length;s++)if(void 0!==o.suggestions[s].type&&("product"==o.suggestions[s].type||"product_variation"==o.suggestions[s].type)){var n="product__"+o.suggestions[s].post_id;void 0!==o.cachedPrices[n]?o.updatePrice(s,o.cachedPrices[n]):(o.applyPreloaderForPrice(s),a.push(o.suggestions[s].post_id))}if(!e&&a.length>0){var r={action:void 0===dgwt_wcas.action_get_prices?"dgwt_wcas_get_prices":dgwt_wcas.action_get_prices,items:a};t.ajax({data:r,type:"post",url:dgwt_wcas.ajax_prices_endpoint,success:function(t){if(void 0!==t.success&&t.success&&t.data.length>0)for(s=0;s<t.data.length;s++){var e=t.data[s].id,a=t.data[s].price;if(o.suggestions.length>0)for(i=0;i<o.suggestions.length;i++)if(void 0!==o.suggestions[i].type&&("product"==o.suggestions[i].type||"product_variation"==o.suggestions[i].type)&&o.suggestions[i].post_id==e){var n="product__"+e;o.cachedPrices[n]=a,o.updatePrice(i,a)}}},error:function(t,e){}})}}},updatePrice:function(e,s){if(void 0!==this.suggestions[e]){this.suggestions[e].price=s;var i=t(".dgwt-wcas-suggestions-wrapp").find('[data-index="'+e+'"] .dgwt-wcas-sp');i.length&&i.html(s)}},applyCustomParams:function(t){if("object"==typeof dgwt_wcas.custom_params){var e=dgwt_wcas.custom_params;for(var s in e)t[s]=e[s]}var i=this.el.data("custom-params");if("object"==typeof i)for(var s in i)t[s]=i[s];return t},applyPreloaderForPrice:function(e){if(void 0!==this.suggestions[e]){var s=t(".dgwt-wcas-suggestions-wrapp").find('[data-index="'+e+'"] .dgwt-wcas-sp');s.length&&s.html('<div class="dgwt-wcas-preloader-price"><div class="dgwt-wcas-preloader-price-inner"> <div></div><div></div><div></div></div></div>')}},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.latestActivateSource="system",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(e){this.getFormWrapper();var s=this.getSuggestionsContainer(),i=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),s.hide(),s.removeClass(this.classes.suggestionsContainerOrientTop),i.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),"boolean"==typeof e&&e&&(this.hideCloseButton(),this.currentValue="",this.suggestions=[]),this.signalHint(null)},positionIconSearchMode:function(e){var s,i=e.find("."+this.options.formClass),o=i.width(),a=t(window).width(),n=e[0].getBoundingClientRect().left;i[0].getBoundingClientRect().left;var r=(n+10)/a;s=Math.floor(o*r*-1),i.css({left:s+"px"})},hideIconModeSearch:function(){var e=t(".dgwt-wcas-layout-icon-open");e.length>0&&e.removeClass("dgwt-wcas-layout-icon-open")},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)),o=!(t(s.target).closest("."+e.options.containerClass).length>0||t(s.target).hasClass(e.options.containerClass));if(e.canShowDetailsBox()){var a=!(t(s.target).closest("."+e.options.containerDetailsClass).length>0||t(s.target).hasClass(e.options.containerDetailsClass));i&&o&&a&&e.hide()}else i&&o&&e.hide()}})},suggest:function(){if(this.suggestions.length){var e,s=this,i=s.options,o=i.groupBy,a=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(o&&(h+=function(t,s){var i=t.data[o];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,p="dgwt-wcas-st",w="",f="",m="",v=!0;"product_cat"===l.taxonomy?(u+=" dgwt-wcas-suggestion-tax dgwt-wcas-suggestion-cat",i.showHeadings||(w+='<span class="dgwt-wcas-st--direct-headline">'+dgwt_wcas.labels.category+"</span>"),void 0!==l.breadcrumbs&&l.breadcrumbs&&(m=l.breadcrumbs+" > "+l.value,f+='<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||(w+='<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||(w+='<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||(w+='<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||(w+='<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",p="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")),m=m.length>0?' title="'+m+'"':"",h+='<div class="'+u+'" data-index="'+s+'">',h+="<span"+m+' class="'+p+'">'+w+a(l.value,n,v,i)+f+"</span>",h+="</div>"}else{!0===i.showImage&&void 0!==l.thumb_html&&(g=!0);var C="product_variation"===l.type?" dgwt-wcas-suggestion-product-var":"";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"+C+'" 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">'+a(l.value,n,!0,i)+"</span>",!0===i.showSKU&&void 0!==l.sku&&l.sku.length>0&&(h+='<span class="dgwt-wcas-sku">('+dgwt_wcas.labels.sku_label+" "+a(l.sku,n,!0,i)+")</span>"),!0===i.showDescription&&void 0!==l.desc&&l.desc&&(h+='<span class="dgwt-wcas-sd">'+a(l.desc,n,!0,i)+"</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"),o=this.getFormWrapper(),a=this.getSuggestionsContainer(),n=this.getDetailsContainer(),r=this.getFormOffset();if(o.length){var l=getComputedStyle(o[0]).width;if(l=Math.round(parseFloat(l.replace("px",""))),"auto"===s.width&&(e=this.el.outerWidth(),a.css("width",e+"px")),this.canShowDetailsBox()){if(o.width()>=550)return i.addClass("dgwt-wcas-full-width"),l%2==0?(a.css("width",Math.round(l/2)),n.css("width",Math.round(l/2))):(a.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"):a.css("left",l/2+r.left+"px"));i.addClass("dgwt-wcas-details-right")}}},positionPreloader:function(e){var s="object"==typeof e?e.find(".dgwt-wcas-search-submit"):t(".dgwt-wcas-search-submit");s.length>0&&s.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")})},findBestHint:function(){var e=this.el.val().toLowerCase(),s=null;e&&(t.each(this.suggestions,function(t,i){var o=0===i.value.toLowerCase().indexOf(e);return o&&(s=i),!o}),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,o){var a,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===o)if("hide"!==e){if("show"===e){var c=this.options.isRtl?"-rtl":"";a='<div class="'+l+'"><img class="dgwt-wcas-placeholder-preloader" src="'+dgwt_wcas.img_url+"placeholder"+c+'.png" /></div>',n.html(a)}}else t(r).remove();else"hide"===e?(n.removeClass(i),n.html("")):(n.addClass(i),"string"==typeof dgwt_wcas.preloader_icon&&n.html(dgwt_wcas.preloader_icon))},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,o=this.getSuggestionsContainer(),a=o.find("."+this.classes.suggestion);return o.find("."+i).removeClass(i),this.selectedIndex=e,-1!==this.selectedIndex&&a.length>this.selectedIndex?(s=a.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){if(this.latestActivateSource="key",0===this.selectedIndex)return 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();this.adjustScroll(this.selectedIndex-1,"up")}},moveDown:function(){this.selectedIndex!==this.suggestions.length-1&&(this.latestActivateSource="key",this.adjustScroll(this.selectedIndex+1,"down"))},adjustScroll:function(e,s){if("headline"===this.suggestions[e].type&&(e="down"===s?e+1:e-1),void 0!==this.suggestions[e]){var i=this.activate(e);if(this.getDetails(this.suggestions[e]),"more_products"!==this.suggestions[e].type&&i&&!this.canShowDetailsBox()){var o,a,n,r=this.getSuggestionsContainer(),l=t(i).outerHeight();o=i.offsetTop,n=(a=r.scrollTop())+this.options.maxHeight-l,o<a?r.scrollTop(o):o>n&&r.scrollTop(o-this.options.maxHeight+l),this.options.preserveInput||(this.ignoreValueChange=!0),this.signalHint(null)}}},onSelect:function(e){var s=this.options.onSelect,i=this.suggestions[e];void 0===i.type||"more_products"!==i.type&&("enter"!==this.actionTriggerSource||"key"==this.latestActivateSource||"product_variation"==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(),o=e.getSuggestionsContainer(),a="";t("html").addClass("dgwt-wcas-overlay-mobile-on"),a+='<div class="js-dgwt-wcas-overlay-mobile dgwt-wcas-overlay-mobile">',a+='<div class="dgwt-wcas-om-bar js-dgwt-wcas-om-bar">',a+='<span class="dgwt-wcas-om-return js-dgwt-wcas-om-return">',"string"==typeof dgwt_wcas.back_icon?a+=dgwt_wcas.back_icon:(a+='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" color="#FFF">',a+='<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>',a+="</svg>"),a+="</span>",a+="</div>",a+="</div>",t(e.options.mobileOverlayWrapper).append(a),(s=t(".js-dgwt-wcas-overlay-mobile")).css("zIndex",99999999999),i.after('<span class="js-dgwt-wcas-om-hook"></span>'),i.appendTo(".js-dgwt-wcas-om-bar"),o.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(),o=t(".js-dgwt-wcas-om-bar").find("."+s.options.searchFormClass);o.hasClass("dgwt-wcas-has-submit-off")&&(o.removeClass("dgwt-wcas-has-submit-off"),o.addClass("dgwt-wcas-has-submit")),o.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(o),t(".js-dgwt-wcas-overlay-mobile").remove(),t(".js-dgwt-wcas-om-hook").remove(),setTimeout(function(){o.find("."+s.options.searchInputClass).val("");var t=o.find(".dgwt-wcas-close");o.length>0&&t.removeClass("dgwt-wcas-close"),s.hide()},150),s.overlayMobileState="off"},showCloseButton:function(){var t=void 0!==dgwt_wcas.close_icon?dgwt_wcas.close_icon:"",e=this.getFormWrapper().find("."+this.options.preloaderClass);e.addClass(this.options.closeTrigger),e.html(t)},hideCloseButton:function(){var t=this.getFormWrapper().find("."+this.options.closeTrigger);t.length&&(t.removeClass(this.options.closeTrigger),t.html(""))},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)gtag("event","autocomplete_search",{event_label:t,event_category:e});else if("undefined"!=typeof ga){var s=ga.getAll()[0];s&&s.send({hitType:"event",eventCategory:e,eventAction:"autocomplete_search",eventLabel:t})}}catch(t){}if(this.options.enableGASiteSearchModule)try{if("undefined"!=typeof gtag)gtag("event","page_view",{page_path:"/?s="+encodeURI(t)+"&post_type=product&dgwt_wcas=1"});else if("undefined"!=typeof ga){var i=ga.getAll()[0];i&&(i.set("page","/?s="+encodeURI(t)+"&post_type=product&dgwt_wcas=1"),i.send("pageview"))}}catch(t){}}},t.fn.dgwtWcasAutocomplete=function(e,s){return arguments.length?this.each(function(){var i=t(this),o=i.data("autocomplete");"string"==typeof e?o&&"function"==typeof o[e]&&o[e](s):(o&&o.dispose&&o.dispose(),o=new d(this,e),i.data("autocomplete",o))}):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(document).ready(function(){(["iPad Simulator","iPhone Simulator","iPod Simulator","iPad","iPhone","iPod"].includes(navigator.platform)||navigator.userAgent.includes("Mac")&&"ontouchend"in document)&&t("html").addClass("dgwt-wcas-is-ios");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,dynamicPrices:!(void 0===dgwt_wcas.dynamic_prices||!dgwt_wcas.dynamic_prices),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,mobileBreakpoint:s,mobileOverlayWrapper:dgwt_wcas.mobile_overlay_wrapper,debounceWaitMs:dgwt_wcas.debounce_wait_ms,sendGAEvents:dgwt_wcas.send_ga_events,convertHtml:dgwt_wcas.convert_html,enableGASiteSearchModule:dgwt_wcas.enable_ga_site_search_module},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)})})})}()});
|
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,o=s.split(/ /),a=!1;if(o)for(o=o.sort(function(t,e){return e.length-t.length}),i=0;i<o.length;i++)if(o[i]&&o[i].length>1){var n=o[i].replace(/[\^\@]/g,"");if(n.length>0){var r="("+e.escapeRegExChars(n.trim())+")";t=t.replace(new RegExp(r,"gi"),"^^$1@@"),a=!0}}a&&(t=(t=t.replace(/\^\^/g,"<strong>")).replace(/@@/g,"</strong>"))}else r="("+e.escapeRegExChars(s)+")",t=t.replace(new RegExp(r,"gi"),"<strong>$1</strong>");return t},debounce:function(t,e){var i,o=(new Date).getUTCMilliseconds();if(0===s.id.length)return s.id=o,void t();s.id=o,i=setTimeout(function(){o===s.id?(t(),s.id=""):clearTimeout(i)},e)},mouseHoverDebounce:function(e,s,i){var o;o=setTimeout(function(){t(s+":hover").length>0?e():clearTimeout(o)},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=t.noop;function o(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.cachedPrices={},this.detailsRequestsSent=[],this.onChangeTimeout=null,this.onChange=null,this.isLocal=!1,this.suggestionsContainer=null,this.detailsContainer=null,this.autoAligmentprocess=null,this.noSuggestionsContainer=null,this.latestActivateSource="",this.actionTriggerSource="",this.options=t.extend(!0,{},o.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)}o.utils=e,t.DgwtWcasAutocompleteSearch=o,o.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,dynamicPrices:!1,saleBadgeText:"sale",featuredBadgeText:"featured",minChars:3,maxHeight:600,deferRequestBy:0,params:{},formatResult:function(t,s,i,o){return s?(i&&(t=e.highlight(t,s)),o.convertHtml?t.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/<sup/g,"<sup").replace(/<\/sup/g,"</sup").replace(/sup>/g,"sup>").replace(/<(\/?(strong|b|br))>/g,"<$1>"):t):t},delimiter:null,zIndex:999999999,type:"GET",noCache:!1,isRtl:!1,onSearchStart:i,onSearchComplete:i,onSearchError:i,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",formClass:"dgwt-wcas-search-form",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,enableGASiteSearchModule:!1,showProductVendor:!1},o.prototype={initialize:function(){var s=this;s.element.setAttribute("autocomplete","off"),s.createContainers(),s.registerEventsSearchBar(),s.registerEventsSuggestions(),s.registerEventsDetailsPanel(),s.registerIconHandler(),s.registerEventsFixedMenu(),s.fixPositionCapture=function(){s.adjustContainerWidth(),s.visible&&s.fixPosition()},t(window).on("resize.autocomplete",function(){var t=e.getActiveInstance();void 0!==t&&t.fixPositionCapture()}),s.initMobileMode(),s.hideAfterClickOutsideListener(),s.suggestionsContainer.addClass("js-dgwt-wcas-initialized"),s.detailsContainer&&s.detailsContainer.length>0&&s.detailsContainer.addClass("js-dgwt-wcas-initialized")},createContainers:function(e){var s=this.options;0==t("."+s.containerClass).length?(this.suggestionsContainer=t(o.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(o.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),s.hideCloseButton(),t(this).closest("."+s.options.searchFormClass).find("."+s.options.searchInputClass).val("").focus()}),s.el.closest("."+s.options.formClass).on("submit.autocomplete",function(e){s.suggestions.length>0&&t.each(s.suggestions,function(t,i){if(void 0!==i.type&&"product_variation"==i.type)return s.select(t),e.preventDefault(),!1})}),t(window).on("load",function(){s.positionPreloader()}),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;if(!this.getSuggestionsContainer().hasClass("js-dgwt-wcas-initialized")){t(document).on("mouseenter.autocomplete",s,function(){var s=e.getActiveInstance();if(void 0!==s){var i=t(this).data("index"),o='.dgwt-wcas-suggestion[data-index="'+i+'"]',a=s.canShowDetailsBox()?100:1;s.selectedIndex!=i&&e.mouseHoverDebounce(function(){s.selectedIndex!==i&&(s.latestActivateSource="mouse",s.getDetails(s.suggestions[i]),s.activate(i))},o,a)}});var i=!1;t(document).on("click.autocomplete",s,function(){if(!i){var s=e.getActiveInstance();s.actionTriggerSource="click",i=!0,s.select(t(this).data("index"))}}),t(document).on("mousedown.autocomplete",s,function(e){"number"==typeof e.which&&1===e.which&&t(e.target)[0].click()}),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())}))},registerIconHandler:function(){var s=this,i=s.getFormWrapper(),o=i.find("."+s.options.formClass);i.on("click",".js-dgwt-wcas-search-icon-handler",function(t){var e=i.find("."+s.options.searchInputClass);if(i.hasClass("dgwt-wcas-layout-icon-open"))s.hide(),o.hide(!0),i.removeClass("dgwt-wcas-layout-icon-open");else{var a=i.find(".dgwt-wcas-search-icon-arrow");o.hide(),a.hide(),i.addClass("dgwt-wcas-layout-icon-open"),s.positionIconSearchMode(i),o.fadeIn(200,function(){a.show(),s.positionPreloader(i),e.focus()})}}),0==t(".js-dgwt-wcas-initialized").length&&t(".js-dgwt-wcas-search-icon-handler").length>0&&t(document).click(function(i){if(t(".dgwt-wcas-layout-icon-open").length){var o=t(i.target);if(!(o.closest("."+s.options.searchFormClass).length>0||o.closest("."+s.options.containerClass).length>0||o.closest("."+s.options.containerDetailsClass).length>0)){var a=e.getActiveInstance();if(void 0!==a){var n=a.getFormWrapper().find("."+s.options.formClass);n.hide(),a.hide(!0),n.css({left:"0"})}s.hideIconModeSearch()}}}),t(window).on("resize.autocomplete",function(){s.applyFlexibleMode()}),"complete"==document.readyState?s.applyFlexibleMode():t(window).on("load",function(){s.applyFlexibleMode()})},registerEventsFixedMenu:function(){var e=this;t(window).on("scroll",function(){e.suggestions.length>0&&e.elementOrParentIsFixed(e.getFormWrapper())&&(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)}):(e.fixHeight(),e.fixPositionCapture()))})},initMobileMode:function(){var t=this,e=t.getFormWrapper();e.hasClass("js-dgwt-wcas-mobile-overlay-enabled")&&t.isMobileMode()&&(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()}))},applyFlexibleMode:function(){var e=t(".js-dgwt-wcas-layout-icon-flexible");e.length&&(this.isMobileMode()?(e.addClass("js-dgwt-wcas-layout-icon"),e.addClass("dgwt-wcas-layout-icon")):(e.removeClass("js-dgwt-wcas-layout-icon"),e.removeClass("dgwt-wcas-layout-icon")),e.addClass("dgwt-wcas-layout-icon-flexible-loaded"))},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(),o=e.getQuery(i);e.isMobileMode()||(e.blurTimeoutId=setTimeout(function(){e.hide(),e.selection&&e.currentValue!==o&&(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(),o=t.extend({},s.options,e);s.isLocal=Array.isArray(o.lookup),s.isLocal&&(o.lookup=s.verifySuggestionsFormat(o.lookup)),o.orientation=s.validateOrientation(o.orientation,"bottom"),i.css({"max-height":s.canShowDetailsBox()?"none":o.maxHeight+"px",width:o.width+"px","z-index":o.zIndex}),!0===o.showDetailsPanel&&s.getDetailsContainer().css({"z-index":o.zIndex-1}),o.onSearchComplete=function(){s.getFormWrapper().removeClass("dgwt-wcas-processing"),s.preloader("hide","form","dgwt-wcas-inner-preloader"),s.showCloseButton()},this.options=o},clearCache:function(){this.cachedResponse={},this.cachedDetails={},this.cachedPrices={},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(),o=this.getFormOffset(),a=o.left;if(0==i.length)return!1;var n=!0===this.options.isRtl?1:2,r=Math.round(o.left);if(o.left=r+Math.round(s.width()+n),i.css(o),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",a+"px")));var l=t(window).width(),c=i.width(),d=i.offset();t("body").addClass("dgwt-wcas-details-outside"),!0===this.options.isRtl&&(o.left=o.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 o=[e.width(),s.height()];t.options.showDetailsPanel&&(o[2]=i.height()),t.autoAligmentprocess=setInterval(function(){var a=[e.width(),s.height()];t.options.showDetailsPanel&&(a[2]=i.height());for(var n=0;n<o.length;n++)if(o[n]!=a[n]){t.fixHeight(),t.fixPositionCapture(),o=a;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,o=e.outerHeight(),a=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-o,g=c+l-(n.top+a+o);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+=a;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||40!==t.which||!this.currentValue){if(!this.disabled&&this.visible){switch(t.which){case 27:this.el.val(this.currentValue),this.hide();break;case 39:if(this.hint&&this.options.onHint&&this.isCursorAtEnd()){this.selectHint();break}return;case 9: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 13:if(-1===this.selectedIndex)return void this.hide();this.actionTriggerSource="enter",this.select(this.selectedIndex);break;case 38:this.moveUp();break;case 40: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 38:case 40: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?(this.hideCloseButton(),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,o=e.toLowerCase(),a=i.lookupFilter,n=parseInt(i.lookupLimit,10);return s={suggestions:t.grep(i.lookup,function(t){return a(t,e,o)})},n&&s.suggestions.length>n&&(s.suggestions=s.suggestions.slice(0,n)),s},getSuggestions:function(i){var o,a,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),c.params=l.applyCustomParams(c.params),l.preloader("show","form","dgwt-wcas-inner-preloader"),g.addClass("dgwt-wcas-processing"),!1!==c.onSearchStart.call(l.element,c.params)&&(a=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?o=l.getSuggestionsLocal(i):(t.isFunction(d)&&(d=d.call(l.element,i)),n=d+"?"+t.param(a||{}),o=l.cachedResponse[n]),o&&Array.isArray(o.suggestions)?(l.suggestions=o.suggestions,l.suggest(),l.selectFirstSuggestion(o.suggestions),c.onSearchComplete.call(l.element,i,o.suggestions)):l.isBadQuery(i)?c.onSearchComplete.call(l.element,i,[]):(l.abortAjax(),r={url:d,data:a,type:c.type,dataType:c.dataType},t.extend(r,c.ajaxSettings),s.object=l,s.ajaxSettings=r,e.debounce(function(){var e=s.object,o=s.ajaxSettings;e.currentRequest=t.ajax(o).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),e.updatePrices()}).fail(function(t,s,o){e.options.onSearchError.call(e.element,i,t,s,o)})},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,o=s.getDetailsContainer(),a=s.prepareSuggestionObjectID(e);if(null!=(i=s.cachedDetails[a]))o.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)}}),o.html(""),s.preloader("show","details","",!0),-1!=t.inArray(a,s.detailsRequestsSent))return;s.detailsRequestsSent.push(a),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 a=e.items[i].objectID;s.cachedDetails[a]={html:e.items[i].html},void 0!==e.items[i].price&&e.items[i].price.length>0&&(s.cachedPrices[a]=e.items[i].price),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]?o.html(s.cachedDetails[n].html):o.html(""),s.fixPositionCapture(),s.fixHeight(),s.updatePrices(!0)},error:function(t,e){s.preloader("hide","details","",!0),o.html(t),s.fixPositionCapture(),s.fixHeight()}})}t(document).trigger("dgwtWcasDetailsPanelLoaded",s)}},updatePrices:function(e){var s,i,o=this,a=[];if(o.options.showPrice&&o.options.dynamicPrices&&0!=o.suggestions.length){for(s=0;s<o.suggestions.length;s++)if(void 0!==o.suggestions[s].type&&("product"==o.suggestions[s].type||"product_variation"==o.suggestions[s].type)){var n="product__"+o.suggestions[s].post_id;void 0!==o.cachedPrices[n]?o.updatePrice(s,o.cachedPrices[n]):(o.applyPreloaderForPrice(s),a.push(o.suggestions[s].post_id))}if(!e&&a.length>0){var r={action:void 0===dgwt_wcas.action_get_prices?"dgwt_wcas_get_prices":dgwt_wcas.action_get_prices,items:a};t.ajax({data:r,type:"post",url:dgwt_wcas.ajax_prices_endpoint,success:function(t){if(void 0!==t.success&&t.success&&t.data.length>0)for(s=0;s<t.data.length;s++){var e=t.data[s].id,a=t.data[s].price;if(o.suggestions.length>0)for(i=0;i<o.suggestions.length;i++)if(void 0!==o.suggestions[i].type&&("product"==o.suggestions[i].type||"product_variation"==o.suggestions[i].type)&&o.suggestions[i].post_id==e){var n="product__"+e;o.cachedPrices[n]=a,o.updatePrice(i,a)}}},error:function(t,e){}})}}},updatePrice:function(e,s){if(void 0!==this.suggestions[e]){this.suggestions[e].price=s;var i=t(".dgwt-wcas-suggestions-wrapp").find('[data-index="'+e+'"] .dgwt-wcas-sp');i.length&&i.html(s)}},applyCustomParams:function(t){if("object"==typeof dgwt_wcas.custom_params){var e=dgwt_wcas.custom_params;for(var s in e)t[s]=e[s]}var i=this.el.data("custom-params");if("object"==typeof i)for(var s in i)t[s]=i[s];return t},applyPreloaderForPrice:function(e){if(void 0!==this.suggestions[e]){var s=t(".dgwt-wcas-suggestions-wrapp").find('[data-index="'+e+'"] .dgwt-wcas-sp');s.length&&s.html('<div class="dgwt-wcas-preloader-price"><div class="dgwt-wcas-preloader-price-inner"> <div></div><div></div><div></div></div></div>')}},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.latestActivateSource="system",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(e){this.getFormWrapper();var s=this.getSuggestionsContainer(),i=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),s.hide(),s.removeClass(this.classes.suggestionsContainerOrientTop),i.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),"boolean"==typeof e&&e&&(this.hideCloseButton(),this.currentValue="",this.suggestions=[]),this.signalHint(null)},positionIconSearchMode:function(e){var s,i=e.find("."+this.options.formClass),o=i.width(),a=t(window).width(),n=e[0].getBoundingClientRect().left;i[0].getBoundingClientRect().left;var r=(n+10)/a;s=Math.floor(o*r*-1),i.css({left:s+"px"})},hideIconModeSearch:function(){var e=t(".dgwt-wcas-layout-icon-open");e.length>0&&e.removeClass("dgwt-wcas-layout-icon-open")},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)),o=!(t(s.target).closest("."+e.options.containerClass).length>0||t(s.target).hasClass(e.options.containerClass));if(e.canShowDetailsBox()){var a=!(t(s.target).closest("."+e.options.containerDetailsClass).length>0||t(s.target).hasClass(e.options.containerDetailsClass));i&&o&&a&&e.hide()}else i&&o&&e.hide()}})},suggest:function(){if(this.suggestions.length){var e,s=this,i=s.options,o=i.groupBy,a=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(o&&(h+=function(t,s){var i=l.data[o];return e===i?"":'<div class="autocomplete-group"><strong>'+(e=i)+"</strong></div>"}()),void 0===l.type||"product"!=l.type&&"product_variation"!=l.type){var u,p=r,w="dgwt-wcas-st",f="",m="",v="",C=!0;"product_cat"===l.taxonomy?(p+=" dgwt-wcas-suggestion-tax dgwt-wcas-suggestion-cat",i.showHeadings||(f+='<span class="dgwt-wcas-st--direct-headline">'+dgwt_wcas.labels.category+"</span>"),void 0!==l.breadcrumbs&&l.breadcrumbs&&(v=l.breadcrumbs+" > "+l.value,m+='<span class="dgwt-wcas-st-breadcrumbs">'+dgwt_wcas.labels.in+" "+l.breadcrumbs+"</span>")):"product_tag"===l.taxonomy?(p+=" dgwt-wcas-suggestion-tax dgwt-wcas-suggestion-tag",i.showHeadings||(f+='<span class="dgwt-wcas-st--direct-headline">'+dgwt_wcas.labels.tag+"</span>")):i.isPremium&&l.taxonomy===i.taxonomyBrands?(p+=" dgwt-wcas-suggestion-tax dgwt-wcas-suggestion-brand",i.showHeadings||(f+='<span class="dgwt-wcas-st--direct-headline">'+dgwt_wcas.labels.brand+"</span>")):i.isPremium&&"vendor"===l.type?(p+=" dgwt-wcas-suggestion-vendor dgwt-wcas-suggestion-vendor",i.showHeadings||(f+='<span class="dgwt-wcas-st--direct-headline">'+dgwt_wcas.labels.vendor+"</span>")):i.isPremium&&"post"===l.type?(p+=" dgwt-wcas-suggestion-pt dgwt-wcas-suggestion-tp-post",i.showHeadings||(f+='<span class="dgwt-wcas-st--direct-headline">'+dgwt_wcas.labels.post+"</span>")):i.isPremium&&"page"===l.type?(p+=" dgwt-wcas-suggestion-pt dgwt-wcas-suggestion-pt-page",i.showHeadings||(f+='<span class="dgwt-wcas-st--direct-headline">'+dgwt_wcas.labels.page+"</span>")):"more_products"===l.type?(p+=" js-dgwt-wcas-suggestion-more dgwt-wcas-suggestion-more",w="dgwt-wcas-st-more",l.value=dgwt_wcas.labels.show_more+" ("+l.total+")",C=!1):i.showHeadings&&"headline"===l.type?(p+=" 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"]),C=!1):(p+=" dgwt-wcas-suggestion-nores",l.value=dgwt_wcas.labels.no_results,C=!1,!0===i.showDetailsPanel&&d.html(""),t("body").addClass("dgwt-wcas-nores")),void 0!==l.image_src&&l.image_src&&(u=!0),v=v.length>0?' title="'+v+'"':"",h+='<div class="'+p+'" data-index="'+s+'">',u&&(h+='<span class="dgwt-wcas-si"><img src="'+l.image_src+'" /></span>',h+='<div class="dgwt-wcas-content-wrapp">'),h+="<span"+v+' class="'+w+'">',"vendor"===l.type?(h+='<span class="dgwt-wcas-st-title">'+f+a(l.value,n,C,i)+m+"</span>",l.shop_city&&(h+='<span class="dgwt-wcas-vendor-city"><span> - </span>'+a(l.shop_city,n,!0,i)+"</span>"),void 0!==l.desc&&l.desc&&(h+='<span class="dgwt-wcas-sd">'+a(l.desc,n,!0,i)+"</span>")):h+=f+a(l.value,n,C,i)+m,h+="</span>",h+=u?"</div>":"",h+="</div>"}else{!0===i.showImage&&void 0!==l.thumb_html&&(g=!0);var b="product_variation"===l.type?" dgwt-wcas-suggestion-product-var":"";if(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"+b+'" 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">'+a(l.value,n,!0,i)+"</span>",!0===i.showSKU&&void 0!==l.sku&&l.sku.length>0&&(h+='<span class="dgwt-wcas-sku">('+dgwt_wcas.labels.sku_label+" "+a(l.sku,n,!0,i)+")</span>"),!0===i.showDescription&&void 0!==l.desc&&l.desc&&(h+='<span class="dgwt-wcas-sd">'+a(l.desc,n,!0,i)+"</span>"),!0===i.showProductVendor&&void 0!==l.vendor&&l.vendor){var y='<span class="dgwt-wcas-product-vendor"><span class="dgwt-wcas-product-vendor-label">'+dgwt_wcas.labels.vendor_sold_by+" </span>"+l.vendor+"</span>";void 0!==l.vendor_url&&l.vendor_url?h+='<a href="'+l.vendor_url+'">'+y+"</a>":h+=y}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"),o=this.getFormWrapper(),a=this.getSuggestionsContainer(),n=this.getDetailsContainer(),r=this.getFormOffset();if(o.length){var l=getComputedStyle(o[0]).width;if(l=Math.round(parseFloat(l.replace("px",""))),"auto"===s.width&&(e=this.el.outerWidth(),a.css("width",e+"px")),this.canShowDetailsBox()){if(o.width()>=550)return i.addClass("dgwt-wcas-full-width"),l%2==0?(a.css("width",Math.round(l/2)),n.css("width",Math.round(l/2))):(a.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"):a.css("left",l/2+r.left+"px"));i.addClass("dgwt-wcas-details-right")}}},positionPreloader:function(e){var s="object"==typeof e?e.find(".dgwt-wcas-search-submit"):t(".dgwt-wcas-search-submit");s.length>0&&s.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")})},findBestHint:function(){var e=this.el.val().toLowerCase(),s=null;e&&(t.each(this.suggestions,function(t,i){var o=0===i.value.toLowerCase().indexOf(e);return o&&(s=i),!o}),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,o){var a,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===o)if("hide"!==e){if("show"===e){var c=this.options.isRtl?"-rtl":"";a='<div class="'+l+'"><img class="dgwt-wcas-placeholder-preloader" src="'+dgwt_wcas.img_url+"placeholder"+c+'.png" /></div>',n.html(a)}}else t(r).remove();else"hide"===e?(n.removeClass(i),n.html("")):(n.addClass(i),"string"==typeof dgwt_wcas.preloader_icon&&n.html(dgwt_wcas.preloader_icon))},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,o=this.getSuggestionsContainer(),a=o.find("."+this.classes.suggestion);return o.find("."+i).removeClass(i),this.selectedIndex=e,-1!==this.selectedIndex&&a.length>this.selectedIndex?(s=a.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){if(this.latestActivateSource="key",0===this.selectedIndex)return 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();this.adjustScroll(this.selectedIndex-1,"up")}},moveDown:function(){this.selectedIndex!==this.suggestions.length-1&&(this.latestActivateSource="key",this.adjustScroll(this.selectedIndex+1,"down"))},adjustScroll:function(e,s){if("headline"===this.suggestions[e].type&&(e="down"===s?e+1:e-1),void 0!==this.suggestions[e]){var i=this.activate(e);if(this.getDetails(this.suggestions[e]),"more_products"!==this.suggestions[e].type&&i&&!this.canShowDetailsBox()){var o,a,n,r=this.getSuggestionsContainer(),l=t(i).outerHeight();o=i.offsetTop,n=(a=r.scrollTop())+this.options.maxHeight-l,o<a?r.scrollTop(o):o>n&&r.scrollTop(o-this.options.maxHeight+l),this.options.preserveInput||(this.ignoreValueChange=!0),this.signalHint(null)}}},onSelect:function(e){var s=this.options.onSelect,i=this.suggestions[e];void 0===i.type||"more_products"!==i.type&&("enter"!==this.actionTriggerSource||"key"==this.latestActivateSource||"product_variation"==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(),o=e.getSuggestionsContainer(),a="";t("html").addClass("dgwt-wcas-overlay-mobile-on"),a+='<div class="js-dgwt-wcas-overlay-mobile dgwt-wcas-overlay-mobile">',a+='<div class="dgwt-wcas-om-bar js-dgwt-wcas-om-bar">',a+='<button class="dgwt-wcas-om-return js-dgwt-wcas-om-return">',"string"==typeof dgwt_wcas.back_icon?a+=dgwt_wcas.back_icon:(a+='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" color="#FFF">',a+='<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>',a+="</svg>"),a+="</button>",a+="</div>",a+="</div>",t(e.options.mobileOverlayWrapper).append(a),(s=t(".js-dgwt-wcas-overlay-mobile")).css("zIndex",99999999999),i.after('<span class="js-dgwt-wcas-om-hook"></span>'),i.appendTo(".js-dgwt-wcas-om-bar"),o.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(),o=t(".js-dgwt-wcas-om-bar").find("."+s.options.searchFormClass);o.hasClass("dgwt-wcas-has-submit-off")&&(o.removeClass("dgwt-wcas-has-submit-off"),o.addClass("dgwt-wcas-has-submit")),o.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(o),t(".js-dgwt-wcas-overlay-mobile").remove(),t(".js-dgwt-wcas-om-hook").remove(),setTimeout(function(){o.find("."+s.options.searchInputClass).val("");var t=o.find(".dgwt-wcas-close");o.length>0&&t.removeClass("dgwt-wcas-close"),s.hide()},150),s.overlayMobileState="off"},showCloseButton:function(){var t=void 0!==dgwt_wcas.close_icon?dgwt_wcas.close_icon:"",e=this.getFormWrapper().find("."+this.options.preloaderClass);e.addClass(this.options.closeTrigger),e.html(t)},hideCloseButton:function(){var t=this.getFormWrapper().find("."+this.options.closeTrigger);t.length&&(t.removeClass(this.options.closeTrigger),t.html(""))},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)gtag("event","autocomplete_search",{event_label:t,event_category:e});else if("undefined"!=typeof ga){var s=ga.getAll()[0];s&&s.send({hitType:"event",eventCategory:e,eventAction:"autocomplete_search",eventLabel:t})}}catch(t){}if(this.options.enableGASiteSearchModule)try{if("undefined"!=typeof gtag)gtag("event","page_view",{page_path:"/?s="+encodeURI(t)+"&post_type=product&dgwt_wcas=1"});else if("undefined"!=typeof ga){var i=ga.getAll()[0];i&&(i.set("page","/?s="+encodeURI(t)+"&post_type=product&dgwt_wcas=1"),i.send("pageview"))}}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 o(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(document).ready(function(){(["iPad Simulator","iPhone Simulator","iPod Simulator","iPad","iPhone","iPod"].includes(navigator.platform)||navigator.userAgent.includes("Mac")&&"ontouchend"in document)&&t("html").addClass("dgwt-wcas-is-ios");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,dynamicPrices:!(void 0===dgwt_wcas.dynamic_prices||!dgwt_wcas.dynamic_prices),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,mobileBreakpoint:s,mobileOverlayWrapper:dgwt_wcas.mobile_overlay_wrapper,debounceWaitMs:dgwt_wcas.debounce_wait_ms,sendGAEvents:dgwt_wcas.send_ga_events,convertHtml:dgwt_wcas.convert_html,enableGASiteSearchModule:dgwt_wcas.enable_ga_site_search_module,showProductVendor:!(void 0===dgwt_wcas.show_product_vendor||!dgwt_wcas.show_product_vendor)},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/SettingsAPI.php
CHANGED
@@ -595,6 +595,29 @@ class SettingsAPI
|
|
595 |
echo $html ;
|
596 |
}
|
597 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
598 |
/**
|
599 |
* Sanitize callback for Settings API
|
600 |
*/
|
595 |
echo $html ;
|
596 |
}
|
597 |
|
598 |
+
/**
|
599 |
+
* Displays filters rules in settings
|
600 |
+
*
|
601 |
+
* @param array $args settings field args
|
602 |
+
*/
|
603 |
+
function callback_filters_rules_plug( $args )
|
604 |
+
{
|
605 |
+
ob_start();
|
606 |
+
?>
|
607 |
+
<div id="dgwt-wcas-settings-filters-rules">
|
608 |
+
<div>
|
609 |
+
<p><?php
|
610 |
+
_e( 'No rules', 'ajax-search-for-woocommerce' );
|
611 |
+
?></p><br>
|
612 |
+
</div>
|
613 |
+
<button class="button button-secondary"><?php
|
614 |
+
_e( 'Add new rule', 'ajax-search-for-woocommerce' );
|
615 |
+
?></button>
|
616 |
+
</div>
|
617 |
+
<?php
|
618 |
+
echo ob_get_clean() ;
|
619 |
+
}
|
620 |
+
|
621 |
/**
|
622 |
* Sanitize callback for Settings API
|
623 |
*/
|
includes/Admin/Troubleshooting.php
CHANGED
@@ -4,6 +4,7 @@ namespace DgoraWcas\Admin;
|
|
4 |
|
5 |
use DgoraWcas\Helpers ;
|
6 |
use DgoraWcas\Engines\TNTSearchMySQL\Indexer\Builder ;
|
|
|
7 |
// Exit if accessed directly
|
8 |
if ( !defined( 'ABSPATH' ) ) {
|
9 |
exit;
|
@@ -488,6 +489,52 @@ class Troubleshooting
|
|
488 |
return false;
|
489 |
}
|
490 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
491 |
/**
|
492 |
* Get result of async test
|
493 |
*
|
4 |
|
5 |
use DgoraWcas\Helpers ;
|
6 |
use DgoraWcas\Engines\TNTSearchMySQL\Indexer\Builder ;
|
7 |
+
use DgoraWcas\Multilingual ;
|
8 |
// Exit if accessed directly
|
9 |
if ( !defined( 'ABSPATH' ) ) {
|
10 |
exit;
|
489 |
return false;
|
490 |
}
|
491 |
|
492 |
+
/**
|
493 |
+
* Get table with server environment
|
494 |
+
*
|
495 |
+
* @return string
|
496 |
+
*/
|
497 |
+
private function getDebugData()
|
498 |
+
{
|
499 |
+
if ( !class_exists( 'WP_Debug_Data' ) ) {
|
500 |
+
require_once ABSPATH . 'wp-admin/includes/class-wp-debug-data.php';
|
501 |
+
}
|
502 |
+
$result = '';
|
503 |
+
$info = \WP_Debug_Data::debug_data();
|
504 |
+
|
505 |
+
if ( isset( $info['wp-server']['fields'] ) ) {
|
506 |
+
ob_start();
|
507 |
+
?>
|
508 |
+
<p><b><?php
|
509 |
+
_e( 'Server environment', 'ajax-search-for-woocommerce' );
|
510 |
+
?></b></p>
|
511 |
+
<table class="widefat striped" role="presentation">
|
512 |
+
<tbody>
|
513 |
+
<?php
|
514 |
+
foreach ( $info['wp-server']['fields'] as $field_name => $field ) {
|
515 |
+
|
516 |
+
if ( is_array( $field['value'] ) ) {
|
517 |
+
$values = '<ul>';
|
518 |
+
foreach ( $field['value'] as $name => $value ) {
|
519 |
+
$values .= sprintf( '<li>%s: %s</li>', esc_html( $name ), esc_html( $value ) );
|
520 |
+
}
|
521 |
+
$values .= '</ul>';
|
522 |
+
} else {
|
523 |
+
$values = esc_html( $field['value'] );
|
524 |
+
}
|
525 |
+
|
526 |
+
printf( '<tr><td>%s</td><td>%s</td></tr>', esc_html( $field['label'] ), $values );
|
527 |
+
}
|
528 |
+
?>
|
529 |
+
</tbody>
|
530 |
+
</table>
|
531 |
+
<?php
|
532 |
+
$result = ob_get_clean();
|
533 |
+
}
|
534 |
+
|
535 |
+
return $result;
|
536 |
+
}
|
537 |
+
|
538 |
/**
|
539 |
* Get result of async test
|
540 |
*
|
includes/Engines/WordPressNative/DetailsBox.php
CHANGED
@@ -216,7 +216,7 @@ class DetailsBox
|
|
216 |
}
|
217 |
|
218 |
$title .= '</span>';
|
219 |
-
$title .= $termName;
|
220 |
$title .= '</span>';
|
221 |
$title = apply_filters(
|
222 |
'dgwt/wcas/suggestion_details/taxonomy/headline',
|
216 |
}
|
217 |
|
218 |
$title .= '</span>';
|
219 |
+
$title .= esc_html( wp_unslash( $termName ) );
|
220 |
$title .= '</span>';
|
221 |
$title = apply_filters(
|
222 |
'dgwt/wcas/suggestion_details/taxonomy/headline',
|
includes/Engines/WordPressNative/Search.php
CHANGED
@@ -35,8 +35,19 @@ class Search
|
|
35 |
* @var null
|
36 |
*/
|
37 |
private $postsIDsBuffer = null ;
|
|
|
|
|
|
|
|
|
|
|
38 |
public function __construct()
|
39 |
{
|
|
|
|
|
|
|
|
|
|
|
|
|
40 |
add_filter(
|
41 |
'posts_search',
|
42 |
array( $this, 'searchFilters' ),
|
@@ -507,17 +518,19 @@ class Search
|
|
507 |
$term = esc_sql( $wpdb->esc_like( $term ) );
|
508 |
$search .= "{$searchand} (";
|
509 |
// Search in title
|
510 |
-
|
|
|
|
|
511 |
// Search in content
|
512 |
-
if ( DGWT_WCAS()->settings->getOption( 'search_in_product_content' ) === 'on' ) {
|
513 |
$search .= " OR ({$wpdb->posts}.post_content LIKE '{$n}{$term}{$n}')";
|
514 |
}
|
515 |
// Search in excerpt
|
516 |
-
if ( DGWT_WCAS()->settings->getOption( 'search_in_product_excerpt' ) === 'on' ) {
|
517 |
$search .= " OR ({$wpdb->posts}.post_excerpt LIKE '{$n}{$term}{$n}')";
|
518 |
}
|
519 |
// Search in SKU
|
520 |
-
if ( DGWT_WCAS()->settings->getOption( 'search_in_product_sku' ) === 'on' ) {
|
521 |
$search .= " OR (dgwt_wcasmsku.meta_key='_sku' AND dgwt_wcasmsku.meta_value LIKE '{$n}{$term}{$n}')";
|
522 |
}
|
523 |
$search .= ")";
|
@@ -563,7 +576,7 @@ class Search
|
|
563 |
}
|
564 |
|
565 |
if ( $this->isAjaxSearch() && !is_admin() ) {
|
566 |
-
if ( DGWT_WCAS()->settings->getOption( 'search_in_product_sku' ) === 'on' ) {
|
567 |
$join .= " INNER JOIN {$wpdb->postmeta} AS dgwt_wcasmsku ON ( {$wpdb->posts}.ID = dgwt_wcasmsku.post_id )";
|
568 |
}
|
569 |
}
|
@@ -587,7 +600,7 @@ class Search
|
|
587 |
if ( empty($wp_the_query->query_vars['wc_query']) || empty($wp_the_query->query_vars['s']) ) {
|
588 |
return $where;
|
589 |
}
|
590 |
-
if ( DGWT_WCAS()->settings->getOption( 'search_in_product_excerpt' ) !== 'on' ) {
|
591 |
$where = preg_replace( "/OR \\(post_excerpt\\s+LIKE\\s*(\\'\\%[^\\%]+\\%\\')\\)/", "", $where );
|
592 |
}
|
593 |
return $where;
|
35 |
* @var null
|
36 |
*/
|
37 |
private $postsIDsBuffer = null ;
|
38 |
+
/**
|
39 |
+
* List of fields in which the phrase is searched
|
40 |
+
* @var array
|
41 |
+
*/
|
42 |
+
private $searchIn = array() ;
|
43 |
public function __construct()
|
44 |
{
|
45 |
+
$this->searchIn = apply_filters( 'dgwt/wcas/native/search_in', array(
|
46 |
+
'title',
|
47 |
+
'content',
|
48 |
+
'excerpt',
|
49 |
+
'sku'
|
50 |
+
) );
|
51 |
add_filter(
|
52 |
'posts_search',
|
53 |
array( $this, 'searchFilters' ),
|
518 |
$term = esc_sql( $wpdb->esc_like( $term ) );
|
519 |
$search .= "{$searchand} (";
|
520 |
// Search in title
|
521 |
+
if ( in_array( 'title', $this->searchIn ) ) {
|
522 |
+
$search .= "({$wpdb->posts}.post_title LIKE '{$n}{$term}{$n}')";
|
523 |
+
}
|
524 |
// Search in content
|
525 |
+
if ( DGWT_WCAS()->settings->getOption( 'search_in_product_content' ) === 'on' && in_array( 'content', $this->searchIn ) ) {
|
526 |
$search .= " OR ({$wpdb->posts}.post_content LIKE '{$n}{$term}{$n}')";
|
527 |
}
|
528 |
// Search in excerpt
|
529 |
+
if ( DGWT_WCAS()->settings->getOption( 'search_in_product_excerpt' ) === 'on' && in_array( 'excerpt', $this->searchIn ) ) {
|
530 |
$search .= " OR ({$wpdb->posts}.post_excerpt LIKE '{$n}{$term}{$n}')";
|
531 |
}
|
532 |
// Search in SKU
|
533 |
+
if ( DGWT_WCAS()->settings->getOption( 'search_in_product_sku' ) === 'on' && in_array( 'sku', $this->searchIn ) ) {
|
534 |
$search .= " OR (dgwt_wcasmsku.meta_key='_sku' AND dgwt_wcasmsku.meta_value LIKE '{$n}{$term}{$n}')";
|
535 |
}
|
536 |
$search .= ")";
|
576 |
}
|
577 |
|
578 |
if ( $this->isAjaxSearch() && !is_admin() ) {
|
579 |
+
if ( DGWT_WCAS()->settings->getOption( 'search_in_product_sku' ) === 'on' && in_array( 'sku', $this->searchIn ) ) {
|
580 |
$join .= " INNER JOIN {$wpdb->postmeta} AS dgwt_wcasmsku ON ( {$wpdb->posts}.ID = dgwt_wcasmsku.post_id )";
|
581 |
}
|
582 |
}
|
600 |
if ( empty($wp_the_query->query_vars['wc_query']) || empty($wp_the_query->query_vars['s']) ) {
|
601 |
return $where;
|
602 |
}
|
603 |
+
if ( DGWT_WCAS()->settings->getOption( 'search_in_product_excerpt' ) !== 'on' && in_array( 'excerpt', $this->searchIn ) ) {
|
604 |
$where = preg_replace( "/OR \\(post_excerpt\\s+LIKE\\s*(\\'\\%[^\\%]+\\%\\')\\)/", "", $where );
|
605 |
}
|
606 |
return $where;
|
includes/Helpers.php
CHANGED
@@ -854,7 +854,12 @@ class Helpers
|
|
854 |
*
|
855 |
* @return string
|
856 |
*/
|
857 |
-
public static function createQuestionMark(
|
|
|
|
|
|
|
|
|
|
|
858 |
{
|
859 |
|
860 |
if ( !empty($template) ) {
|
@@ -870,7 +875,7 @@ class Helpers
|
|
870 |
}
|
871 |
|
872 |
$id = 'js-dgwt-wcas-tooltip-id' . sanitize_key( $id );
|
873 |
-
$html = '<div class="js-dgwt-wcas-tooltip dgwt-wcas-questio-mark dashicons dashicons-editor-help" data-tooltip-html-el="' . $id . '"></div>';
|
874 |
$html .= '<div class="' . $id . '" style="display:none;"><div class="dgwt-wcas-tooltip-wrapper">' . $content . '</div></div>';
|
875 |
return $html;
|
876 |
}
|
@@ -933,14 +938,17 @@ class Helpers
|
|
933 |
'brand' => __( 'Brand', 'ajax-search-for-woocommerce' ),
|
934 |
'post' => __( 'Post' ),
|
935 |
'page' => __( 'Page' ),
|
|
|
936 |
'product_cat_plu' => __( 'Categories', 'woocommerce' ),
|
937 |
'product_tag_plu' => __( 'Tags' ),
|
938 |
'product_plu' => __( 'Products', 'woocommerce' ),
|
939 |
'brand_plu' => __( 'Brands', 'ajax-search-for-woocommerce' ),
|
940 |
'post_plu' => __( 'Posts' ),
|
941 |
'page_plu' => __( 'Pages' ),
|
|
|
942 |
'sku_label' => __( 'SKU', 'woocommerce' ) . ':',
|
943 |
'sale_badge' => __( 'Sale', 'woocommerce' ),
|
|
|
944 |
'featured_badge' => __( 'Featured', 'woocommerce' ),
|
945 |
'in' => _x( 'in', 'in categories fe. in Books > Crime stories', 'ajax-search-for-woocommerce' ),
|
946 |
'read_more' => __( 'continue reading', 'ajax-search-for-woocommerce' ),
|
854 |
*
|
855 |
* @return string
|
856 |
*/
|
857 |
+
public static function createQuestionMark(
|
858 |
+
$id,
|
859 |
+
$content = '',
|
860 |
+
$template = '',
|
861 |
+
$placement = 'top'
|
862 |
+
)
|
863 |
{
|
864 |
|
865 |
if ( !empty($template) ) {
|
875 |
}
|
876 |
|
877 |
$id = 'js-dgwt-wcas-tooltip-id' . sanitize_key( $id );
|
878 |
+
$html = '<div class="js-dgwt-wcas-tooltip dgwt-wcas-questio-mark dashicons dashicons-editor-help" data-tooltip-html-el="' . $id . '" data-tooltip-placement="' . $placement . '"></div>';
|
879 |
$html .= '<div class="' . $id . '" style="display:none;"><div class="dgwt-wcas-tooltip-wrapper">' . $content . '</div></div>';
|
880 |
return $html;
|
881 |
}
|
938 |
'brand' => __( 'Brand', 'ajax-search-for-woocommerce' ),
|
939 |
'post' => __( 'Post' ),
|
940 |
'page' => __( 'Page' ),
|
941 |
+
'vendor' => __( 'Vendor', 'ajax-search-for-woocommerce' ),
|
942 |
'product_cat_plu' => __( 'Categories', 'woocommerce' ),
|
943 |
'product_tag_plu' => __( 'Tags' ),
|
944 |
'product_plu' => __( 'Products', 'woocommerce' ),
|
945 |
'brand_plu' => __( 'Brands', 'ajax-search-for-woocommerce' ),
|
946 |
'post_plu' => __( 'Posts' ),
|
947 |
'page_plu' => __( 'Pages' ),
|
948 |
+
'vendor_plu' => __( 'Vendors', 'ajax-search-for-woocommerce' ),
|
949 |
'sku_label' => __( 'SKU', 'woocommerce' ) . ':',
|
950 |
'sale_badge' => __( 'Sale', 'woocommerce' ),
|
951 |
+
'vendor_sold_by' => __( 'Sold by:', 'ajax-search-for-woocommerce' ),
|
952 |
'featured_badge' => __( 'Featured', 'woocommerce' ),
|
953 |
'in' => _x( 'in', 'in categories fe. in Books > Crime stories', 'ajax-search-for-woocommerce' ),
|
954 |
'read_more' => __( 'continue reading', 'ajax-search-for-woocommerce' ),
|
includes/Integrations/Brands.php
CHANGED
@@ -14,10 +14,12 @@ if ( ! defined( 'ABSPATH' ) ) {
|
|
14 |
* @package DgoraWcas\Integrations
|
15 |
*
|
16 |
* Support for plugins:
|
17 |
-
* 1. WooCommerce Brands
|
18 |
-
* 2. YITH WooCommerce Brands Add-on
|
19 |
-
* 3. Perfect WooCommerce Brands
|
20 |
-
* 4. Martfury Addons
|
|
|
|
|
21 |
*/
|
22 |
class Brands {
|
23 |
/**
|
@@ -91,6 +93,12 @@ class Brands {
|
|
91 |
case 'perfect-woocommerce-brands/perfect-woocommerce-brands.php':
|
92 |
$brandTaxonomy = 'pwb-brand';
|
93 |
break;
|
|
|
|
|
|
|
|
|
|
|
|
|
94 |
}
|
95 |
}
|
96 |
|
@@ -111,7 +119,9 @@ class Brands {
|
|
111 |
'yith-woocommerce-brands-add-on-premium/init.php',
|
112 |
'perfect-woocommerce-brands/main.php',
|
113 |
'perfect-woocommerce-brands/perfect-woocommerce-brands.php',
|
114 |
-
'martfury-addons/martfury-addons.php'
|
|
|
|
|
115 |
);
|
116 |
}
|
117 |
|
@@ -121,7 +131,7 @@ class Brands {
|
|
121 |
* @return bool
|
122 |
*/
|
123 |
public function hasBrands() {
|
124 |
-
return ! empty( $this->pluginInfo );
|
125 |
}
|
126 |
|
127 |
/**
|
@@ -160,7 +170,14 @@ class Brands {
|
|
160 |
if ( $this->hasBrands() ) {
|
161 |
add_filter( 'dgwt/wcas/settings/section=search', function ( $settingsScope ) {
|
162 |
|
163 |
-
$
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
164 |
|
165 |
$settingsScope[220] = array(
|
166 |
'name' => 'search_in_brands',
|
@@ -168,7 +185,7 @@ class Brands {
|
|
168 |
'class' => 'dgwt-wcas-premium-only',
|
169 |
'type' => 'checkbox',
|
170 |
'default' => 'off',
|
171 |
-
'desc' =>
|
172 |
);
|
173 |
|
174 |
return $settingsScope;
|
@@ -176,7 +193,14 @@ class Brands {
|
|
176 |
|
177 |
add_filter( 'dgwt/wcas/settings/section=autocomplete', function ( $settingsScope ) {
|
178 |
|
179 |
-
$
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
180 |
|
181 |
$settingsScope[1260] = array(
|
182 |
'name' => 'show_matching_brands',
|
@@ -184,7 +208,7 @@ class Brands {
|
|
184 |
'class' => 'dgwt-wcas-premium-only',
|
185 |
'type' => 'checkbox',
|
186 |
'default' => 'off',
|
187 |
-
'desc' =>
|
188 |
);
|
189 |
|
190 |
return $settingsScope;
|
14 |
* @package DgoraWcas\Integrations
|
15 |
*
|
16 |
* Support for plugins:
|
17 |
+
* 1. WooCommerce Brands since v1.6.9 by WooCommerce
|
18 |
+
* 2. YITH WooCommerce Brands Add-on since v1.3.3 by YITH
|
19 |
+
* 3. Perfect WooCommerce Brands since v1.8.3 by Alberto de Vera Sevilla
|
20 |
+
* 4. Martfury Addons since v2.2.2 by drfuri.com
|
21 |
+
* 5. Brands for WooCommerce since v3.5.2 by BeRocket
|
22 |
+
* 6. WP Bingo by wpbingo
|
23 |
*/
|
24 |
class Brands {
|
25 |
/**
|
93 |
case 'perfect-woocommerce-brands/perfect-woocommerce-brands.php':
|
94 |
$brandTaxonomy = 'pwb-brand';
|
95 |
break;
|
96 |
+
case 'brands-for-woocommerce/woocommerce-brand.php':
|
97 |
+
$brandTaxonomy = 'berocket_brand';
|
98 |
+
break;
|
99 |
+
case 'wpbingo/wpbingo.php':
|
100 |
+
$brandTaxonomy = 'product_brand';
|
101 |
+
break;
|
102 |
}
|
103 |
}
|
104 |
|
119 |
'yith-woocommerce-brands-add-on-premium/init.php',
|
120 |
'perfect-woocommerce-brands/main.php',
|
121 |
'perfect-woocommerce-brands/perfect-woocommerce-brands.php',
|
122 |
+
'martfury-addons/martfury-addons.php',
|
123 |
+
'brands-for-woocommerce/woocommerce-brand.php',
|
124 |
+
'wpbingo/wpbingo.php',
|
125 |
);
|
126 |
}
|
127 |
|
131 |
* @return bool
|
132 |
*/
|
133 |
public function hasBrands() {
|
134 |
+
return apply_filters( 'dgwt/wcas/brands/has_brands', ! empty( $this->pluginInfo ) );
|
135 |
}
|
136 |
|
137 |
/**
|
170 |
if ( $this->hasBrands() ) {
|
171 |
add_filter( 'dgwt/wcas/settings/section=search', function ( $settingsScope ) {
|
172 |
|
173 |
+
$desc = '';
|
174 |
+
|
175 |
+
$pluginName = $this->getPluginName();
|
176 |
+
|
177 |
+
if(!empty($pluginName)){
|
178 |
+
$pluginInfo = $pluginName . ' v' . $this->getPluginVersion();
|
179 |
+
$desc = sprintf( __( 'based on the plugin %s', 'ajax-search-for-woocommerce' ), $pluginInfo );
|
180 |
+
}
|
181 |
|
182 |
$settingsScope[220] = array(
|
183 |
'name' => 'search_in_brands',
|
185 |
'class' => 'dgwt-wcas-premium-only',
|
186 |
'type' => 'checkbox',
|
187 |
'default' => 'off',
|
188 |
+
'desc' => $desc
|
189 |
);
|
190 |
|
191 |
return $settingsScope;
|
193 |
|
194 |
add_filter( 'dgwt/wcas/settings/section=autocomplete', function ( $settingsScope ) {
|
195 |
|
196 |
+
$desc = '';
|
197 |
+
|
198 |
+
$pluginName = $this->getPluginName();
|
199 |
+
|
200 |
+
if(!empty($pluginName)){
|
201 |
+
$pluginInfo = $pluginName . ' v' . $this->getPluginVersion();
|
202 |
+
$desc = sprintf( __( 'based on the plugin %s', 'ajax-search-for-woocommerce' ), $pluginInfo );
|
203 |
+
}
|
204 |
|
205 |
$settingsScope[1260] = array(
|
206 |
'name' => 'show_matching_brands',
|
208 |
'class' => 'dgwt-wcas-premium-only',
|
209 |
'type' => 'checkbox',
|
210 |
'default' => 'off',
|
211 |
+
'desc' => $desc
|
212 |
);
|
213 |
|
214 |
return $settingsScope;
|
includes/Integrations/Plugins/FacetWP/FacetWP.php
CHANGED
@@ -3,6 +3,10 @@
|
|
3 |
namespace DgoraWcas\Integrations\Plugins\FacetWP;
|
4 |
|
5 |
use DgoraWcas\Helpers ;
|
|
|
|
|
|
|
|
|
6 |
/**
|
7 |
* Integration with FacetWP
|
8 |
*
|
3 |
namespace DgoraWcas\Integrations\Plugins\FacetWP;
|
4 |
|
5 |
use DgoraWcas\Helpers ;
|
6 |
+
// Exit if accessed directly
|
7 |
+
if ( !defined( 'ABSPATH' ) ) {
|
8 |
+
exit;
|
9 |
+
}
|
10 |
/**
|
11 |
* Integration with FacetWP
|
12 |
*
|
includes/Integrations/Plugins/JetSmartFilters/JetSmartFilters.php
CHANGED
@@ -3,6 +3,10 @@
|
|
3 |
namespace DgoraWcas\Integrations\Plugins\JetSmartFilters;
|
4 |
|
5 |
use DgoraWcas\Helpers ;
|
|
|
|
|
|
|
|
|
6 |
/**
|
7 |
* Integration with JetSmartFilters
|
8 |
*
|
3 |
namespace DgoraWcas\Integrations\Plugins\JetSmartFilters;
|
4 |
|
5 |
use DgoraWcas\Helpers ;
|
6 |
+
// Exit if accessed directly
|
7 |
+
if ( !defined( 'ABSPATH' ) ) {
|
8 |
+
exit;
|
9 |
+
}
|
10 |
/**
|
11 |
* Integration with JetSmartFilters
|
12 |
*
|
includes/Integrations/Plugins/PluginsCompatibility.php
CHANGED
@@ -2,6 +2,11 @@
|
|
2 |
|
3 |
namespace DgoraWcas\Integrations\Plugins;
|
4 |
|
|
|
|
|
|
|
|
|
|
|
5 |
class PluginsCompatibility {
|
6 |
|
7 |
public function __construct() {
|
2 |
|
3 |
namespace DgoraWcas\Integrations\Plugins;
|
4 |
|
5 |
+
// Exit if accessed directly
|
6 |
+
if ( ! defined( 'ABSPATH' ) ) {
|
7 |
+
exit;
|
8 |
+
}
|
9 |
+
|
10 |
class PluginsCompatibility {
|
11 |
|
12 |
public function __construct() {
|
includes/Integrations/Plugins/WooCommerceProductTable/WooCommerceProductTable.php
CHANGED
@@ -4,6 +4,11 @@ namespace DgoraWcas\Integrations\Plugins\WooCommerceProductTable;
|
|
4 |
|
5 |
use \DgoraWcas\Helpers;
|
6 |
|
|
|
|
|
|
|
|
|
|
|
7 |
/**
|
8 |
* Integration with WooCommerce Product Table
|
9 |
*
|
@@ -31,7 +36,7 @@ class WooCommerceProductTable {
|
|
31 |
if ( ! Helpers::isProductSearchPage() ) {
|
32 |
return;
|
33 |
}
|
34 |
-
if ( ! Helpers::is_running_inside_class( 'WC_Product_Table_Query' ) ) {
|
35 |
return;
|
36 |
}
|
37 |
$post_ids = apply_filters( 'dgwt/wcas/search_page/result_post_ids', array() );
|
4 |
|
5 |
use \DgoraWcas\Helpers;
|
6 |
|
7 |
+
// Exit if accessed directly
|
8 |
+
if ( ! defined( 'ABSPATH' ) ) {
|
9 |
+
exit;
|
10 |
+
}
|
11 |
+
|
12 |
/**
|
13 |
* Integration with WooCommerce Product Table
|
14 |
*
|
36 |
if ( ! Helpers::isProductSearchPage() ) {
|
37 |
return;
|
38 |
}
|
39 |
+
if ( ! Helpers::is_running_inside_class( 'Barn2\Plugin\WC_Product_Table\Table_Query', 10 ) && ! Helpers::is_running_inside_class( 'WC_Product_Table_Query' ) ) {
|
40 |
return;
|
41 |
}
|
42 |
$post_ids = apply_filters( 'dgwt/wcas/search_page/result_post_ids', array() );
|
includes/Integrations/Plugins/WooCommerceProductsVisibility/Filters.php
DELETED
@@ -1,57 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
namespace DgoraWcas\Integrations\Plugins\WooCommerceProductsVisibility;
|
4 |
-
|
5 |
-
use DgoraWcas\Engines\TNTSearchMySQL\Config;
|
6 |
-
|
7 |
-
class Filters {
|
8 |
-
public $plugin_names = array(
|
9 |
-
'woocommerce-products-visibility/woocommerce-products-visibility.php',
|
10 |
-
'woocommerce-visibility/woocommerce-visibility.php' // since v4.x
|
11 |
-
);
|
12 |
-
|
13 |
-
private $visible_products = array();
|
14 |
-
|
15 |
-
public function init() {
|
16 |
-
|
17 |
-
foreach ( $this->plugin_names as $plugin_name ) {
|
18 |
-
|
19 |
-
if ( Config::isPluginActive( $plugin_name ) ) {
|
20 |
-
|
21 |
-
$this->setVisibleProducts();
|
22 |
-
$this->excludeHidenProducts();
|
23 |
-
|
24 |
-
break;
|
25 |
-
}
|
26 |
-
|
27 |
-
}
|
28 |
-
}
|
29 |
-
|
30 |
-
/**
|
31 |
-
* Set visible products from PHP Session
|
32 |
-
*
|
33 |
-
* @return void
|
34 |
-
*/
|
35 |
-
private function setVisibleProducts() {
|
36 |
-
if ( ! session_id() ) {
|
37 |
-
session_start();
|
38 |
-
}
|
39 |
-
|
40 |
-
if ( ! empty( $_SESSION['dgwt-wcas-wcpv-visible-products'] ) ) {
|
41 |
-
$this->visible_products = $_SESSION['dgwt-wcas-wcpv-visible-products'];
|
42 |
-
}
|
43 |
-
}
|
44 |
-
|
45 |
-
/**
|
46 |
-
* Include only products returned by Products Visibility plugin
|
47 |
-
*/
|
48 |
-
private function excludeHidenProducts() {
|
49 |
-
add_filter( 'dgwt/wcas/tnt/search_results/ids', function ( $ids ) {
|
50 |
-
if ( !empty($this->visible_products) && is_array( $this->visible_products ) ) {
|
51 |
-
$ids = array_intersect( $ids, $this->visible_products );
|
52 |
-
}
|
53 |
-
|
54 |
-
return $ids;
|
55 |
-
} );
|
56 |
-
}
|
57 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
includes/Integrations/Plugins/WooCommerceProductsVisibility/WooCommerceProductsVisibility.php
DELETED
@@ -1,40 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
namespace DgoraWcas\Integrations\Plugins\WooCommerceProductsVisibility;
|
4 |
-
|
5 |
-
/**
|
6 |
-
* Integration with WooCommerce Products Visibility
|
7 |
-
*
|
8 |
-
* Plugin URL: https://themeforest.net/user/codemine
|
9 |
-
* Author: codemine
|
10 |
-
*/
|
11 |
-
class WooCommerceProductsVisibility {
|
12 |
-
public function init() {
|
13 |
-
/**
|
14 |
-
* This plugin is hooked on plugins_loaded action with priority 100000, so we need
|
15 |
-
* wait for it, and try to load this integration in next hook.
|
16 |
-
*/
|
17 |
-
add_action( 'sanitize_comment_cookies', array( $this, 'late_init' ) );
|
18 |
-
}
|
19 |
-
|
20 |
-
public function late_init() {
|
21 |
-
if ( ! class_exists( 'WCPV_FRONTEND' ) ) {
|
22 |
-
return;
|
23 |
-
}
|
24 |
-
|
25 |
-
add_action( 'init', array( $this, 'store_in_session_included_products' ), 20 );
|
26 |
-
}
|
27 |
-
|
28 |
-
/**
|
29 |
-
* Store visible product ids in session
|
30 |
-
*/
|
31 |
-
public function store_in_session_included_products() {
|
32 |
-
$wcpv_frontend = \WCPV_FRONTEND::get_instance();
|
33 |
-
if ( ! empty( $wcpv_frontend->include_products ) ) {
|
34 |
-
if ( ! session_id() ) {
|
35 |
-
session_start();
|
36 |
-
}
|
37 |
-
$_SESSION['dgwt-wcas-wcpv-visible-products'] = $wcpv_frontend->include_products;
|
38 |
-
}
|
39 |
-
}
|
40 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
includes/Integrations/Plugins/WooCommerceWholeSalePricesIntegration/Filters.php
DELETED
@@ -1,56 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
namespace DgoraWcas\Integrations\Plugins\WooCommerceWholeSalePricesIntegration;
|
4 |
-
|
5 |
-
use DgoraWcas\Engines\TNTSearchMySQL\Config;
|
6 |
-
|
7 |
-
class Filters {
|
8 |
-
public $plugin_names = array(
|
9 |
-
'woocommerce-wholesale-prices-premium/woocommerce-wholesale-prices-premium.bootstrap.php',
|
10 |
-
);
|
11 |
-
|
12 |
-
private $visible_products = array();
|
13 |
-
|
14 |
-
public function init() {
|
15 |
-
|
16 |
-
foreach ( $this->plugin_names as $plugin_name ) {
|
17 |
-
|
18 |
-
if ( Config::isPluginActive( $plugin_name ) ) {
|
19 |
-
|
20 |
-
$this->setVisibleProducts();
|
21 |
-
$this->excludeHidenProducts();
|
22 |
-
|
23 |
-
break;
|
24 |
-
}
|
25 |
-
|
26 |
-
}
|
27 |
-
}
|
28 |
-
|
29 |
-
/**
|
30 |
-
* Set visible products from PHP Session
|
31 |
-
*
|
32 |
-
* @return void
|
33 |
-
*/
|
34 |
-
private function setVisibleProducts() {
|
35 |
-
if ( ! session_id() ) {
|
36 |
-
session_start();
|
37 |
-
}
|
38 |
-
|
39 |
-
if ( ! empty( $_SESSION['dgwt-wcas-wcwsp-visible-products'] ) ) {
|
40 |
-
$this->visible_products = $_SESSION['dgwt-wcas-wcwsp-visible-products'];
|
41 |
-
}
|
42 |
-
}
|
43 |
-
|
44 |
-
/**
|
45 |
-
* Include only products returned by WooCommerce Wholesale Prices plugin
|
46 |
-
*/
|
47 |
-
private function excludeHidenProducts() {
|
48 |
-
add_filter( 'dgwt/wcas/tnt/search_results/ids', function ( $ids ) {
|
49 |
-
if ( ! empty( $this->visible_products ) && is_array( $this->visible_products ) ) {
|
50 |
-
$ids = array_intersect( $ids, $this->visible_products );
|
51 |
-
}
|
52 |
-
|
53 |
-
return $ids;
|
54 |
-
} );
|
55 |
-
}
|
56 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
includes/Integrations/Plugins/WooCommerceWholeSalePricesIntegration/WooCommerceWholeSalePricesIntegration.php
DELETED
@@ -1,56 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
namespace DgoraWcas\Integrations\Plugins\WooCommerceWholeSalePricesIntegration;
|
4 |
-
|
5 |
-
/**
|
6 |
-
* Integration with WooCommerce Wholesale Prices
|
7 |
-
*
|
8 |
-
* Plugin URL: https://wholesalesuiteplugin.com
|
9 |
-
* Author: Rymera Web Co
|
10 |
-
*/
|
11 |
-
class WooCommerceWholeSalePricesIntegration {
|
12 |
-
public function init() {
|
13 |
-
if ( ! class_exists( 'WooCommerceWholeSalePricesPremium' ) ) {
|
14 |
-
return;
|
15 |
-
}
|
16 |
-
if ( version_compare( \WooCommerceWholeSalePricesPremium::VERSION, '1.24.4' ) < 0 ) {
|
17 |
-
return;
|
18 |
-
}
|
19 |
-
|
20 |
-
add_filter( 'dgwt/wcas/tnt/search_results/ids', array( $this, 'filter_search_results' ) );
|
21 |
-
}
|
22 |
-
|
23 |
-
/**
|
24 |
-
* Store visible product ids in session and filter search result
|
25 |
-
*/
|
26 |
-
public function filter_search_results( $post_ids ) {
|
27 |
-
global $wc_wholesale_prices_premium;
|
28 |
-
|
29 |
-
if ( ! current_user_can( 'manage_options' ) ) {
|
30 |
-
$args = array(
|
31 |
-
'post_type' => 'product',
|
32 |
-
'post_status' => 'publish',
|
33 |
-
'posts_per_page' => - 1,
|
34 |
-
'fields' => 'ids',
|
35 |
-
);
|
36 |
-
$args = $wc_wholesale_prices_premium->wwpp_query->pre_get_posts_arg( $args );
|
37 |
-
// IDs of visible products
|
38 |
-
$visible_products = isset( $args['post__in'] ) ? $args['post__in'] : array();
|
39 |
-
// Filtering found products for their visibility
|
40 |
-
$post_ids = array_intersect( $post_ids, $visible_products );
|
41 |
-
|
42 |
-
if ( ! session_id() ) {
|
43 |
-
session_start();
|
44 |
-
}
|
45 |
-
|
46 |
-
if (
|
47 |
-
! isset( $_SESSION['dgwt-wcas-wcwsp-visible-products'] ) ||
|
48 |
-
( isset( $_SESSION['dgwt-wcas-wcwsp-visible-products'] ) && $_SESSION['dgwt-wcas-wcwsp-visible-products'] !== $visible_products )
|
49 |
-
) {
|
50 |
-
$_SESSION['dgwt-wcas-wcwsp-visible-products'] = $visible_products;
|
51 |
-
}
|
52 |
-
}
|
53 |
-
|
54 |
-
return $post_ids;
|
55 |
-
}
|
56 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
includes/Integrations/Plugins/WooProductFilter/WooProductFilter.php
CHANGED
@@ -3,6 +3,10 @@
|
|
3 |
namespace DgoraWcas\Integrations\Plugins\WooProductFilter;
|
4 |
|
5 |
use DgoraWcas\Helpers ;
|
|
|
|
|
|
|
|
|
6 |
/**
|
7 |
* Integration with Woo Product Filter
|
8 |
*
|
3 |
namespace DgoraWcas\Integrations\Plugins\WooProductFilter;
|
4 |
|
5 |
use DgoraWcas\Helpers ;
|
6 |
+
// Exit if accessed directly
|
7 |
+
if ( !defined( 'ABSPATH' ) ) {
|
8 |
+
exit;
|
9 |
+
}
|
10 |
/**
|
11 |
* Integration with Woo Product Filter
|
12 |
*
|
includes/Integrations/Plugins/XforWooCommerceFilter/XforWooCommerceFilter.php
CHANGED
@@ -3,6 +3,10 @@
|
|
3 |
namespace DgoraWcas\Integrations\Plugins\XforWooCommerceFilter;
|
4 |
|
5 |
use DgoraWcas\Helpers ;
|
|
|
|
|
|
|
|
|
6 |
/**
|
7 |
* Integration with Product Filter for WooCommerce
|
8 |
*
|
3 |
namespace DgoraWcas\Integrations\Plugins\XforWooCommerceFilter;
|
4 |
|
5 |
use DgoraWcas\Helpers ;
|
6 |
+
// Exit if accessed directly
|
7 |
+
if ( !defined( 'ABSPATH' ) ) {
|
8 |
+
exit;
|
9 |
+
}
|
10 |
/**
|
11 |
* Integration with Product Filter for WooCommerce
|
12 |
*
|
includes/Integrations/Themes/Avada/Avada.php
CHANGED
@@ -109,6 +109,20 @@ class Avada {
|
|
109 |
add_filter( 'wp_nav_menu_items', array( $this, 'addSearchToMainNav' ), 20, 2 );
|
110 |
} );
|
111 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
112 |
|
113 |
}
|
114 |
}
|
@@ -175,14 +189,20 @@ class Avada {
|
|
175 |
font-size: 15px;
|
176 |
line-height: 40px;
|
177 |
}
|
|
|
178 |
.fusion-header-v4 .fusion-main-menu {
|
179 |
overflow: visible;
|
180 |
}
|
181 |
|
|
|
|
|
|
|
|
|
182 |
html:not(.dgwt-wcas-overlay-mobile-on) .fusion-header-v4 .fusion-main-menu .dgwt-wcas-search-wrapp.dgwt-wcas-layout-icon .dgwt-wcas-search-form {
|
183 |
top: 100%;
|
184 |
}
|
185 |
-
|
|
|
186 |
top: calc(100% + -4px);
|
187 |
}
|
188 |
|
@@ -270,6 +290,25 @@ class Avada {
|
|
270 |
});
|
271 |
}
|
272 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
273 |
|
274 |
$(document).on('click', '.fusion-icon-search', function () {
|
275 |
|
109 |
add_filter( 'wp_nav_menu_items', array( $this, 'addSearchToMainNav' ), 20, 2 );
|
110 |
} );
|
111 |
|
112 |
+
// Fusion search
|
113 |
+
add_filter( 'search_form_after_fields', function ( $args ) {
|
114 |
+
|
115 |
+
add_action( 'wp_footer', function () {
|
116 |
+
echo '<div class="dgwt-wcas-avada-fus-search-replace-wrapper">';
|
117 |
+
echo do_shortcode( '[wcas-search-form]' );
|
118 |
+
echo '</div>';
|
119 |
+
} );
|
120 |
+
|
121 |
+
|
122 |
+
$args['after_fields'] = '<div class="dgwt-wcas-avada-fus-search-replace"></div>';
|
123 |
+
|
124 |
+
return $args;
|
125 |
+
} );
|
126 |
|
127 |
}
|
128 |
}
|
189 |
font-size: 15px;
|
190 |
line-height: 40px;
|
191 |
}
|
192 |
+
|
193 |
.fusion-header-v4 .fusion-main-menu {
|
194 |
overflow: visible;
|
195 |
}
|
196 |
|
197 |
+
.fusion-search-form {
|
198 |
+
display: none;
|
199 |
+
}
|
200 |
+
|
201 |
html:not(.dgwt-wcas-overlay-mobile-on) .fusion-header-v4 .fusion-main-menu .dgwt-wcas-search-wrapp.dgwt-wcas-layout-icon .dgwt-wcas-search-form {
|
202 |
top: 100%;
|
203 |
}
|
204 |
+
|
205 |
+
.fusion-header-v4 .fusion-main-menu .dgwt-wcas-layout-icon-open .dgwt-wcas-search-icon-arrow {
|
206 |
top: calc(100% + -4px);
|
207 |
}
|
208 |
|
290 |
});
|
291 |
}
|
292 |
|
293 |
+
// Fusion search
|
294 |
+
var $fusionSearchForm = $('.fusion-search-form');
|
295 |
+
if ($fusionSearchForm.length) {
|
296 |
+
$(this).remove();
|
297 |
+
}
|
298 |
+
|
299 |
+
var $placeholders = $('.dgwt-wcas-avada-fus-search-replace')
|
300 |
+
var $barsToReplace = $('.dgwt-wcas-avada-fus-search-replace-wrapper .dgwt-wcas-search-wrapp')
|
301 |
+
if ($placeholders.length && $barsToReplace.length) {
|
302 |
+
$placeholders.each(function (i) {
|
303 |
+
var $parentForm = $(this).closest('form');
|
304 |
+
$parentForm.after($(this));
|
305 |
+
$parentForm.remove();
|
306 |
+
});
|
307 |
+
|
308 |
+
$placeholders.each(function (i) {
|
309 |
+
$(this).append($($barsToReplace[i]));
|
310 |
+
});
|
311 |
+
}
|
312 |
|
313 |
$(document).on('click', '.fusion-icon-search', function () {
|
314 |
|
includes/Integrations/Themes/BigCart/BigCart.php
ADDED
@@ -0,0 +1,20 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
namespace DgoraWcas\Integrations\Themes\BigCart;
|
4 |
+
|
5 |
+
use DgoraWcas\Abstracts\ThemeIntegration;
|
6 |
+
|
7 |
+
// Exit if accessed directly
|
8 |
+
if ( ! defined( 'ABSPATH' ) ) {
|
9 |
+
exit;
|
10 |
+
}
|
11 |
+
|
12 |
+
class BigCart extends ThemeIntegration {
|
13 |
+
|
14 |
+
public function __construct() {
|
15 |
+
$this->themeSlug = 'bigcart';
|
16 |
+
$this->themeName = 'BigCart';
|
17 |
+
|
18 |
+
parent::__construct();
|
19 |
+
}
|
20 |
+
}
|
includes/Integrations/Themes/CiyaShop/CiyaShop.php
ADDED
@@ -0,0 +1,20 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
namespace DgoraWcas\Integrations\Themes\CiyaShop;
|
4 |
+
|
5 |
+
use DgoraWcas\Abstracts\ThemeIntegration;
|
6 |
+
|
7 |
+
// Exit if accessed directly
|
8 |
+
if ( ! defined( 'ABSPATH' ) ) {
|
9 |
+
exit;
|
10 |
+
}
|
11 |
+
|
12 |
+
class CiyaShop extends ThemeIntegration {
|
13 |
+
|
14 |
+
public function __construct() {
|
15 |
+
$this->themeSlug = 'ciyashop';
|
16 |
+
$this->themeName = 'CiyaShop';
|
17 |
+
|
18 |
+
parent::__construct();
|
19 |
+
}
|
20 |
+
}
|
includes/Integrations/Themes/Divi/Divi.php
CHANGED
@@ -19,6 +19,24 @@ class Divi {
|
|
19 |
$this->maybeOverwriteSearch();
|
20 |
|
21 |
add_filter( 'dgwt/wcas/settings', array( $this, 'registerSettings' ) );
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
22 |
}
|
23 |
|
24 |
/**
|
19 |
$this->maybeOverwriteSearch();
|
20 |
|
21 |
add_filter( 'dgwt/wcas/settings', array( $this, 'registerSettings' ) );
|
22 |
+
|
23 |
+
add_filter( 'et_builder_load_requests', array( $this, 'loadDiviInAjaxRequests' ) );
|
24 |
+
}
|
25 |
+
|
26 |
+
/**
|
27 |
+
* Force to load Divi builder during AJAX queries for objects details
|
28 |
+
*
|
29 |
+
* @param array $requests
|
30 |
+
*
|
31 |
+
* @return array
|
32 |
+
*/
|
33 |
+
public function loadDiviInAjaxRequests( $requests ) {
|
34 |
+
if ( ! isset( $requests['wc-ajax'] ) ) {
|
35 |
+
$requests['wc-ajax'] = array();
|
36 |
+
}
|
37 |
+
$requests['wc-ajax'][] = 'dgwt_wcas_result_details';
|
38 |
+
|
39 |
+
return $requests;
|
40 |
}
|
41 |
|
42 |
/**
|
includes/Integrations/Themes/OpenShop/OpenShop.php
ADDED
@@ -0,0 +1,20 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
namespace DgoraWcas\Integrations\Themes\OpenShop;
|
4 |
+
|
5 |
+
use DgoraWcas\Abstracts\ThemeIntegration;
|
6 |
+
|
7 |
+
// Exit if accessed directly
|
8 |
+
if ( ! defined( 'ABSPATH' ) ) {
|
9 |
+
exit;
|
10 |
+
}
|
11 |
+
|
12 |
+
class OpenShop extends ThemeIntegration {
|
13 |
+
|
14 |
+
public function __construct() {
|
15 |
+
$this->themeSlug = 'open-shop';
|
16 |
+
$this->themeName = 'Open Shop';
|
17 |
+
|
18 |
+
parent::__construct();
|
19 |
+
}
|
20 |
+
}
|
includes/Integrations/Themes/ThemesCompatibility.php
CHANGED
@@ -148,6 +148,18 @@ class ThemesCompatibility {
|
|
148 |
'slug' => 'supro',
|
149 |
'name' => 'Supro',
|
150 |
),
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
151 |
);
|
152 |
}
|
153 |
|
148 |
'slug' => 'supro',
|
149 |
'name' => 'Supro',
|
150 |
),
|
151 |
+
'open-shop' => array(
|
152 |
+
'slug' => 'open-shop',
|
153 |
+
'name' => 'OpenShop',
|
154 |
+
),
|
155 |
+
'ciyashop' => array(
|
156 |
+
'slug' => 'ciyashop',
|
157 |
+
'name' => 'CiyaShop',
|
158 |
+
),
|
159 |
+
'bigcart' => array(
|
160 |
+
'slug' => 'bigcart',
|
161 |
+
'name' => 'BigCart',
|
162 |
+
),
|
163 |
);
|
164 |
}
|
165 |
|
includes/Multilingual.php
CHANGED
@@ -69,14 +69,15 @@ class Multilingual {
|
|
69 |
}
|
70 |
|
71 |
/**
|
72 |
-
* Check if language code has
|
|
|
73 |
*
|
74 |
* @param $lang
|
75 |
*
|
76 |
* @return bool
|
77 |
*/
|
78 |
public static function isLangCode( $lang ) {
|
79 |
-
return (bool) preg_match( '/^[
|
80 |
}
|
81 |
|
82 |
/**
|
@@ -126,7 +127,7 @@ class Multilingual {
|
|
126 |
}
|
127 |
|
128 |
if ( empty( $currentLang ) && ! empty( $_GET['lang'] ) && self::isLangCode( $_GET['lang'] ) ) {
|
129 |
-
$currentLang = $_GET['lang'];
|
130 |
}
|
131 |
|
132 |
return $currentLang;
|
@@ -155,7 +156,7 @@ class Multilingual {
|
|
155 |
AND element_id=%d", sanitize_key( $postType ), $postID );
|
156 |
$query = $wpdb->get_var( $sql );
|
157 |
|
158 |
-
if (
|
159 |
$lang = $query;
|
160 |
}
|
161 |
}
|
@@ -192,7 +193,7 @@ class Multilingual {
|
|
192 |
|
193 |
$query = $wpdb->get_var( $sql );
|
194 |
|
195 |
-
if (
|
196 |
$lang = $query;
|
197 |
}
|
198 |
}
|
@@ -328,6 +329,74 @@ class Multilingual {
|
|
328 |
return $terms;
|
329 |
}
|
330 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
331 |
/**
|
332 |
* Get term in specific language
|
333 |
*
|
69 |
}
|
70 |
|
71 |
/**
|
72 |
+
* Check if language code has one of the following format:
|
73 |
+
* aa, aaa, aa-aa
|
74 |
*
|
75 |
* @param $lang
|
76 |
*
|
77 |
* @return bool
|
78 |
*/
|
79 |
public static function isLangCode( $lang ) {
|
80 |
+
return ! empty( $lang ) && is_string( $lang ) && (bool) preg_match( '/^([a-z]{2,3})$|^([a-z]{2}\-[a-z]{2})$/', $lang );
|
81 |
}
|
82 |
|
83 |
/**
|
127 |
}
|
128 |
|
129 |
if ( empty( $currentLang ) && ! empty( $_GET['lang'] ) && self::isLangCode( $_GET['lang'] ) ) {
|
130 |
+
$currentLang = strtolower($_GET['lang']);
|
131 |
}
|
132 |
|
133 |
return $currentLang;
|
156 |
AND element_id=%d", sanitize_key( $postType ), $postID );
|
157 |
$query = $wpdb->get_var( $sql );
|
158 |
|
159 |
+
if ( self::isLangCode( $query ) ) {
|
160 |
$lang = $query;
|
161 |
}
|
162 |
}
|
193 |
|
194 |
$query = $wpdb->get_var( $sql );
|
195 |
|
196 |
+
if ( self::isLangCode( $query ) ) {
|
197 |
$lang = $query;
|
198 |
}
|
199 |
}
|
329 |
return $terms;
|
330 |
}
|
331 |
|
332 |
+
/**
|
333 |
+
* Get terms in specific language
|
334 |
+
*
|
335 |
+
* @param array $args
|
336 |
+
* @param string $lang
|
337 |
+
*
|
338 |
+
* @return \WP_Term[]
|
339 |
+
*/
|
340 |
+
public static function getTermsInLang( $args = array(), $lang = '' ) {
|
341 |
+
$terms = array();
|
342 |
+
|
343 |
+
if ( empty( $lang ) ) {
|
344 |
+
$lang = self::getDefaultLanguage();
|
345 |
+
}
|
346 |
+
|
347 |
+
if ( self::isWPML() ) {
|
348 |
+
$currentLang = self::getCurrentLanguage();
|
349 |
+
$usedIds = array();
|
350 |
+
|
351 |
+
do_action( 'wpml_switch_language', $lang );
|
352 |
+
$args = wp_parse_args( $args, array(
|
353 |
+
'taxonomy' => '',
|
354 |
+
'hide_empty' => true,
|
355 |
+
'suppress_filters' => false
|
356 |
+
) );
|
357 |
+
$termsInLang = get_terms( apply_filters( 'dgwt/wcas/search/' . $args['taxonomy'] . '/args', $args ) );
|
358 |
+
|
359 |
+
if ( ! empty( $termsInLang ) && is_array( $termsInLang ) ) {
|
360 |
+
foreach ( $termsInLang as $termInLang ) {
|
361 |
+
|
362 |
+
if ( ! in_array( $termInLang->term_id, $usedIds ) ) {
|
363 |
+
$terms[] = $termInLang;
|
364 |
+
$usedIds[] = $termInLang->term_id;
|
365 |
+
}
|
366 |
+
}
|
367 |
+
}
|
368 |
+
|
369 |
+
do_action( 'wpml_switch_language', $currentLang );
|
370 |
+
}
|
371 |
+
|
372 |
+
if ( self::isPolylang() ) {
|
373 |
+
|
374 |
+
$terms = get_terms( array(
|
375 |
+
'taxonomy' => $args['taxonomy'],
|
376 |
+
'hide_empty' => true,
|
377 |
+
'lang' => $lang,
|
378 |
+
) );
|
379 |
+
|
380 |
+
}
|
381 |
+
|
382 |
+
return $terms;
|
383 |
+
}
|
384 |
+
|
385 |
+
public static function searchTerms($taxonomy, $query, $lang = ''){
|
386 |
+
$terms = array();
|
387 |
+
|
388 |
+
if ( empty( $lang ) ) {
|
389 |
+
$lang = self::getDefaultLanguage();
|
390 |
+
}
|
391 |
+
|
392 |
+
$args = array(
|
393 |
+
'taxonomy' => $taxonomy,
|
394 |
+
'hide_empty' => false,
|
395 |
+
'search' => $query,
|
396 |
+
);
|
397 |
+
$terms = get_terms( $args );
|
398 |
+
}
|
399 |
+
|
400 |
/**
|
401 |
* Get term in specific language
|
402 |
*
|
includes/Product.php
CHANGED
@@ -2,9 +2,6 @@
|
|
2 |
|
3 |
namespace DgoraWcas;
|
4 |
|
5 |
-
|
6 |
-
use DgoraWcas\Engines\TNTSearchMySQL\Indexer\Utils;
|
7 |
-
|
8 |
class Product {
|
9 |
protected $productID = 0;
|
10 |
protected $wcProduct = null;
|
2 |
|
3 |
namespace DgoraWcas;
|
4 |
|
|
|
|
|
|
|
5 |
class Product {
|
6 |
protected $productID = 0;
|
7 |
protected $wcProduct = null;
|
includes/Scripts.php
CHANGED
@@ -76,6 +76,8 @@ class Scripts
|
|
76 |
'preloader_icon' => Helpers::getIcon( 'preloader' ),
|
77 |
'custom_params' => (object) apply_filters( 'dgwt/wcas/scripts/custom_params', array() ),
|
78 |
'convert_html' => true,
|
|
|
|
|
79 |
);
|
80 |
if ( Multilingual::isMultilingual() ) {
|
81 |
$localize['current_lang'] = Multilingual::getCurrentLanguage();
|
76 |
'preloader_icon' => Helpers::getIcon( 'preloader' ),
|
77 |
'custom_params' => (object) apply_filters( 'dgwt/wcas/scripts/custom_params', array() ),
|
78 |
'convert_html' => true,
|
79 |
+
'suggestions_wrapper' => apply_filters( 'dgwt/wcas/scripts/suggestions_wrapper', 'body' ),
|
80 |
+
'show_product_vendor' => dgoraAsfwFs()->is_premium() && class_exists( 'DgoraWcas\\Integrations\\Marketplace\\Marketplace' ) && DGWT_WCAS()->marketplace->showProductVendor(),
|
81 |
);
|
82 |
if ( Multilingual::isMultilingual() ) {
|
83 |
$localize['current_lang'] = Multilingual::getCurrentLanguage();
|
includes/Settings.php
CHANGED
@@ -533,6 +533,24 @@ class Settings
|
|
533 |
'type' => 'textarea',
|
534 |
'desc' => __( 'Synonyms should be separated by a comma. Each new synonyms group in the new line. You can use a phrase instead of a single word. <br /> <br />Sample list:<br /> <br /><span class="dgwt-wcas-synonyms-sample">sofa, couch, davenport, divan, settee<br />big, grand, great, large, outsize</span>', 'ajax-search-for-woocommerce' ),
|
535 |
'class' => 'dgwt-wcas-settings-synonyms js-dgwt-wcas-adv-settings dgwt-wcas-premium-only',
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
536 |
),
|
537 |
) ),
|
538 |
'dgwt_wcas_performance' => apply_filters( 'dgwt/wcas/settings/section=performance', array(
|
@@ -587,29 +605,8 @@ class Settings
|
|
587 |
$fuzzinesText2 = __( 'Returns suggestions based on likely relevance even though a search keyword may not exactly match. E.g if you type "ipho<b>m</b>e" you get the same results as for "iphone"', 'ajax-search-for-woocommerce' );
|
588 |
|
589 |
if ( dgoraAsfwFs()->is_premium() ) {
|
590 |
-
$settingsFields['dgwt_wcas_search'][300] = array(
|
591 |
-
'name' => 'search_in_custom_fields',
|
592 |
-
'label' => __( 'Search in custom fields', 'ajax-search-for-woocommerce' ),
|
593 |
-
'type' => 'selectize',
|
594 |
-
'options' => ( Helpers::isSettingsPage() ? Helpers::getSearchableCustomFields() : array() ),
|
595 |
-
'desc' => __( 'Select the custom fields you want to add to the search scope', 'ajax-search-for-woocommerce' ),
|
596 |
-
);
|
597 |
-
$settingsFields['dgwt_wcas_search'][450] = array(
|
598 |
-
'name' => 'fuzziness_enabled',
|
599 |
-
'label' => __( 'Fuzzy matching', 'ajax-search-for-woocommerce' ),
|
600 |
-
'desc' => $fuzzinesText2,
|
601 |
-
'class' => 'dgwt-wcas-premium-only',
|
602 |
-
'type' => 'select',
|
603 |
-
'options' => array(
|
604 |
-
'off' => __( '-- Disabled', 'ajax-search-for-woocommerce' ),
|
605 |
-
'soft' => __( 'Soft', 'ajax-search-for-woocommerce' ),
|
606 |
-
'normal' => __( 'Normal', 'ajax-search-for-woocommerce' ),
|
607 |
-
'hard' => __( 'Hard', 'ajax-search-for-woocommerce' ),
|
608 |
-
),
|
609 |
-
'default' => 'normal',
|
610 |
-
);
|
611 |
-
unset( $settingsFields['dgwt_wcas_performance'][0] );
|
612 |
} else {
|
|
|
613 |
$settingsFields['dgwt_wcas_search'][450] = array(
|
614 |
'name' => 'fuzziness_enabled_demo',
|
615 |
'label' => __( 'Fuzzy matching', 'ajax-search-for-woocommerce' ),
|
@@ -624,19 +621,7 @@ class Settings
|
|
624 |
),
|
625 |
'default' => 'off',
|
626 |
);
|
627 |
-
|
628 |
-
|
629 |
-
|
630 |
-
if ( dgoraAsfwFs()->is_premium() ) {
|
631 |
-
$settingsFields['dgwt_wcas_performance'][11] = array(
|
632 |
-
'name' => 'search_engine_build',
|
633 |
-
'label' => __( 'Index status', 'ajax-search-for-woocommerce' ),
|
634 |
-
'type' => 'desc',
|
635 |
-
'desc' => ( Helpers::isSettingsPage() ? Builder::renderIndexingStatus() : '' ),
|
636 |
-
'class' => 'dgwt-wcas-premium-only wcas-opt-tntsearch',
|
637 |
-
);
|
638 |
-
$settingsFields['dgwt_wcas_performance'][110]['desc'] = Scheduler::nextTaskDescription();
|
639 |
-
} else {
|
640 |
$settingsFields['dgwt_wcas_performance'][11] = array(
|
641 |
'name' => 'search_engine_build',
|
642 |
'label' => __( 'Index status', 'ajax-search-for-woocommerce' ),
|
@@ -710,7 +695,7 @@ class Settings
|
|
710 |
|
711 |
}
|
712 |
|
713 |
-
if (
|
714 |
$value = $default;
|
715 |
}
|
716 |
$value = apply_filters( 'dgwt/wcas/settings/load_value', $value, $option_key );
|
533 |
'type' => 'textarea',
|
534 |
'desc' => __( 'Synonyms should be separated by a comma. Each new synonyms group in the new line. You can use a phrase instead of a single word. <br /> <br />Sample list:<br /> <br /><span class="dgwt-wcas-synonyms-sample">sofa, couch, davenport, divan, settee<br />big, grand, great, large, outsize</span>', 'ajax-search-for-woocommerce' ),
|
535 |
'class' => 'dgwt-wcas-settings-synonyms js-dgwt-wcas-adv-settings dgwt-wcas-premium-only',
|
536 |
+
),
|
537 |
+
600 => array(
|
538 |
+
'name' => 'filter_products_head',
|
539 |
+
'label' => __( 'Exclude products', 'ajax-search-for-woocommerce' ),
|
540 |
+
'type' => 'head',
|
541 |
+
'class' => 'dgwt-wcas-sgs-header js-dgwt-wcas-adv-settings',
|
542 |
+
),
|
543 |
+
650 => array(
|
544 |
+
'name' => 'filter_products_rules',
|
545 |
+
'label' => __( 'Filters', 'ajax-search-for-woocommerce' ) . ' ' . Helpers::createQuestionMark(
|
546 |
+
'filter_products_head',
|
547 |
+
__( 'Exclude from search all products that match conditions', 'ajax-search-for-woocommerce' ),
|
548 |
+
'',
|
549 |
+
'right'
|
550 |
+
),
|
551 |
+
'type' => 'filters_rules_plug',
|
552 |
+
'class' => 'js-dgwt-wcas-adv-settings dgwt-wcas-premium-only',
|
553 |
+
'default' => array(),
|
554 |
),
|
555 |
) ),
|
556 |
'dgwt_wcas_performance' => apply_filters( 'dgwt/wcas/settings/section=performance', array(
|
605 |
$fuzzinesText2 = __( 'Returns suggestions based on likely relevance even though a search keyword may not exactly match. E.g if you type "ipho<b>m</b>e" you get the same results as for "iphone"', 'ajax-search-for-woocommerce' );
|
606 |
|
607 |
if ( dgoraAsfwFs()->is_premium() ) {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
608 |
} else {
|
609 |
+
// Fuzzy search feature preview
|
610 |
$settingsFields['dgwt_wcas_search'][450] = array(
|
611 |
'name' => 'fuzziness_enabled_demo',
|
612 |
'label' => __( 'Fuzzy matching', 'ajax-search-for-woocommerce' ),
|
621 |
),
|
622 |
'default' => 'off',
|
623 |
);
|
624 |
+
// Indexer feature preview
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
625 |
$settingsFields['dgwt_wcas_performance'][11] = array(
|
626 |
'name' => 'search_engine_build',
|
627 |
'label' => __( 'Index status', 'ajax-search-for-woocommerce' ),
|
695 |
|
696 |
}
|
697 |
|
698 |
+
if ( $value === '' && !empty($default) ) {
|
699 |
$value = $default;
|
700 |
}
|
701 |
$value = apply_filters( 'dgwt/wcas/settings/load_value', $value, $option_key );
|
partials/themes/bigcart.php
ADDED
@@ -0,0 +1,67 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
// Exit if accessed directly
|
3 |
+
if ( ! defined( 'DGWT_WCAS_FILE' ) ) {
|
4 |
+
exit;
|
5 |
+
}
|
6 |
+
|
7 |
+
// Change mobile breakpoint
|
8 |
+
add_filter( 'dgwt/wcas/scripts/mobile_breakpoint', function () {
|
9 |
+
return 782;
|
10 |
+
} );
|
11 |
+
|
12 |
+
add_action( 'wp_footer', function () {
|
13 |
+
echo '<div id="wcas-theme-search" style="display: block;">' . do_shortcode( '[wcas-search-form]' ) . '</div>';
|
14 |
+
} );
|
15 |
+
|
16 |
+
add_action( 'wp_footer', function () {
|
17 |
+
?>
|
18 |
+
<script>
|
19 |
+
var wcasThemeSearch = document.querySelector('#bigcart-search-box .woocommerce-product-search');
|
20 |
+
if (wcasThemeSearch !== null) {
|
21 |
+
wcasThemeSearch.replaceWith(document.querySelector('#wcas-theme-search > div'));
|
22 |
+
}
|
23 |
+
document.querySelector('#wcas-theme-search').remove();
|
24 |
+
|
25 |
+
(function ($) {
|
26 |
+
$(window).on('load', function () {
|
27 |
+
$('a.product-search').on('click', function (e) {
|
28 |
+
$('#bigcart-search-box').addClass('dgwt-wcas');
|
29 |
+
setTimeout(function () {
|
30 |
+
var $input = $('#bigcart-search-box .dgwt-wcas-search-input');
|
31 |
+
if ($input.length > 0) {
|
32 |
+
$input.focus();
|
33 |
+
}
|
34 |
+
}, 500);
|
35 |
+
|
36 |
+
if ($(window).width() <= 782) {
|
37 |
+
var $handler = $('#bigcart-search-box .js-dgwt-wcas-enable-mobile-form');
|
38 |
+
if ($handler.length) {
|
39 |
+
$handler[0].click();
|
40 |
+
}
|
41 |
+
}
|
42 |
+
});
|
43 |
+
});
|
44 |
+
}(jQuery));
|
45 |
+
</script>
|
46 |
+
<style>
|
47 |
+
.search-box .dgwt-wcas-search-wrapp {
|
48 |
+
position: absolute;
|
49 |
+
width: 50%;
|
50 |
+
top: 30%;
|
51 |
+
left: 50%;
|
52 |
+
opacity: 1;
|
53 |
+
transform: translate(-50%, -50%);
|
54 |
+
}
|
55 |
+
|
56 |
+
.search-box form {
|
57 |
+
position: relative;
|
58 |
+
padding: 0;
|
59 |
+
width: auto;
|
60 |
+
top: 0;
|
61 |
+
left: 0;
|
62 |
+
opacity: 1 !important;
|
63 |
+
transform: none !important;
|
64 |
+
}
|
65 |
+
</style>
|
66 |
+
<?php
|
67 |
+
} );
|
partials/themes/ciyashop.php
ADDED
@@ -0,0 +1,50 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
// Exit if accessed directly
|
3 |
+
if ( ! defined( 'DGWT_WCAS_FILE' ) ) {
|
4 |
+
exit;
|
5 |
+
}
|
6 |
+
|
7 |
+
add_action( 'wp_footer', function () {
|
8 |
+
echo '<div id="wcas-theme-search" style="display: block;">' . do_shortcode( '[wcas-search-form]' ) . '</div>';
|
9 |
+
} );
|
10 |
+
|
11 |
+
add_action( 'wp_footer', function () {
|
12 |
+
?>
|
13 |
+
<script>
|
14 |
+
var wcasThemeSearch = document.querySelector('#search_popup .search_form-inner');
|
15 |
+
if (wcasThemeSearch !== null) {
|
16 |
+
wcasThemeSearch.replaceWith(document.querySelector('#wcas-theme-search > div'));
|
17 |
+
}
|
18 |
+
document.querySelector('#wcas-theme-search').remove();
|
19 |
+
|
20 |
+
(function ($) {
|
21 |
+
$(document).on('click', '.search-button', function (e) {
|
22 |
+
setTimeout(function () {
|
23 |
+
var $input = $('#search_popup .dgwt-wcas-search-input');
|
24 |
+
if ($input.length > 0) {
|
25 |
+
$input.focus();
|
26 |
+
}
|
27 |
+
}, 500);
|
28 |
+
});
|
29 |
+
$(document).on('click', '.mobile-search-trigger', function (e) {
|
30 |
+
var $handler = $('#search_popup .js-dgwt-wcas-enable-mobile-form');
|
31 |
+
if ($handler.length) {
|
32 |
+
$handler[0].click();
|
33 |
+
}
|
34 |
+
|
35 |
+
setTimeout(function () {
|
36 |
+
var $mobileSearchWrap = $('.mobile-search-wrap');
|
37 |
+
if ($mobileSearchWrap.length) {
|
38 |
+
$mobileSearchWrap.removeClass('active');
|
39 |
+
}
|
40 |
+
}, 500);
|
41 |
+
});
|
42 |
+
}(jQuery));
|
43 |
+
</script>
|
44 |
+
<style>
|
45 |
+
.search_form-wrap {
|
46 |
+
margin-top: -30%;
|
47 |
+
}
|
48 |
+
</style>
|
49 |
+
<?php
|
50 |
+
}, 100 );
|
partials/themes/divi.php
CHANGED
@@ -14,11 +14,17 @@ add_action( 'wp_footer', function () {
|
|
14 |
$(window).on('load', function () {
|
15 |
var body = $('body');
|
16 |
var diviSearch = $('.et-search-form');
|
|
|
17 |
var search = $('#wcas-divi-search > div');
|
18 |
-
if (
|
19 |
return;
|
20 |
}
|
21 |
-
|
|
|
|
|
|
|
|
|
|
|
22 |
diviSearch = $('.et_slide_in_menu_container .et-search-form');
|
23 |
if (diviSearch.eq(0)) {
|
24 |
diviSearch.replaceWith(search);
|
@@ -46,6 +52,31 @@ add_action( 'wp_footer', function () {
|
|
46 |
}
|
47 |
}
|
48 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
49 |
// Open overlay automatically
|
50 |
$('#et_top_search #et_search_icon').on('click', function(){
|
51 |
if($(window).width() <= 980){
|
@@ -55,15 +86,37 @@ add_action( 'wp_footer', function () {
|
|
55 |
}
|
56 |
|
57 |
setTimeout(function () {
|
58 |
-
|
59 |
var $closeBtn = $('.et_close_search_field');
|
60 |
if($closeBtn.length){
|
61 |
-
console.log($closeBtn);
|
62 |
$closeBtn[0].click();
|
63 |
}
|
64 |
}, 1100)
|
65 |
}
|
66 |
});
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
67 |
});
|
68 |
}(jQuery));
|
69 |
</script>
|
@@ -76,6 +129,12 @@ add_action( 'wp_head', function () {
|
|
76 |
#wcas-divi-search {
|
77 |
display: none!important;
|
78 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
79 |
/* Header style: Default, Centered Inline Logo */
|
80 |
.et_header_style_split .et_search_form_container .dgwt-wcas-search-wrapp,
|
81 |
.et_header_style_left .et_search_form_container .dgwt-wcas-search-wrapp {
|
14 |
$(window).on('load', function () {
|
15 |
var body = $('body');
|
16 |
var diviSearch = $('.et-search-form');
|
17 |
+
var diviSearchInMenu = $('.et_pb_menu__search-form');
|
18 |
var search = $('#wcas-divi-search > div');
|
19 |
+
if (diviSearch.length === 0 && diviSearchInMenu.length === 0) {
|
20 |
return;
|
21 |
}
|
22 |
+
// Search in custom header
|
23 |
+
if (body.hasClass('et-tb-has-header')) {
|
24 |
+
if (diviSearchInMenu.length > 0) {
|
25 |
+
diviSearchInMenu.replaceWith(search);
|
26 |
+
}
|
27 |
+
} else if (body.hasClass('et_header_style_slide') || body.hasClass('et_header_style_fullscreen')) {
|
28 |
diviSearch = $('.et_slide_in_menu_container .et-search-form');
|
29 |
if (diviSearch.eq(0)) {
|
30 |
diviSearch.replaceWith(search);
|
52 |
}
|
53 |
}
|
54 |
|
55 |
+
// Prevent to focus input if it isn't empty (theme trigger focus() when user clicks search icon)
|
56 |
+
var $search = $('#main-header .et_search_form_container .dgwt-wcas-search-wrapp');
|
57 |
+
$('#et_top_search').on('mousedown', function () {
|
58 |
+
if ($search.length > 0) {
|
59 |
+
var $input = $search.find('.dgwt-wcas-search-input');
|
60 |
+
if ($input.val().length > 0) {
|
61 |
+
$input.attr('disabled', 'disabled');
|
62 |
+
}
|
63 |
+
}
|
64 |
+
}).on('click', function () {
|
65 |
+
if ($search.length > 0) {
|
66 |
+
var $input = $search.find('.dgwt-wcas-search-input');
|
67 |
+
if ($input.val().length > 0) {
|
68 |
+
setTimeout(function () {
|
69 |
+
$input.removeAttr('disabled');
|
70 |
+
|
71 |
+
if (typeof $input.data('autocomplete') == 'object') {
|
72 |
+
var instance = $input.data('autocomplete');
|
73 |
+
instance.hide();
|
74 |
+
}
|
75 |
+
}, 100);
|
76 |
+
}
|
77 |
+
}
|
78 |
+
});
|
79 |
+
|
80 |
// Open overlay automatically
|
81 |
$('#et_top_search #et_search_icon').on('click', function(){
|
82 |
if($(window).width() <= 980){
|
86 |
}
|
87 |
|
88 |
setTimeout(function () {
|
|
|
89 |
var $closeBtn = $('.et_close_search_field');
|
90 |
if($closeBtn.length){
|
|
|
91 |
$closeBtn[0].click();
|
92 |
}
|
93 |
}, 1100)
|
94 |
}
|
95 |
});
|
96 |
+
|
97 |
+
// Open overlay automatically for search in custom menu
|
98 |
+
$('.et_pb_menu .et_pb_menu__search-button').on('click', function () {
|
99 |
+
if ($(window).width() <= 980) {
|
100 |
+
var $handler = $('.et_pb_menu__search .js-dgwt-wcas-enable-mobile-form');
|
101 |
+
if ($handler.length) {
|
102 |
+
$handler[0].click();
|
103 |
+
}
|
104 |
+
|
105 |
+
setTimeout(function () {
|
106 |
+
var $closeBtn = $('.et_pb_menu__close-search-button');
|
107 |
+
if ($closeBtn.length) {
|
108 |
+
$closeBtn[0].click();
|
109 |
+
}
|
110 |
+
}, 1100)
|
111 |
+
} else {
|
112 |
+
setTimeout(function () {
|
113 |
+
var $input = $('.et_pb_menu__search .dgwt-wcas-search-input');
|
114 |
+
if ($input.length > 0 && $input.val().length === 0) {
|
115 |
+
$input.focus();
|
116 |
+
}
|
117 |
+
}, 500)
|
118 |
+
}
|
119 |
+
});
|
120 |
});
|
121 |
}(jQuery));
|
122 |
</script>
|
129 |
#wcas-divi-search {
|
130 |
display: none!important;
|
131 |
}
|
132 |
+
|
133 |
+
/* Custom header */
|
134 |
+
.et_pb_menu__search .dgwt-wcas-search-wrapp {
|
135 |
+
max-width: none;
|
136 |
+
}
|
137 |
+
|
138 |
/* Header style: Default, Centered Inline Logo */
|
139 |
.et_header_style_split .et_search_form_container .dgwt-wcas-search-wrapp,
|
140 |
.et_header_style_left .et_search_form_container .dgwt-wcas-search-wrapp {
|
partials/themes/open-shop.php
ADDED
@@ -0,0 +1,100 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
// Exit if accessed directly
|
3 |
+
if ( ! defined( 'DGWT_WCAS_FILE' ) ) {
|
4 |
+
exit;
|
5 |
+
}
|
6 |
+
|
7 |
+
add_action( 'wp_footer', function () {
|
8 |
+
echo '<div id="wcas-theme-search" style="display: block;">' . do_shortcode( '[wcas-search-form]' ) . '</div>';
|
9 |
+
?>
|
10 |
+
<script>
|
11 |
+
var wcasThemeSearch = document.querySelector('.below-header #search-box');
|
12 |
+
if (wcasThemeSearch !== null) {
|
13 |
+
wcasThemeSearch.replaceWith(document.querySelector('#wcas-theme-search > div'));
|
14 |
+
}
|
15 |
+
document.querySelector('#wcas-theme-search').remove();
|
16 |
+
</script>
|
17 |
+
<style>
|
18 |
+
.dgwt-wcas-search-wrapp {
|
19 |
+
min-width: 200px;
|
20 |
+
}
|
21 |
+
|
22 |
+
.dgwt-wcas-sf-wrapp input[type=search].dgwt-wcas-search-input {
|
23 |
+
height: 49px;
|
24 |
+
}
|
25 |
+
|
26 |
+
@media (max-width: 1200px) {
|
27 |
+
.dgwt-wcas-search-wrapp {
|
28 |
+
padding-left: 30px;
|
29 |
+
}
|
30 |
+
}
|
31 |
+
|
32 |
+
@media (max-width: 850px) {
|
33 |
+
.dgwt-wcas-search-wrapp {
|
34 |
+
padding-left: 10px;
|
35 |
+
}
|
36 |
+
|
37 |
+
.dgwt-wcas-sf-wrapp input[type=search].dgwt-wcas-search-input {
|
38 |
+
height: 45px;
|
39 |
+
}
|
40 |
+
}
|
41 |
+
|
42 |
+
|
43 |
+
@media (max-width: 768px) {
|
44 |
+
.dgwt-wcas-sf-wrapp input[type=search].dgwt-wcas-search-input {
|
45 |
+
height: 34px;
|
46 |
+
}
|
47 |
+
}
|
48 |
+
|
49 |
+
.dgwt-wcas-overlay-mobile .dgwt-wcas-search-wrapp {
|
50 |
+
padding-left: 0;
|
51 |
+
}
|
52 |
+
</style>
|
53 |
+
<?php
|
54 |
+
if ( get_theme_mod( 'open_shop_sticky_header', false ) === true ) {
|
55 |
+
echo '<div id="wcas-theme-search-sticky" style="display: block;">' . do_shortcode( '[wcas-search-form]' ) . '</div>';
|
56 |
+
?>
|
57 |
+
<script>
|
58 |
+
var wcasThemeSearchInStickyHeader = document.querySelector('.search-wrapper #search-box');
|
59 |
+
if (wcasThemeSearchInStickyHeader !== null) {
|
60 |
+
wcasThemeSearchInStickyHeader.replaceWith(document.querySelector('#wcas-theme-search-sticky > div'));
|
61 |
+
}
|
62 |
+
document.querySelector('#wcas-theme-search-sticky').remove();
|
63 |
+
|
64 |
+
(function ($) {
|
65 |
+
$(window).on('load', function () {
|
66 |
+
$('.prd-search').on('click', function () {
|
67 |
+
// Autofocus
|
68 |
+
if ($(window).width() >= 1024) {
|
69 |
+
setTimeout(function () {
|
70 |
+
var $input = $('.search-wrapper .dgwt-wcas-search-input');
|
71 |
+
if ($input.length > 0) {
|
72 |
+
$input.focus();
|
73 |
+
}
|
74 |
+
}, 500);
|
75 |
+
} else {
|
76 |
+
var $mobile = $('.search-wrapper .js-dgwt-wcas-enable-mobile-form');
|
77 |
+
if ($mobile.length > 0) {
|
78 |
+
$mobile.click();
|
79 |
+
}
|
80 |
+
}
|
81 |
+
});
|
82 |
+
});
|
83 |
+
}(jQuery));
|
84 |
+
</script>
|
85 |
+
<style>
|
86 |
+
.search-close {
|
87 |
+
float: none;
|
88 |
+
margin-bottom: 0;
|
89 |
+
position: absolute;
|
90 |
+
top: calc(50% - 10px);
|
91 |
+
right: -10px;
|
92 |
+
}
|
93 |
+
|
94 |
+
.search-wrapper .dgwt-wcas-search-wrapp {
|
95 |
+
max-width: none;
|
96 |
+
}
|
97 |
+
</style>
|
98 |
+
<?php
|
99 |
+
}
|
100 |
+
} );
|
readme.txt
CHANGED
@@ -1,10 +1,10 @@
|
|
1 |
=== Ajax Search for WooCommerce ===
|
2 |
-
Contributors: damian-gora
|
3 |
Tags: woocommerce search, ajax search, search by sku, product search, woocommerce
|
4 |
Requires at least: 5.0
|
5 |
Tested up to: 5.6
|
6 |
Requires PHP: 5.5
|
7 |
-
Stable tag: 1.8.
|
8 |
License: GPLv2 or later
|
9 |
License URI: http://www.gnu.org/licenses/gpl-2.0.html
|
10 |
|
@@ -140,6 +140,22 @@ You can read more and compare Pro and Free features here: [feature comparison](h
|
|
140 |
|
141 |
== Changelog ==
|
142 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
143 |
= 1.8.1, December 04, 2020 =
|
144 |
* ADD: Support for Rehub theme
|
145 |
* ADD: Support for Supro theme
|
1 |
=== Ajax Search for WooCommerce ===
|
2 |
+
Contributors: damian-gora, matczar
|
3 |
Tags: woocommerce search, ajax search, search by sku, product search, woocommerce
|
4 |
Requires at least: 5.0
|
5 |
Tested up to: 5.6
|
6 |
Requires PHP: 5.5
|
7 |
+
Stable tag: 1.8.2
|
8 |
License: GPLv2 or later
|
9 |
License URI: http://www.gnu.org/licenses/gpl-2.0.html
|
10 |
|
140 |
|
141 |
== Changelog ==
|
142 |
|
143 |
+
= 1.8.2, February 06, 2021 =
|
144 |
+
* ADD: Support for Astra theme
|
145 |
+
* ADD: Support for Avada theme - replacing a fusion search form
|
146 |
+
* ADD: Support for Open Shop theme
|
147 |
+
* ADD: Support for Divi - menu in custom header and hiding search results when opening a search overlay
|
148 |
+
* ADD: Support for CiyaShop theme
|
149 |
+
* ADD: Support for BigCart theme
|
150 |
+
* FIX: Increase the clickable area of the 'back button' in the overlay mobile mode
|
151 |
+
* FIX: Disappearing search bar especially on Firefox
|
152 |
+
* FIX: Hide new aggressive admin notices added by other plugins
|
153 |
+
* FIX: Hide shortcodes in the Details Panel
|
154 |
+
* FIX: Divi theme integration - Prevent to focus input if it isn't empty. Fix case with more search bars in #main-header selector
|
155 |
+
* FIX: Adaptation to the new class name convention of WooCommerce Product Table plugin
|
156 |
+
* FIX: Fixed display of category names and tags in the Details Panel when the name contains an apostrophe
|
157 |
+
|
158 |
+
|
159 |
= 1.8.1, December 04, 2020 =
|
160 |
* ADD: Support for Rehub theme
|
161 |
* ADD: Support for Supro theme
|