|
|
@@ -125,7 +125,7 @@
|
|
125
|
125
|
WpfFrontendPage.prototype.checkForceFilters = (function() {
|
|
126
|
126
|
var forceShowFilter = jQuery('.wpfMainWrapper[data-force="1"]');
|
|
127
|
127
|
if (!forceShowFilter.length) return;
|
|
128
|
|
-
|
|
|
128
|
+
|
|
129
|
129
|
jQuery('.wpfMainWrapper').each(function () {
|
|
130
|
130
|
var wrapper = jQuery(this),
|
|
131
|
131
|
forceShowCurrent = wrapper.attr('data-force');
|
|
|
@@ -137,7 +137,7 @@
|
|
137
|
137
|
}
|
|
138
|
138
|
});
|
|
139
|
139
|
});
|
|
140
|
|
-
|
|
|
140
|
+
|
|
141
|
141
|
WpfFrontendPage.prototype.showFiltersLoader = (function() {
|
|
142
|
142
|
jQuery('.wpfMainWrapper').each(function () {
|
|
143
|
143
|
var wrapper = jQuery(this);
|
|
|
@@ -251,7 +251,7 @@
|
|
251
|
251
|
});
|
|
252
|
252
|
|
|
253
|
253
|
});
|
|
254
|
|
-
|
|
|
254
|
+
|
|
255
|
255
|
WpfFrontendPage.prototype.initDefaultSlider = (function (filter, type) {
|
|
256
|
256
|
var _thisObj = this.$obj,
|
|
257
|
257
|
wrapper = filter.closest('.wpfMainWrapper'),
|
|
|
@@ -260,13 +260,13 @@
|
|
260
|
260
|
minInputId = '#wpfMinPrice',
|
|
261
|
261
|
maxInputId = '#wpfMaxPrice',
|
|
262
|
262
|
triggerName = 'wpfPriceChange';
|
|
263
|
|
-
|
|
|
263
|
+
|
|
264
|
264
|
if (filterType === 'attr') {
|
|
265
|
265
|
minInputId = '#wpfMinAttrNum';
|
|
266
|
266
|
maxInputId = '#wpfMaxAttrNum';
|
|
267
|
267
|
triggerName = 'wpfAttrSliderChange';
|
|
268
|
268
|
}
|
|
269
|
|
-
|
|
|
269
|
+
|
|
270
|
270
|
var minSelector = wrapper.find(minInputId),
|
|
271
|
271
|
maxSelector = wrapper.find(maxInputId),
|
|
272
|
272
|
wpfDataStep = wrapper.find('#wpfDataStep').val()
|
|
|
@@ -285,7 +285,7 @@
|
|
285
|
285
|
|
|
286
|
286
|
var minPriceGetParams = urlParams.min_price ? parseFloat(urlParams.min_price) : valMin,
|
|
287
|
287
|
maxPriceGetParams = urlParams.max_price ? parseFloat(urlParams.max_price) : valMax;
|
|
288
|
|
-
|
|
|
288
|
+
|
|
289
|
289
|
if (filterType === 'attr') {
|
|
290
|
290
|
if (urlParams[getAttr]) {
|
|
291
|
291
|
var idsAnd = urlParams[getAttr].split(','),
|
|
|
@@ -296,7 +296,7 @@
|
|
296
|
296
|
minPriceGetParams = urlParams[getAttr] ? parseFloat(filterTypeValues[0]) : valMin;
|
|
297
|
297
|
maxPriceGetParams = urlParams[getAttr] ? parseFloat(filterTypeValues.pop()) : valMax;
|
|
298
|
298
|
}
|
|
299
|
|
-
|
|
|
299
|
+
|
|
300
|
300
|
var sliderWrapper = filter.find("#wpfSliderRange"),
|
|
301
|
301
|
autoFilteringEnable = (wrapper.find('.wpfFilterButton').length == 0),
|
|
302
|
302
|
skin = filter.attr('data-price-skin');
|
|
|
@@ -355,7 +355,7 @@
|
|
355
|
355
|
}
|
|
356
|
356
|
},1000);
|
|
357
|
357
|
}
|
|
358
|
|
-
|
|
|
358
|
+
|
|
359
|
359
|
}
|
|
360
|
360
|
}
|
|
361
|
361
|
});
|
|
|
@@ -746,7 +746,7 @@
|
|
746
|
746
|
});
|
|
747
|
747
|
|
|
748
|
748
|
});
|
|
749
|
|
-
|
|
|
749
|
+
|
|
750
|
750
|
function applyFilter(_thisObj, $this)
|
|
751
|
751
|
{
|
|
752
|
752
|
_thisObj.setCurrentLocation();
|
|
|
@@ -1091,7 +1091,7 @@
|
|
1091
|
1091
|
'redirect_only_click' : Number($generalSettings['settings']['redirect_only_click']),
|
|
1092
|
1092
|
};
|
|
1093
|
1093
|
$filterSettings['sort_by_title'] = ($generalSettings['settings']['sort_by_title'] != undefined && $generalSettings['settings']['sort_by_title'] == '1' ? true : false);
|
|
1094
|
|
-
|
|
|
1094
|
+
|
|
1095
|
1095
|
// find woocommerce product loop type ( shorcode, loop )
|
|
1096
|
1096
|
var productContainerSelector = _thisObj.fixSelector($filterSettings['product_container_selector'], ''),
|
|
1097
|
1097
|
productContainerElem = (productContainerSelector !== '')
|
|
|
@@ -1307,7 +1307,7 @@
|
|
1307
|
1307
|
}
|
|
1308
|
1308
|
return noWooPage;
|
|
1309
|
1309
|
});
|
|
1310
|
|
-
|
|
|
1310
|
+
|
|
1311
|
1311
|
WpfFrontendPage.prototype.changeLmpButton = (function () {
|
|
1312
|
1312
|
var lmpBtn = jQuery('.br_lmp_button_settings .lmp_button');
|
|
1313
|
1313
|
if (lmpBtn.length) {
|
|
|
@@ -1829,7 +1829,7 @@
|
|
1829
|
1829
|
});
|
|
1830
|
1830
|
WpfFrontendPage.prototype.afterAjaxFiltering = (function($wrapperSettings){
|
|
1831
|
1831
|
var _thisObj = this.$obj;
|
|
1832
|
|
-
|
|
|
1832
|
+
|
|
1833
|
1833
|
//if changed min/max price and we have wpfPrice filter
|
|
1834
|
1834
|
//we need change slider
|
|
1835
|
1835
|
_thisObj.getUrlParamsChangeFiltersValues();
|
|
|
@@ -1856,16 +1856,16 @@
|
|
1856
|
1856
|
}
|
|
1857
|
1857
|
}
|
|
1858
|
1858
|
}
|
|
1859
|
|
-
|
|
|
1859
|
+
|
|
1860
|
1860
|
_thisObj.changeLmpButton();
|
|
1861
|
|
-
|
|
|
1861
|
+
|
|
1862
|
1862
|
// for yith quick view
|
|
1863
|
1863
|
jQuery(document).trigger('yith_wcqv_wcajaxnav_update');
|
|
1864
|
1864
|
|
|
1865
|
1865
|
if (typeof (_thisObj.scrollToProductsPro) == 'function') {
|
|
1866
|
1866
|
_thisObj.scrollToProductsPro($wrapperSettings);
|
|
1867
|
1867
|
}
|
|
1868
|
|
-
|
|
|
1868
|
+
|
|
1869
|
1869
|
if (jQuery(_thisObj.defaultProductSelector).closest('.et_pb_shop').length && jQuery(_thisObj.defaultProductSelector).find('[loading="lazy"]').length == 0) {
|
|
1870
|
1870
|
heightIdenticalInRow('.et_pb_shop li.product');
|
|
1871
|
1871
|
}
|
|
|
@@ -1874,7 +1874,7 @@
|
|
1874
|
1874
|
// event for custom javascript hook, example: document.addEventListener('wpfAjaxSuccess', function(event) {console.log('Custom js');});
|
|
1875
|
1875
|
//document.dispatchEvent(new Event('wpfAjaxSuccess')); - not work in IE11
|
|
1876
|
1876
|
var customEvent = document.createEvent('Event');
|
|
1877
|
|
- customEvent.initEvent('wpfAjaxSuccess', false, true);
|
|
|
1877
|
+ customEvent.initEvent('wpfAjaxSuccess', false, true);
|
|
1878
|
1878
|
document.dispatchEvent(customEvent);
|
|
1879
|
1879
|
});
|
|
1880
|
1880
|
|
|
|
@@ -1902,7 +1902,7 @@
|
|
1902
|
1902
|
|
|
1903
|
1903
|
/*WpfFrontendPage.prototype.runReadyList = (function(){
|
|
1904
|
1904
|
if (window.readyList && window.readyList.length) {
|
|
1905
|
|
-
|
|
|
1905
|
+
|
|
1906
|
1906
|
jQuery(window.readyList).each(function(i, el) {
|
|
1907
|
1907
|
var strFunc = el['a'][0].toString();
|
|
1908
|
1908
|
if (strFunc.indexOf('WpfFrontendPage') == -1 && strFunc.indexOf('.ajaxComplete(') == -1) {
|
|
|
@@ -1973,7 +1973,7 @@
|
|
1973
|
1973
|
var sliderCurAfter = ($filter.attr('data-slider-currency-after') != undefined) ? $filter.attr('data-slider-currency-after') : '';
|
|
1974
|
1974
|
var sliderWrapper = $filter.find('.ion-range-slider').data('ionRangeSlider');
|
|
1975
|
1975
|
$filter.addClass('wpfNotActiveSlider');
|
|
1976
|
|
-
|
|
|
1976
|
+
|
|
1977
|
1977
|
if (sliderCurBefore || sliderCurAfter) {
|
|
1978
|
1978
|
setTimeout(function()
|
|
1979
|
1979
|
{
|
|
|
@@ -2202,7 +2202,7 @@
|
|
2202
|
2202
|
frontendOptions[getParams] = value;
|
|
2203
|
2203
|
selectedOptions['list'][0] = name;
|
|
2204
|
2204
|
}
|
|
2205
|
|
-
|
|
|
2205
|
+
|
|
2206
|
2206
|
optionsArray['backend'] = options;
|
|
2207
|
2207
|
optionsArray['frontend'] = frontendOptions;
|
|
2208
|
2208
|
optionsArray['selected'] = selectedOptions;
|
|
|
@@ -2728,7 +2728,7 @@
|
|
2728
|
2728
|
var obj = {}, p, idx;
|
|
2729
|
2729
|
for (var i=0, n=pairs.length; i < n; i++) {
|
|
2730
|
2730
|
p = pairs[i].split('=');
|
|
2731
|
|
- idx = p[0];
|
|
|
2731
|
+ idx = p[0];
|
|
2732
|
2732
|
if (obj[idx] === undefined) {
|
|
2733
|
2733
|
obj[idx] = unescape(p[1]).replace ( /\+/g, ' ' );
|
|
2734
|
2734
|
}else{
|
|
|
@@ -2792,7 +2792,7 @@
|
|
2792
|
2792
|
});
|
|
2793
|
2793
|
}
|
|
2794
|
2794
|
});
|
|
2795
|
|
-
|
|
|
2795
|
+
|
|
2796
|
2796
|
// plugin event woocommerce-product-search
|
|
2797
|
2797
|
// https://docs.woocommerce.com/documentation/plugins/woocommerce/woocommerce-extensions/woocommerce-product-search/
|
|
2798
|
2798
|
jQuery(document).on('ixProductFilterRequestProcessed', function (event) {
|
|
|
@@ -3156,7 +3156,7 @@ function wpfShowHideFiltersAtts(wpfExistTerms, wpfExistUsers) {
|
|
3156
|
3156
|
isShowAll = Boolean(filter.data('show-all')),
|
|
3157
|
3157
|
isNotInLogic = getAttr.indexOf('pr_filter') == -1 ? false : true,
|
|
3158
|
3158
|
userExistIds = [];
|
|
3159
|
|
-
|
|
|
3159
|
+
|
|
3160
|
3160
|
switch (filterContentType) {
|
|
3161
|
3161
|
case 'user':
|
|
3162
|
3162
|
jQuery.each(wpfExistUsers, function (index, value) {
|
|
|
@@ -3244,14 +3244,14 @@ function wpfChangePriceFiltersCount(prices) {
|
|
3244
|
3244
|
noWooPage = _thisObj.noWoo,
|
|
3245
|
3245
|
filterWrapper = jQuery('.wpfMainWrapper'),
|
|
3246
|
3246
|
priceFilters = jQuery('.wpfFilterWrapper[data-filter-type="wpfPrice"].wpfNotActive');
|
|
3247
|
|
-
|
|
|
3247
|
+
|
|
3248
|
3248
|
jQuery('.wpfFilterWrapper[data-filter-type="wpfPrice"]').each(function () {
|
|
3249
|
3249
|
var wpfPrice = jQuery(this);
|
|
3250
|
3250
|
wpfPrice.attr('data-minvalue', prices.min_price).attr('data-maxvalue', prices.max_price);
|
|
3251
|
|
-
|
|
|
3251
|
+
|
|
3252
|
3252
|
wpfPrice.find('#wpfMinPrice').attr('min', prices.min_price).val(prices.min_price);
|
|
3253
|
3253
|
wpfPrice.find('#wpfMaxPrice').attr('max', prices.max_price).val(prices.max_price);
|
|
3254
|
|
-
|
|
|
3254
|
+
|
|
3255
|
3255
|
if (wpfPrice.find(".ion-range-slider").length) {
|
|
3256
|
3256
|
wpfPrice.find(".ion-range-slider").each(function () {
|
|
3257
|
3257
|
jQuery(this).attr('data-min', prices.min_price).attr('data-max', prices.max_price);
|
|
|
@@ -3296,7 +3296,7 @@ function heightIdenticalInRow(selector) {
|
|
3296
|
3296
|
var elementsHeight = [];
|
|
3297
|
3297
|
var rowIndex = 0;
|
|
3298
|
3298
|
var elementIndex = 0;
|
|
3299
|
|
-
|
|
|
3299
|
+
|
|
3300
|
3300
|
jQuery(selector).each(function (index, element) {
|
|
3301
|
3301
|
if (!elementsHeight[rowIndex]) {
|
|
3302
|
3302
|
elementsHeight[rowIndex] = [];
|
|
|
@@ -3308,7 +3308,7 @@ function heightIdenticalInRow(selector) {
|
|
3308
|
3308
|
&&
|
|
3309
|
3309
|
elementsHeight[rowIndex][elementsHeight[rowIndex].length - 1].top !== jQuery(element).offset().top
|
|
3310
|
3310
|
) {
|
|
3311
|
|
-
|
|
|
3311
|
+
|
|
3312
|
3312
|
setMaxHeight(elementsHeight[rowIndex]);
|
|
3313
|
3313
|
rowIndex++;
|
|
3314
|
3314
|
}
|