This commit is contained in:
2026-09-15 10:35:56 +08:00
commit 782f8ea7aa
4086 changed files with 631288 additions and 0 deletions
@@ -0,0 +1,16 @@
<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd">
<head>
</head>
<body>
<referenceContainer name="before.body.end">
<block
ifconfig="weltpixel_layerednavigation/general/enable"
class="WeltPixel\LayeredNavigation\Block\LayeredNavigationAdd"
name="layerednavigationadd"
template="WeltPixel_LayeredNavigation::layerednavigationadd.phtml"
/>
</referenceContainer>
</body>
</page>
@@ -0,0 +1,50 @@
<?xml version="1.0"?>
<!--
/**
* @category WeltPixel
* @package WeltPixel_LayeredNavigation
* @copyright Copyright (c) 2018 Weltpixel
* @author Weltpixel TEAM
*/
-->
<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd">
<body>
<attribute name="class" value="wp-ln-filter-page"/>
<referenceBlock name="catalog.leftnav">
<action method="setTemplate" ifconfig="weltpixel_layerednavigation/general/enable">
<argument name="template" xsi:type="string">WeltPixel_LayeredNavigation::layer/view.phtml</argument>
</action>
<container name="layer.additional.info" as="layer_additional_info"/>
<container name="layer.content.before" as="layer_content_before"/>
</referenceBlock>
<referenceBlock name="catalog.navigation.renderer">
<action method="setTemplate" ifconfig="weltpixel_layerednavigation/general/enable">
<argument name="template" xsi:type="string">WeltPixel_LayeredNavigation::layer/filter.phtml</argument>
</action>
</referenceBlock>
<referenceContainer name="content">
<block class="Magento\Framework\View\Element\Template" name="layer.category.products" template="WeltPixel_LayeredNavigation::products.phtml" />
</referenceContainer>
<referenceContainer name="columns">
<block
ifconfig="weltpixel_layerednavigation/sidebar/allow_layered_show_hide"
class="Magento\Framework\View\Element\Template"
name="wp-show-hide-desktop-filter"
template="WeltPixel_LayeredNavigation::showhide_desktop_filter.phtml"
before="main"
/>
</referenceContainer>
<move element="category.products" destination="layer.category.products"/>
<referenceContainer name="before.body.end">
<block
ifconfig="weltpixel_layerednavigation/general/enable"
class="WeltPixel\LayeredNavigation\Block\LayeredNavigationAdd"
name="layerednavigationadd"
template="WeltPixel_LayeredNavigation::layerednavigationadd.phtml"
/>
</referenceContainer>
</body>
</page>
@@ -0,0 +1,13 @@
<?xml version="1.0"?>
<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd">
<body>
<attribute name="class" value="weltpixel-horizontalnavigation"/>
<referenceContainer name="before.body.end">
<block
class="Magento\Framework\View\Element\Template"
name="horizontalnavigation.js"
template="WeltPixel_LayeredNavigation::horizontalnavigation.phtml"
/>
</referenceContainer>
</body>
</page>
@@ -0,0 +1,37 @@
<?xml version="1.0"?>
<!--
/**
* @category WeltPixel
* @package WeltPixel_LayeredNavigation
* @copyright Copyright (c) 2018 Weltpixel
* @author Weltpixel TEAM
*/
-->
<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" layout="2columns-left" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd">
<body>
<attribute name="class" value="page-products"/>
<referenceContainer name="sidebar.main">
<block class="WeltPixel\LayeredNavigation\Block\Navigation\Search" name="catalogsearch.leftnav" before="-" template="WeltPixel_LayeredNavigation::layer/view.phtml">
<block class="WeltPixel\LayeredNavigation\Block\Navigation\State" name="catalogsearch.navigation.state" as="state" />
<block class="WeltPixel\LayeredNavigation\Block\Navigation\FilterRenderer" name="catalogsearch.navigation.renderer" as="renderer" template="WeltPixel_LayeredNavigation::layer/filter.phtml"/>
</block>
</referenceContainer>
<referenceContainer name="content">
<block class="Magento\Framework\View\Element\Template" name="wp.layer.search.result" template="WeltPixel_LayeredNavigation::search_products.phtml" />
</referenceContainer>
<move element="search.result" destination="wp.layer.search.result"/>
<referenceContainer name="before.body.end">
<block
ifconfig="weltpixel_layerednavigation/general/enable"
class="WeltPixel\LayeredNavigation\Block\LayeredNavigationAdd"
name="layerednavigationadd"
template="WeltPixel_LayeredNavigation::layerednavigationadd.phtml"
/>
</referenceContainer>
</body>
</page>
@@ -0,0 +1,14 @@
var config = {
map: {
'*': {
wpFilterSelect: 'WeltPixel_LayeredNavigation/js/wpFilterSelect',
wpShowMoreLess: 'WeltPixel_LayeredNavigation/js/wpShowMoreLess',
wpInstantSearch: 'WeltPixel_LayeredNavigation/js/wpInstantSearch',
jqueryTouch: 'WeltPixel_LayeredNavigation/js/jqueryUiTouch'
}
},
shim: {
jqueryTouch: ['jquery', 'jquery-ui-modules/mouse', 'jquery-ui-modules/widget', 'jquery/validate']
}
};
@@ -0,0 +1,17 @@
<script>
require([
"jquery",
], function($){
$(document).ready(function () {
$(document).on('click', '.filter-options-item .filter-options-title', function() {
var that = this;
$('.filter-options-item.active > .filter-options-title').each(function(key, value) {
if (that != value) {
$(value).parent().removeClass('active');
}
});
});
});
});
</script>
@@ -0,0 +1,65 @@
<?php
// @codingStandardsIgnoreFile
?>
<?php $attributeId = $block->getAttributeId()?>
<?php $isMulti = $block->getIsMultiselect()?>
<?php $canShowQty = (is_null($block->getShowQty())) ? $this->helper('\Magento\Catalog\Helper\Data')->shouldDisplayProductCountOnLayer() : $block->getShowQty();?>
<?php $canShowInstantSearch = $block->canShowInstantSearch() ? 'desktop' : ''?>
<?php $canShowInstantSearchMobile = $block->canShowInstantSearchMobile() ? 'mobile' : ''?>
<?php $categoryParamLabel = $block->getCategoryParamLabel()?>
<?php $ratingParamLabel = $block->getRatingParamLabel()?>
<?php
$listItemStyle = 'display: none';
if ($attributeId == \WeltPixel\LayeredNavigation\Helper\Data::RATING_PARAM_LABEL) {
$listItemStyle = '';
}
?>
<div class="wp-instant-search-wrapper <?= $block->escapeHtmlAttr($canShowInstantSearchMobile) ?> <?= $block->escapeHtmlAttr($canShowInstantSearch) ?>">
<input type="text" class="wp-instant-search-inp" id="instant_search_<?= $block->escapeHtmlAttr($attributeId) ?>" data-attr-id="<?= $block->escapeHtmlAttr($attributeId) ?>" placeholder="<?= $block->escapeHtmlAttr(__('Search for options ...')) ?>">
</div>
<ol class="items" id="<?= $block->escapeHtmlAttr($attributeId) ?>_items" >
<?php foreach ($filterItems as $filterItem): ?>
<?php $requestVar = $filterItem->getFilter()->getRequestVar();?>
<?php $filterItemVal = is_array($filterItem->getValue()) ? implode('-', $filterItem->getValue()) : $filterItem->getValue()?>
<?php $idAddOn = $attributeId?>
<?php if($requestVar == $categoryParamLabel):?>
<?php $dataOptPath = $categoryParamLabel.'='.$filterItemVal;?>
<?php elseif($requestVar == $ratingParamLabel):?>
<?php $dataOptPath = $ratingParamLabel.'='.$filterItemVal;?>
<?php $idAddOn = $ratingParamLabel?>
<?php else:?>
<?php $dataOptPath = $filterItem->getFilter()->getAttributeModel()->getAttributeCode().'='. $filterItemVal;?>
<?php endif;?>
<li class="item" style="<?= $block->escapeHtmlAttr($listItemStyle) ?>" id="wp_ln_attr_<?= $block->escapeHtmlAttr($idAddOn) ?>_<?= $block->escapeHtmlAttr(is_array($filterItem->getValue()) ? implode('-', $filterItem->getValue()) : $filterItem->getValue()) ?>">
<?php if ($filterItem->getCount() > 0): $filter = $filterItem->getFilter();?>
<a href="<?= $block->escapeUrl($filterItem->getUrl()) ?>"
data-opt-path="<?= $block->escapeHtmlAttr($dataOptPath) ?>"
data-is-multi="<?= /* @noEscape */ $isMulti ?>">
<?= /* @noEscape */ $filterItem->getLabel() ?>
<?php if ($canShowQty): ?>
<span class="count"><?= /* @noEscape */ $filterItem->getCount() ?><span class="filter-count-label">
<?php if ($filterItem->getCount() == 1):?> <?= /* @noEscape */ __('item') ?><?php else:?> <?= /* @noEscape */ __('items') ?><?php endif;?></span></span>
<?php endif; ?>
</a>
<?php else:?>
<a href="#" class="wp-filter-disabled" disabled="disabled"><?= /* @noEscape */ $filterItem->getLabel() ?></a>
<?php if ($canShowQty): ?>
<span class="count"><?= /* @noEscape */ $filterItem->getCount() ?><span class="filter-count-label">
<?php if ($filterItem->getCount() == 1):?><?= /* @noEscape */ __('item') ?><?php else:?><?= /* @noEscape */ __('items') ?><?php endif;?></span></span>
<?php endif; ?>
<?php endif; ?>
</li>
<?php endforeach ?>
<?php if($requestVar != $ratingParamLabel):?>
<div class="wp-ln-actions" data-visibleItems="<?= /* @noEscape */ (int) $block->getVisibleItems() ?>" data-visibleItemsStep="<?= /* @noEscape */ (int) $block->getVisibleItemsStep() ?>" data-attrId="<?= $block->escapeHtmlAttr($attributeId) ?>">
<b id="showLess_<?= /* @noEscape */ $attributeId?>" class="wp-ln-action wp-ln-show-less icon-line-arrow-up"></b>
<b id="loadMore_<?= /* @noEscape */ $attributeId?>" class="wp-ln-action wp-ln-load-more icon-line-arrow-down"></b>
</div>
<?php endif;?>
</ol>
@@ -0,0 +1,134 @@
<?php $priceData = $this->getPriceConfigData()?>
<?php $priceIsInputType = $this->priceIsInputType()?>
<div id="slider-range"></div>
<div class="wp-slider-inp">
<div class="wp-slider-inp-range">
<?php if($priceIsInputType): ?>
<input type="text" id="amount_from" class="wp-price-slider-inp inp-type" />
<?php else : ?>
<label for="amount"><?= $block->escapeHtml(__('Price:'))?></label>
<div class="price-value-wrapper">
<span class="wp-slider-currency"><?= $block->escapeHtml($priceData['currency']) ?></span>
<span id="amount_from" class="wp-price-slider-inp"></span>
<?php endif;?>
<span class="wp-slider-range-separator">-</span>
<?php if($priceIsInputType): ?>
<input type="text" id="amount_to" class="wp-price-slider-inp inp-type" />
<?php else : ?>
<span class="wp-slider-currency"><?= $block->escapeHtml($priceData['currency']) ?></span>
<span id="amount_to" class="wp-price-slider-inp"></span>
</div>
<?php endif;?>
<a href="<?= $block->escapeUrl($this->getSliderApplyUrl()) ?>" class="wp-price-slider-a" id="wp_ln_price_slider"><?= $block->escapeHtml(__('Apply')) ?></a>
</div>
</div>
<script>
require(['jquery','jquery-ui-modules/effect-slide','jquery-ui-modules/mouse','jquery-ui-modules/widget','<?= $block->escapeJs($block->getSliderJsWidget()) ?>','jqueryTouch'], function($){
$( function() {
var priceIsInputType = <?= $priceIsInputType ? 'true': 'false'?>;
var priceSearchArr = getPriceParam();
var priceSearchMinInp = (priceSearchArr) ? priceSearchArr[0] : <?= /* @noEscape */ $priceData['min']?>;
var priceSearchMaxInp = (priceSearchArr) ? priceSearchArr[1] : <?= /* @noEscape */ $priceData['max']?>;
$("#slider-range").slider({
range: true,
min: <?= /* @noEscape */ $priceData['minX']?>,
max: <?= /* @noEscape */ $priceData['maxX']?>,
step: <?= /* @noEscape */ $priceData['step']?>,
values: [ priceSearchMinInp , priceSearchMaxInp ],
slide: function( event, ui ) {
if(priceIsInputType) {
$("#amount_from").val(ui.values[0]);
$("#amount_to").val(ui.values[1]);
} else {
$("#amount_from").text(ui.values[0]);
$("#amount_to").text(ui.values[1]);
}
var priceParam = 'price=' + ui.values[0] + '-' + ui.values[1],
link = window.location.href,
cleanLink = removeParam('price', removeParam('p', link)),
sliderLink = cleanLink + getSeparator(cleanLink) +priceParam;
$('#wp_ln_price_slider').attr('href', sliderLink);
}
});
if(priceIsInputType) {
$("#amount_from" ).val($( "#slider-range" ).slider( "values", 0 ));
$('#amount_to').val($( "#slider-range" ).slider( "values", 1 ));
} else {
$("#amount_from" ).text($( "#slider-range" ).slider( "values", 0 ));
$('#amount_to').text($( "#slider-range" ).slider( "values", 1 ));
}
$('.wp-price-slider-inp').on('keyup', function() {
var minPrice = (priceIsInputType) ? $("#amount_from" ).val() : $("#amount_from" ).text(),
maxPrice = (priceIsInputType) ? $("#amount_to" ).val() :$("#amount_to" ).text(),
cleanLink = removeParam('price', removeParam('p', window.location.href)),
priceParam = 'price=' + minPrice + '-' + maxPrice,
sliderLink = cleanLink + getSeparator(cleanLink) + priceParam;
$('#wp_ln_price_slider').attr('href', sliderLink);
});
/** get parameter separator from link*/
function getSeparator(link) {
var sep = link.indexOf('?');
if(sep !== -1) {
return '&';
}
return '?';
}
/** remove existing 'price' parameter from url */
function removeParam(key, url) {
if (!url) url = window.location.href;
var hashParts = url.split('#'),
regex = new RegExp("([?&])" + key + "=.*?(&|#|$)", "i");
if (hashParts[0].match(regex)) {
url = hashParts[0].replace(regex, '$1');
url = url.replace(/([?&])$/, '');
if (typeof hashParts[1] !== 'undefined' && hashParts[1] !== null)
url += '#' + hashParts[1];
}
return url;
}
/** get 'price' parameter value from link */
function getPriceParam() {
var priceArr = false;
var params = parseQueryString();
var price = params['price'];
if(price) {
var priceArr = price.split("-");
}
return priceArr;
}
function parseQueryString(){
var str = window.location.search;
var objURL = {};
str.replace(
new RegExp( "([^?=&]+)(=([^&]*))?", "g" ),
function( $0, $1, $2, $3 ){
objURL[ $1 ] = $3;
}
);
return objURL;
}
});
});
</script>
@@ -0,0 +1,65 @@
<?php
// @codingStandardsIgnoreFile
?>
<?php
/**
* Category layered navigation state
*
* @var $block \WeltPixel\LayeredNavigation\Block\Navigation\State
*/
?>
<?php $_filters = $block->getActiveFilters() ?>
<?php $categoryParamLabel = $block->getCategoryParamLabel()?>
<?php $ratingParamLabel = $block->getRatingParamLabel()?>
<?php if (!empty($_filters)): ?>
<div id="wp_ln_shopby" class="filter-current" data-mage-init='{"collapsible":{"openedState": "active", "collapsible": true, "active": true }}'>
<strong class="block-subtitle filter-current-subtitle"
role="heading"
data-role="title"
aria-level="2"
data-count="<?= /* @noEscape */ count($_filters) ?>"><?= $block->escapeHtml(__('Now Shopping by')) ?>
</strong>
<div class="items" id="wp_ln_shopby_items" data-role="content">
<?php foreach ($_filters as $_filter): ?>
<?php
$requestVar = $_filter->getFilter()->getRequestVar();
$filterItemVal = (is_array($_filter->getValue())) ? implode('-', $_filter->getValue()) : $_filter->getValue();
if ($requestVar == $categoryParamLabel) {
$dataAttrId = '0_' . $filterItemVal;
$filterLabel = $block->stripTags($_filter->getLabel());
} elseif ($requestVar == $ratingParamLabel) {
$dataAttrId = $ratingParamLabel . '_' . $filterItemVal;
$filterLabel = $block->getRateFilterLabel($_filter);
} else {
$dataAttrId = $_filter->getFilter()->getAttributeModel()->getAttributeId() . '_' . $filterItemVal;
$filterLabel = $block->stripTags($_filter->getLabel());
}
?>
<li class="item" data-attr-id="<?= $block->escapeHtmlAttr($dataAttrId) ?>">
<span class="filter-label"><?= $block->escapeHtml(__($_filter->getName())) ?></span>
<span class="filter-value"><?= $block->escapeHtml($filterLabel) ?></span>
<?php
$clearLinkUrl = $_filter->getClearLinkUrl();
$currentFilterName = $block->escapeHtml(__($_filter->getName())) . " " . $block->stripTags($_filter->getLabel());
if ($clearLinkUrl):
?>
<a class="action previous" href="<?= $block->escapeUrl($_filter->getRemoveUrl()) ?>"
title="<?= $block->escapeHtmlAttr(__('Previous')) ?>">
<span><?= $block->escapeHtml(__('Previous')) ?></span>
</a>
<a class="action remove"
title="<?= $block->escapeHtmlAttr($_filter->getFilter()->getClearLinkText()) ?>"
href="<?= $block->escapeUrl($clearLinkUrl) ?>">
<span><?= $block->escapeHtml($_filter->getFilter()->getClearLinkText()) ?></span>
</a>
<?php else: ?>
<a class="action remove" href="<?= $block->escapeUrl($_filter->getRemoveUrl()) ?>"
title="<?= $block->escapeHtmlAttr(__('Remove') . ' ' . $currentFilterName) ?>">
<span><?= $block->escapeHtml(__('Remove This Item')) ?></span>
</a>
<?php endif; ?>
</li>
<?php endforeach; ?>
</div>
</div>
<?php endif; ?>
@@ -0,0 +1,279 @@
<?php
/**
* Copyright © Magento, Inc. All rights reserved.
* See COPYING.txt for license details.
*/
// @codingStandardsIgnoreFile
?>
<?php
/**
* Category layered navigation
*
* @var $block WeltPixel\LayeredNavigation\Block\Navigation
*/
$_helper = $this->helper('\WeltPixel\LayeredNavigation\Helper\Data');
$isAjaxMode = $block->isAjaxMode();
$isAutoClose = $block->isAutoClose();
$isAjaxScrollToTopClass = ($block->isAjaxScrollToTop()) ? 'ajax-scroll-top' : '';
$isAutoCloseClass = ($isAutoClose) ? 'auto-close' : 'manual-close';
$jsClass = ($isAjaxMode) ? 'WeltPixel_LayeredNavigation/js/product/list/toolbar' : false;
/* Horizontal Sidebar Design Settings */
$sidebarStyle = $_helper->getSidebarStyle();
$selectedFilters = $_helper->getSelectedFiltersOptions();
$horizontalBoxShadow = $_helper->getHorizontalBoxShadow();
$horizontalSbDesignVersion = ($sidebarStyle === '3' ? $_helper->getHorizontalSidebarDesignVersion() : '');
$filterPosition = ($horizontalSbDesignVersion === 'v2' ? $_helper->getHorizontalSidebarFilterPosition() : '');
$reverseOrderClass = ($horizontalSbDesignVersion === 'v2' ? 'reverse-order' : '');
$horizontalDesignClass = ($horizontalSbDesignVersion === '' ? '' : 'horizontal-' . $horizontalSbDesignVersion);
$filterAlignmentClass = ($horizontalSbDesignVersion === 'v2' ? 'filter-align-' . $filterPosition : '');
$selectedFiltersClass = ($selectedFilters === '1' ? 'show-selected-filters' : 'hide-selected-filters');
$horizontalBoxShadowClass = ($sidebarStyle === '2' && $horizontalBoxShadow === '1' ? '' : 'no-box-shadow');
/* Horizontal Sidebar Design V3 Settings */
$filtersBorder = ($_helper->getHorizontalFiltersBorder() ? $_helper->getHorizontalFiltersBorder() : '');
$filtersBorderRadius = ($_helper->getHorizontalFiltersBorderRadius() ? $_helper->getHorizontalFiltersBorderRadius() : '');
$filterButtonColor = ($horizontalSbDesignVersion === 'v3' ? $_helper->getHorizontalV3FiltersButtonColor() : '');
$filterTextColor = ($horizontalSbDesignVersion === 'v3' ? $_helper->getHorizontalV3FiltersTextColor() : '');
$filterButtonHoverColor = ($horizontalSbDesignVersion === 'v3' ? $_helper->getHorizontalV3FiltersButtonHoverColor() : '');
$filterTextHoverColor = ($horizontalSbDesignVersion === 'v3' ? $_helper->getHorizontalV3FiltersTextHoverColor() : '');
$filtersBorderColor = ($_helper->getHorizontalFiltersBorderColor() ? $_helper->getHorizontalFiltersBorderColor() : '');
$isMultiSelectOptionDisplayEnabled = $_helper->displayMultiselectAttributeSelectedOptions();
/* Sticky Filters */
$mobileBreakpoint = ($_helper->getMobileThreshold() === '' ? '768' : $_helper->getMobileThreshold());
$isStickyFiltersEnabled = ($horizontalSbDesignVersion === 'v2' ? $_helper->isHorizontalSidebarStickyEnabled() : '0');
?>
<div class="wp-filters <?php if ($isAjaxMode) echo 'wp-filters-ajax' ?>">
<?= /* @noEscape */
$block->getFilterButtonHtml() ?>
</div>
<?php if ($block->canShowBlock()): ?>
<div class="block filter <?= $block->escapeHtmlAttr($isAjaxScrollToTopClass) ?> <?= $block->escapeHtmlAttr($horizontalBoxShadowClass) ?> <?= $block->escapeHtmlAttr($isAutoCloseClass) ?> <?= $block->escapeHtmlAttr($horizontalDesignClass) ?> <?= $block->escapeHtmlAttr($filterAlignmentClass) ?> <?= $block->escapeHtmlAttr($selectedFiltersClass) ?>" id="layered-filter-block"
data-mage-init='<?= /* @noEscape */ json_encode(["collapsible"=>["openedState"=>"active","collapsible"=>true,"active"=>false,"collateral"=>["openedState"=>"filter-active","element"=>"body"]]]) ?>'>
<?php $filtered = count($block->getLayer()->getState()->getFilters()) ?>
<div class="block-title filter-title" data-count="<?= /* @noEscape */
$filtered ?>">
<strong data-role="title"><?= /* @noEscape */
__('Shop By') ?></strong>
</div>
<div class="block-content filter-content <?= /* @noEscape */ $reverseOrderClass ?>">
<?php if ($horizontalSbDesignVersion === 'v2') : ?>
<div class="filter-actions-wrapper">
<?php endif; ?>
<?= $block->getChildHtml('state') ?>
<?php if ($block->getLayer()->getState()->getFilters()): ?>
<div class="block-actions filter-actions">
<a href="<?= $block->escapeUrl($block->getClearUrl()) ?>" class="action clear filter-clear"><span><?= $block->escapeHtml(__('Clear All')) ?></span></a>
</div>
<?php endif; ?>
<?php if ($horizontalSbDesignVersion === 'v2') : ?>
</div>
<?php endif; ?>
<?php $activeFilters = $block->getActiveFilters() ?>
<?php $wrapOptions = false; ?>
<?php foreach ($block->getFilters() as $k => $filter): ?>
<?php $filterAttributeId = $filter->getData('attribute_model') ? $filter->getData('attribute_model')->getAttributeId() : 0; ?>
<?php $attributeId = (!$block->isCategoryFilter($filter) && !$block->isRatingFilter($filter)) ? $filterAttributeId : 0; ?>
<?php $categoryVisibility = $this->getCategoryVisibility($attributeId)?>
<?php if ($filter->getItemsCount() && $categoryVisibility): ?>
<?php if (!$wrapOptions): ?>
<strong role="heading" aria-level="2" class="block-subtitle filter-subtitle"><?= /* @noEscape */
__('Shopping Options') ?></strong>
<div class="filter-options" id="narrow-by-list" data-role="content"
data-mage-init='{"accordion":{"openedState": "active", "collapsible": true, "active": "<?php /* @noEscape */ echo $activeFilters; ?>", "multipleCollapsible": true, "animate":{ "duration" :300, "easing":"easeOutCubic"}}}'>
<?php $wrapOptions = true; ?>
<?php endif; ?>
<div data-role="collapsible" class="filter-options-item">
<?php $block->getChildBlock('renderer')->setAttributeId($filter) ?>
<div data-role="title" class="filter-options-title">
<?= $block->escapeHtml(__($filter->getName())) ?>
<?php if ($isMultiSelectOptionDisplayEnabled && $filter->getSelectedOptionsCounter() > 0) : ?>
<span class="ms_counter">(<?= /* @noEscape */ $filter->getSelectedOptionsCounter() ?>)</span>
<?php endif; ?>
</div>
<div id="attr_<?php /* @noEscape */ echo $attributeId ?>" data-role="content"
class="filter-options-content">
<?php if ($horizontalSbDesignVersion === 'v3'):?>
<div class="filter-options-content-title"> <?= $block->escapeHtml(__($filter->getName())) ?></div>
<?php endif;?>
<?= /* @noEscape */ $block->getChildBlock('renderer')->render($filter) ?></div>
</div>
<?php endif; ?>
<?php endforeach; ?>
<?php if ($wrapOptions): ?>
</div>
<?php else: ?>
<script>
require([
'jquery'
], function ($) {
$('#layered-filter-block').addClass('filter-no-options');
});
</script>
<?php endif; ?>
</div>
</div>
<?php endif; ?>
<div class="wp-ln-overlay"></div>
<div class="wp-ln-slider-js" data-mage-init='<?= /* @noEscape */ $block->getWidgetOptionsJson() ?>'>
<script>
require(['jquery', 'jquery-ui-modules/effect-slide'], function($) {
if ($('body').hasClass('slider-layer')) {
$('body.slider-layer #layered-filter-block').addClass('slide-in-filter');
}
if ($('body').hasClass('slider-down-layer') && $(window).width() >= <?php /* @noEscape */ echo $mobileBreakpoint ?>) {
var noOfColumns = '<?= $block->escapeJs($block->noOfColumns()) ?>',
boxHeight = '<?= $block->escapeJs($block->boxHeight()) ?>',
filterHeight = '<?= $block->escapeJs($block->filterColumnHeight()) ?>',
productWrapperMarginTop = (parseInt(boxHeight.substring(0, boxHeight.length - 2)) + 50) + 'px';
$('body.slider-down-layer #layered-filter-block').addClass('slide-down-filter');
$('body.slider-down-layer .slide-down-filter').css({'height':boxHeight});
$('body.slider-down-layer .slide-down-filter .filter-options-item').css({'width':noOfColumns, 'height':filterHeight});
}
if($('.slide-in-filter').length) {
$('.wp-ln-overlay').click(pageReset);
$('.wp-filters').click(pageSettings);
function pageSettings() {
$('.block-search, a.logo').css({'z-index': '5'});
$('body').addClass('wp-ln-open').css({'height': '100%', 'overflow': 'hidden'});
$('nav.navigation').css({'z-index': '1'});
$('div.columns').css({'z-index': '6'});
$('.wp-ln-overlay').fadeIn(100, 'linear', function () {
$('.slide-in-filter').delay(350).show("slide", {direction: "left"});
});
}
function pageReset() {
$('.slide-in-filter').hide('slide', {direction: "left"}, 500, function () {
$('body').removeClass('wp-ln-open').css({'height': 'auto', 'overflow': 'auto'});
$('.wp-ln-overlay').hide();
$('div.page-header').css({'z-index': ''});
$('div.columns').css({'z-index': '1'});
/** $('nav.navigation').css({'z-index': '3'}); */
$('.block-search, a.logo').css({'z-index': '5'});
$('.page-wrapper .nav-sections:not(.sticky-header-nav)').removeAttr('style');
});
}
} else if($('.slide-down-filter').length) {
$('.wp-filters').on('click', lnSlideDown);
function lnSlideDown() {
$('.wp-filters').off('click');
$('body').attr('data-pwmt', productWrapperMarginTop);
$('.products.wrapper').animate({marginTop: productWrapperMarginTop},
{
duration:500,
complete: function() {
$('.wp-filters span.wp-slide-down-add').addClass('active');
}
});
$('.wp-slide-down-add:not(active)').off('click');
$('.slide-down-filter').slideDown(500, function() {
$('.wp-filters').on('click', lnSlideUp);
});
}
function lnSlideUp() {
$('.wp-filters').off('click');
$('.slide-down-filter').slideUp(
{
duration: 500,
start: function(){
$('.products.wrapper').animate(
{
marginTop: '0px'
},
{
duration:500,
complete: function() {
$('.wp-filters span.wp-slide-down-add').removeClass('active');
$('.wp-filters').on('click', lnSlideDown);
},
queue: false
}
);
},
queue: false
});
}
} else {
$('body.slider-layer .toolbar-products').css({'margin-left': '0px'});
}
});
<?php if ($jsClass): ?>
require.config({
map: {
'*': {
"productListToolbarForm": "<?= /* @noEscape */ $jsClass; ?>"
}
}
});
<?php endif; ?>
require(['wpFilterSelect', 'wpInstantSearch', 'wpShowMoreLess'], function(){
wpFilterSelect.markSelected();
wpInstantSearch.searchOptions();
wpShowMoreLess.initMoreLess();
});
<?php if ($isStickyFiltersEnabled) : ?>
require([
"jquery",
"WeltPixel_LayeredNavigation/js/stickyFilters"
], function($, stickyFilters){
$(document).ready(function () {
'use strict';
let mobileThreshold = "768",
isStickyFiltersEnabled = "<?= /* @noEscape */ $isStickyFiltersEnabled ?>";
stickyFilters.init(mobileThreshold, isStickyFiltersEnabled);
});
});
<?php endif; ?>
</script>
</div>
<?php if ($horizontalSbDesignVersion === 'v3') : ?>
<style>
body.page-layout-1column #layered-filter-block.horizontal-v3 .block-content.filter-content .filter-options .filter-options-item .filter-options-title{
background-color: <?php /* @noEscape */ echo $filterButtonColor ?>;
color: <?php /* @noEscape */ echo $filterTextColor ?>;
border: <?php /* @noEscape */ echo $filtersBorder ?>;
border-radius: <?php /* @noEscape */ echo $filtersBorderRadius ?>;
border-radius: <?php /* @noEscape */ echo $filtersBorderRadius ?>;
border-radius: <?php /* @noEscape */ echo $filtersBorderRadius ?>;
border-color: <?php /* @noEscape */ echo $filtersBorderColor ?>;;
}
body.page-layout-1column #layered-filter-block.horizontal-v3 .block-content.filter-content .filter-options .filter-options-item .filter-options-title:after {
color: <?php /* @noEscape */ echo $filterTextColor ?>;
}
body.page-layout-1column #layered-filter-block.horizontal-v3 .block-content.filter-content .filter-options .filter-options-item .filter-options-title:hover,
body.page-layout-1column #layered-filter-block.horizontal-v3 .block-content.filter-content .filter-options .filter-options-item.active .filter-options-title,
body.page-layout-1column #layered-filter-block.horizontal-v3 .block-content.filter-content .filter-options .filter-options-item.active .filter-options-title:after{
background-color: <?php /* @noEscape */ echo $filterButtonHoverColor ?> ; ;
color: <?php /* @noEscape */ echo $filterTextHoverColor ?> ;
}
body.page-layout-1column #layered-filter-block.horizontal-v3 .block-content.filter-content .filter-options .filter-options-item .filter-options-title:hover::after {
color: <?php /* @noEscape */ echo $filterTextHoverColor ?>;
}
</style>
<?php endif; ?>
@@ -0,0 +1,3 @@
<script>
window.isLayeredNavigationEnabled = '<?= /* @noEscape */ $this->isLnEnabled()?>';
</script>
@@ -0,0 +1,83 @@
<?php
// @codingStandardsIgnoreFile
/** @var $block \WeltPixel\LayeredNavigation\Block\LayeredNavigation\RenderLayered */
?>
<?php $swatchData = $block->getSwatchData(); ?>
<?php $isMulti = $block->getIsMultiSelect($swatchData['attribute_id']) ?>
<div id="swatch-wrapper" class="swatch-attribute swatch-layered <?= $block->escapeHtmlAttr($swatchData['attribute_code']) ?>"
attribute-code="<?= $block->escapeHtmlAttr($swatchData['attribute_code']) ?>"
attribute-id="<?= $block->escapeHtmlAttr($swatchData['attribute_id']) ?>">
<div class="swatch-attribute-options clearfix" data-is-multi="<?= /* @noEscape */ (int)$block->getIsMultiSelect($swatchData['attribute_id']) ?>">
<?php foreach ($swatchData['options'] as $option => $label): ?>
<a href="<?= $block->escapeUrl($label['link']) ?>"
aria-label="<?= $block->escapeHtmlAttr($label['label']) ?>"
class="swatch-option-link-layered"
data-is-multi="<?= /* @noEscape */ (int) $isMulti ?>"
data-opt-path="<?= $block->escapeHtmlAttr($swatchData['attribute_code'] . '=' . $option) ?>"
id="wp_ln_swatch_attr_<?= $block->escapeHtmlAttr($swatchData['attribute_id']) ?>_<?= $block->escapeHtmlAttr($option) ?>">
<?php if (isset($swatchData['swatches'][$option]['type'])) { ?>
<?php switch ($swatchData['swatches'][$option]['type']) {
case '3':
?>
<div class="swatch-option <?= $block->escapeHtmlAttr($label['custom_style']) ?>"
tabindex="-1"
data-option-type="3"
data-option-id="<?= /* @noEscape */ $option ?>"
data-option-label="<?= /* @noEscape */ $label['label'] ?>"
data-option-tooltip-thumb=""
data-option-tooltip-value=""
></div>
<?php break;
case '2':
?>
<?php $swatchThumbPath = $block->getSwatchPath('swatch_thumb',
$swatchData['swatches'][$option]['value']); ?>
<?php $swatchImagePath = $block->getSwatchPath('swatch_image',
$swatchData['swatches'][$option]['value']); ?>
<div class="swatch-option image <?= $block->escapeHtmlAttr($label['custom_style']) ?>"
tabindex="-1"
data-option-type="2"
data-option-id="<?= /* @noEscape */ $option ?>"
data-option-label="<?= /* @noEscape */ $label['label'] ?>"
data-option-tooltip-thumb="<?= /* @noEscape */ $swatchThumbPath ?>"
data-option-tooltip-value=""
style="background: url(<?= $block->escapeUrl($swatchImagePath) ?>) no-repeat center; background-size: initial;"></div>
<?php break;
case '1':
?>
<div class="swatch-option color <?= $block->escapeHtmlAttr($label['custom_style']) ?>"
tabindex="-1"
data-option-type="1"
data-option-id="<?= /* @noEscape */ $option ?>"
data-option-label="<?= /* @noEscape */ $label['label'] ?>"
data-option-tooltip-thumb=""
data-option-tooltip-value="<?= /* @noEscape */ $swatchData['swatches'][$option]['value'] ?>"
style="background: <?= /* @noEscape */ $swatchData['swatches'][$option]['value'] ?> no-repeat center; background-size: initial;"></div>
<?php break;
case '0':
default:
?>
<div class="swatch-option text <?= $block->escapeHtmlAttr($label['custom_style']) ?>"
tabindex="-1"
option-type="0"
data-option-id="<?= /* @noEscape */ $option ?>"
data-option-label="<?= /* @noEscape */ $label['label'] ?>"
data-option-tooltip-thumb=""
data-option-tooltip-value=""
><?= /* @noEscape */ $swatchData['swatches'][$option]['value'] ?></div>
<?php break;
} ?>
<?php } ?>
</a>
<?php endforeach; ?>
</div>
</div>
<script>
require(["jquery", "Magento_Swatches/js/swatch-renderer"], function ($) {
$('.swatch-layered.<?= $block->escapeJs($swatchData['attribute_code']) ?>')
.find('[data-option-type="1"], [data-option-type="2"], [data-option-type="0"], [data-option-type="3"]')
.SwatchRendererTooltip();
});
</script>
@@ -0,0 +1,4 @@
<div id="layer-product-list">
<?php echo $block->getChildHtml() ?>
</div>
@@ -0,0 +1,3 @@
<div id="layer-product-list">
<?php echo $block->getChildHtml() ?>
</div>
@@ -0,0 +1,132 @@
<?php
/** @var \WeltPixel\LayeredNavigation\Helper\Data $wpHelper */
$wpHelper = $this->helper('\WeltPixel\LayeredNavigation\Helper\Data');
?>
<?php if (($wpHelper->getSidebarStyle() == 0) && $wpHelper->isShowHideDesktopFilterEnabled()) : ?>
<div class="show-hide-filter-desktop">
<div class="desktop-show-filter">
<span class="show-filter-icon"></span>
<?= $block->escapeHtml(__('Show Filters')) ?>
</div>
<div class="desktop-hide-filter active">
<span class="show-filter-icon"></span>
<?= $block->escapeHtml(__('Hide Filters')) ?>
</div>
</div>
<script>
require([
'jquery','mage/cookies'
], function ($) {
var colMainWidth = null, sidebarHideDurationDefault = 500;
var desktopHideFilterElm = $('.desktop-hide-filter'),
desktopShowFilterElm = $('.desktop-show-filter'),
defaultShowHideState = '<?= /* @noEscape */ $wpHelper->getShowHideDesktopFilterState() ?>';
function desktopHideFilter(element, hideQuickly) {
if (!$(element).hasClass('active')) {
return false;
}
let sidebarHideDuration = sidebarHideDurationDefault;
if (hideQuickly) {
sidebarHideDuration = 0;
} else {
$.cookie('wp_ln_showhide', 'hide');
}
$(element).hide().removeClass('active');
$('.desktop-show-filter').css('display', 'inline-block');
if (!colMainWidth) {
var width = $('.column.main').outerWidth();
var parentWidth = $('.column.main').offsetParent().width();
colMainWidth = (100*width/parentWidth - 0.1) + "%";
}
$(function() {
$('.sidebar').animate(
{
'opacity': '0',
'margin-left': '-300px'
},
{
duration: sidebarHideDuration,
queue: false,
complete: function() {
$(this).hide();
}
}
);
$('.column.main').addClass('no-left-padding').animate(
{
'width': '100%'
},
{
duration: 500,
queue: false,
complete: function() {
if (window.CategoryPage) {
window.CategoryPage.buttonQuickView();
window.CategoryPage.itemHeight(true);
}
$('.desktop-show-filter').addClass('active');
}
}
);
$('.toolbar.toolbar-products').addClass('auto-width').animate( {'padding-left' : '0'}, {duration: 500});
});
}
function desktopShowFilter(element) {
if (!$(element).hasClass('active')) {
return false;
}
$(element).hide().removeClass('active');
$('.desktop-hide-filter').css('display', 'inline-block');
$.cookie('wp_ln_showhide', 'show');
$(function() {
$('.sidebar').show().css('opacity', '1').animate(
{
'margin-left': '0'
},
{
duration: 500,
queue: false,
complete: function() {
$('.desktop-hide-filter').addClass('active');
}
}
);
$('.column.main').removeClass('no-left-padding').animate(
{
'width': colMainWidth
},
{
duration: 500,
queue: false,
complete: function() {
if (window.CategoryPage) {
window.CategoryPage.buttonQuickView();
window.CategoryPage.itemHeight(true);
}
}
}
);
});
$('.toolbar.toolbar-products').removeClass('auto-width').animate( {'padding-left' : '12px'}, {duration: 500});
}
desktopHideFilterElm.bind('click', function () {
desktopHideFilter(this, false);
});
desktopShowFilterElm.bind('click', function () {
desktopShowFilter(this);
});
$('.sidebar').addClass('desktop-showhide-filter-on')
if ($.cookie('wp_ln_showhide') == 'hide') {
desktopHideFilter(desktopHideFilterElm, true);
} else if ($.cookie('wp_ln_showhide') != 'show' && defaultShowHideState == 'closed') {
desktopHideFilter(desktopHideFilterElm, true);
}
});
</script>
<?php endif; ?>
File diff suppressed because it is too large Load Diff
Binary file not shown.

After

Width:  |  Height:  |  Size: 177 B

@@ -0,0 +1,185 @@
/*!
* jQuery UI Touch Punch 0.2.3
*
* Copyright 2011–2014, Dave Furfero
* Dual licensed under the MIT or GPL Version 2 licenses.
*
* Depends:
* jquery.ui.widget.js
* jquery.ui.mouse.js
*/
define(['jquery', 'jquery-ui-modules/mouse', 'jquery-ui-modules/widget'], // Require jquery
function($){
(function ($) {
// Detect touch support
$.support.touch = 'ontouchend' in document;
// Ignore browsers without touch support
if (!$.support.touch) {
return;
}
var mouseProto = $.ui.mouse.prototype,
_mouseInit = mouseProto._mouseInit,
_mouseDestroy = mouseProto._mouseDestroy,
touchHandled;
/**
* Simulate a mouse event based on a corresponding touch event
* @param {Object} event A touch event
* @param {String} simulatedType The corresponding mouse event
*/
function simulateMouseEvent (event, simulatedType) {
// Ignore multi-touch events
if (event.originalEvent.touches.length > 1) {
return;
}
if (event.cancelable) {
event.preventDefault();
}
var touch = event.originalEvent.changedTouches[0],
simulatedEvent = document.createEvent('MouseEvents');
// Initialize the simulated mouse event using the touch event's coordinates
simulatedEvent.initMouseEvent(
simulatedType, // type
true, // bubbles
true, // cancelable
window, // view
1, // detail
touch.screenX, // screenX
touch.screenY, // screenY
touch.clientX, // clientX
touch.clientY, // clientY
false, // ctrlKey
false, // altKey
false, // shiftKey
false, // metaKey
0, // button
null // relatedTarget
);
// Dispatch the simulated event to the target element
event.target.dispatchEvent(simulatedEvent);
}
/**
* Handle the jQuery UI widget's touchstart events
* @param {Object} event The widget element's touchstart event
*/
mouseProto._touchStart = function (event) {
var self = this;
// Ignore the event if another widget is already being handled
if (touchHandled || !self._mouseCapture(event.originalEvent.changedTouches[0])) {
return;
}
// Set the flag to prevent other widgets from inheriting the touch event
touchHandled = true;
// Track movement to determine if interaction was a click
self._touchMoved = false;
// Simulate the mouseover event
simulateMouseEvent(event, 'mouseover');
// Simulate the mousemove event
simulateMouseEvent(event, 'mousemove');
// Simulate the mousedown event
simulateMouseEvent(event, 'mousedown');
};
/**
* Handle the jQuery UI widget's touchmove events
* @param {Object} event The document's touchmove event
*/
mouseProto._touchMove = function (event) {
// Ignore event if not handled
if (!touchHandled) {
return;
}
// Interaction was not a click
this._touchMoved = true;
// Simulate the mousemove event
simulateMouseEvent(event, 'mousemove');
};
/**
* Handle the jQuery UI widget's touchend events
* @param {Object} event The document's touchend event
*/
mouseProto._touchEnd = function (event) {
// Ignore event if not handled
if (!touchHandled) {
return;
}
// Simulate the mouseup event
simulateMouseEvent(event, 'mouseup');
// Simulate the mouseout event
simulateMouseEvent(event, 'mouseout');
// If the touch interaction did not move, it should trigger a click
if (!this._touchMoved) {
// Simulate the click event
simulateMouseEvent(event, 'click');
}
// Unset the flag to allow other widgets to inherit the touch event
touchHandled = false;
};
/**
* A duck punch of the $.ui.mouse _mouseInit method to support touch events.
* This method extends the widget with bound touch event handlers that
* translate touch events to mouse events and pass them to the widget's
* original mouse event handling methods.
*/
mouseProto._mouseInit = function () {
var self = this;
// Delegate the touch handlers to the widget's element
self.element.bind({
touchstart: $.proxy(self, '_touchStart'),
touchmove: $.proxy(self, '_touchMove'),
touchend: $.proxy(self, '_touchEnd')
});
// Call the original $.ui.mouse init method
_mouseInit.call(self);
};
/**
* Remove the touch event handlers
*/
mouseProto._mouseDestroy = function () {
var self = this;
// Delegate the touch handlers to the widget's element
self.element.unbind({
touchstart: $.proxy(self, '_touchStart'),
touchmove: $.proxy(self, '_touchMove'),
touchend: $.proxy(self, '_touchEnd')
});
// Call the original $.ui.mouse destroy method
_mouseDestroy.call(self);
};
})(jQuery);
});
@@ -0,0 +1,703 @@
define([
"jquery",
"loader",
"jquery-ui-modules/widget",
"jquery-ui-modules/effect-slide",
"Magento_Catalog/js/product/list/toolbar",
], function ($) {
/**
* ProductListToolbarForm Widget - this widget is setting cookie and submitting form according to toolbar controls
*/
$.widget('mage.productListToolbarForm', $.mage.productListToolbarForm, {
options:
{
modeControl: '[data-role="mode-switcher"]',
directionControl: '[data-role="direction-switcher"]',
orderControl: '[data-role="sorter"]',
limitControl: '[data-role="limiter"]',
pagerControl: '[data-role="pager"], .pages-items a',
mode: 'product_list_mode',
direction: 'product_list_dir',
order: 'product_list_order',
limit: 'product_list_limit',
pager: 'p',
modeDefault: 'grid',
directionDefault: 'asc',
orderDefault: 'position',
limitDefault: '9',
pagerDefault: '1',
productsToolbarControl: '.toolbar.toolbar-products',
productsListBlock: '#layer-product-list',
layeredNavigationFilterBlock: '.block.filter',
filterItemControl: '.block.filter .item a, .block.filter .filter-clear,.block.filter .swatch-option-link-layered, .wp-price-slider-a',
url: ''
},
_create: function () {
this._super();
this._bind($(this.options.pagerControl), this.options.pager, this.options.pagerDefault);
$(this.options.filterItemControl)
.off('click.' + this.namespace + 'productListToolbarForm')
.on('click.' + this.namespace + 'productListToolbarForm', {}, $.proxy(this.applyFilterToProductsList, this))
;
var that = this;
window.onpopstate = function(event) {
var ignoredHashes = ['#search-mod'];
if (event && !ignoredHashes.includes(window.location.hash) && window.location.href.slice(-1) != '#') {
var backUrl = event.target.location.origin + event.target.location.pathname;
var paramData = event.target.location.search.replace(/^\?/, '')
that.makeAjaxCall(backUrl, paramData, false);
}
}
$('.item a.wp-filter-disabled').off('click');
if (window.wp_ajax_useCustomPlaceholder == '1') {
$('.page-wrapper').loader({
icon: window.loadingImage,
template: '<div class="loading-mask" data-role="loader">\n' +
' <div class="loader">\n' +
' <img alt="<%- data.texts.imgAlt %>" style="max-width: ' + window.wp_ajax_placeholderCustomWidth + '" src="<%- data.icon %>">\n' +
' <p><%- data.texts.loaderText %></p>\n' +
' </div>\n' +
'</div>'
});
}
},
/**
* @param {jQuery.Event} event
* @private
*/
_processPagination: function (event) {
event.preventDefault();
var paginationUrl = event.currentTarget.href;
var urlParams = this.getUrlParams(paginationUrl);
this.changeUrl(
event.data.paramName,
urlParams[event.data.paramName],
event.data.default
);
},
_bind: function (element, paramName, defaultValue) {
/**
* Prevent double binding of these events because this component is being applied twice in the UIX
*/
if (paramName == this.options.pager) {
element
.off('click.' + this.namespace + 'productListToolbarForm')
.on('click.' + this.namespace + 'productListToolbarForm', {
paramName: paramName,
default: defaultValue
}, $.proxy(this._processPagination, this));
} else if (element.is("select")) {
element
.off('change.' + this.namespace + 'productListToolbarForm')
.on('change.' + this.namespace + 'productListToolbarForm', {
paramName: paramName,
default: defaultValue
}, $.proxy(this._processSelect, this));
} else {
element
.off('click.' + this.namespace + 'productListToolbarForm')
.on('click.' + this.namespace + 'productListToolbarForm', {
paramName: paramName,
default: defaultValue
}, $.proxy(this._processLink, this));
}
},
applyFilterToProductsList: function (evt) {
var link = $(evt.currentTarget),
linkA = link.attr('href'),
urlParts = (typeof linkA !== 'undefined') ? linkA.split('?') : '',
currentUrl = window.location.href,
isMulti = (link.attr('data-is-multi')) ? link.data('is-multi') : 0,
parentElem = link.parent(),
clickOpt = (parentElem.attr('data-path-opt')) ? parentElem.data('opt-path') : link.data('opt-path'),
c = currentUrl.split('?');
window.isSorting = false;
var reqeustParams = (typeof urlParts[1] === 'undefined') ? '' : urlParts[1];
var mergedPath = reqeustParams;
if (reqeustParams.length > 0 && typeof c[1] !== 'undefined') {
mergedPath = this.compareMergeParams(c[1], reqeustParams, clickOpt, isMulti);
}
self.elem = link;
this.makeAjaxCall(urlParts[0], mergedPath, true);
evt.preventDefault();
},
compareMergeParams: function (currentParamsStr, newParamsStr, clickOpt, isMulti) {
var a = currentParamsStr.split('&');
var b = newParamsStr.split('&');
var c = (typeof clickOpt !== 'undefined') ? clickOpt.split('=') : '';
var res = '';
a.sort();
b.sort();
for (var i = 0; i < b.length; i++) {
var paramStr = b[i].split('=')[0],
paramVal = decodeURIComponent(b[i].split('=')[1]),
paramArr = paramVal.split(',');
for (var j = 0; j < a.length; j++) {
if (typeof a[j] === 'undefined') {
continue;
}
var existParamStr = a[j].split('=')[0],
existParamVal = decodeURIComponent(a[j].split('=')[1]),
existParamArr = existParamVal.split(','),
matchParams = '';
if(paramStr == 'p' || paramStr == 'q' || paramStr == 'ajax') {
continue;
}
if (paramStr !== existParamStr) {
//res += paramStr + '=' + paramVal + '&';
continue;
}
for (var z = 0; z < existParamArr.length; z++) {
if (paramArr.indexOf(existParamArr[z]) !== -1) {
matchParams = (matchParams.length === 0) ? existParamArr[z] : matchParams + ',' + existParamArr[z];
}
}
if (paramStr === existParamStr && paramVal !== existParamVal && matchParams.length === 0 && isMulti != 0) {
paramVal = existParamVal + ',' + paramVal;
}
else if( c[0] == paramStr && c[1] == matchParams ){
var filteredArray = existParamArr.filter(function(e) { return e !== matchParams })
paramVal = (filteredArray.length > 0) ? filteredArray.join(',') : '';
}
else {
//paramVal = matchParams;
}
}
if(paramVal) {
res += paramStr + '=' + paramVal + '&';
}
}
res = res.slice(0, -1);
return res;
},
updateUrl: function (url, paramData, pushState) {
if (!url) {
return;
}
if (paramData && paramData.length > 0) {
url += '?' + paramData;
}
url = this.removeQueryStringParameter('ajax', url);
url = this.removeQueryStringParameter('_', url);
if (pushState && (typeof history.pushState === 'function')) {
history.pushState({}, null, url);
}
},
getParams: function (urlParams, paramName, paramValue, defaultValue) {
var decode = window.decodeURIComponent,
paramData = {},
parameters, i;
for (i = 0; i < urlParams.length; i++) {
parameters = urlParams[i].split('=');
paramData[decode(parameters[0])] = parameters[1] !== undefined ?
decode(parameters[1].replace(/\+/g, '%20')) :
'';
}
/** get the real attr name from param */
var paramValueArr = paramValue.split('~'),
paramValueNew = paramValueArr[0];
paramData[paramName] = paramValueNew;
/** get the given direction from param */
var directionName = this.options.direction;
if (paramValueArr.length == 2 && paramName != directionName) {
paramData[directionName] = paramValueArr[1];
}
return $.param(paramData);
},
_updateContent: function (content) {
window.shouldOpenMinicart = false;
$(this.options.productsToolbarControl).remove();
if (content.products_list) {
$(this.options.productsListBlock).html(content.products_list);
$(this.options.productsListBlock).trigger('contentUpdated');
}
if (content.filters) {
var isSlideIn = $('body').hasClass('slider-layer');
var isSlideDown = $('body').hasClass('slider-down-layer');
var isAutoClose = $('#layered-filter-block').hasClass('auto-close');
var isViewL = $('body').hasClass('wp-device-l');
var isViewXl = $('body').hasClass('wp-device-xl');
$(this.options.layeredNavigationFilterBlock).replaceWith(content.filters);
$(this.options.layeredNavigationFilterBlock).trigger('contentUpdated');
if(!isAutoClose && isSlideIn && !window.isSorting && (isViewL || isViewXl)) {
$('body').addClass('wp-ln-open').css({'height': '100%', 'overflow': 'hidden'});
$('.block-search, a.logo').css({'z-index': '1'});
$('.wp-ln-overlay').fadeIn(100, 'swing', function () {
$('#layered-filter-block').delay(150).show("slide", {direction: "left"});
});
}
if(!isAutoClose && isSlideDown && !window.isSorting) {
var productWrapperMarginTop = $('body').attr('data-pwmt');
$('.products.wrapper').animate({marginTop: productWrapperMarginTop},
{
duration:500,
complete: function() {
$('.wp-filters span.wp-slide-down-add').addClass('active');
}
});
$('.wp-slide-down-add:not(active)').off('click');
$('.slide-down-filter').slideDown(500);
$('body.slider-down-layer #layered-filter-block').show();
}
}
if (content.ga4ServerSideItemListHash) {
window.wpGA4ServerSide.pushViewItemList(content.ga4ServerSideItemListHash);
}
if (content.dataLayer) {
var dlObjects = JSON.parse(content.dataLayer);
window.dataLayer = window.dataLayer || [];
for (var i in dlObjects) {
window.dataLayer.push({ecommerce: null});
window.dataLayer.push(dlObjects[i]);
}
}
var allowGa4Services = true;
if (window.ga4AllowServices != undefined) {
allowGa4Services = window.ga4AllowServices;
}
if (content.dataLayerGA4 && allowGa4Services) {
var dl4Objects = JSON.parse(content.dataLayerGA4);
window.dataLayer = window.dataLayer || [];
for (var i in dl4Objects) {
window.dataLayer.push({ecommerce: null});
window.dataLayer.push(dl4Objects[i]);
}
}
$(document).trigger("wpproductlabels:init");
$('li.product-item').trigger('contentUpdated');
if (window.isSlCustomPopupUsed && parseInt(window.isSlCustomPopupUsed)) {
$('li.product-item').find('.towishlist').each(function() {
$(this).removeAttr('data-post');
})
}
$('body').trigger('contentUpdated');
},
lnSlideDown: function() {
var productWrapperMarginTop = $('body').attr('data-pwmt');
$('.products.wrapper').animate({marginTop: productWrapperMarginTop},
{
duration:500,
complete: function() {
$('.wp-filters span.wp-slide-down-add').addClass('active');
}
});
$('.wp-slide-down-add:not(active)').off('click');
$('.slide-down-filter').slideDown(500);
$('.wp-filters').on('click', this.lnSlideUp);
},
lnSlideUp: function() {
$('.wp-filters').off('click');
$('.slide-down-filter').slideUp(
{
duration: 500,
start: function(){
$('.products.wrapper').animate(
{
marginTop: '0px'
},
{
duration:500,
complete: function() {
$('.wp-filters span.wp-slide-down-add').removeClass('active');
$('.wp-filters').on('click', this.lnSlideDown);
},
queue: false
}
);
},
queue: false
});
},
reinitializeIas: function() {
if(require.defined('ias') && window.ajaxCatalog == 'infiniteScroll') {
jQuery.ias().destroy();
jQuery(function($) {
var config = {
container: '.products.wrapper .product-items',
item: '.product-item',
pagination: '.toolbar .pages, .toolbar .limiter',
next: '.pages .action.next',
negativeMargin: window.negativeMargin
};
var pagertext = jQuery(".toolbar-amount");
pagertext.show();
/** added to prevent jquery to add extra "_" parameter to link */
$.ajaxSetup({ cache: true });
/** add infinite-scroll class */
$(config.container).closest('.column.main').addClass('infinite-scroll');
/** load ias */
var ias = $.ias(config);
ias.getNextUrl = function(container) {
if (!container) {
container = ias.$container;
}
/** always take the last matching item + fix to be protocol relative */
var nexturl = $(ias.nextSelector, container).last().attr('href');
if(typeof nexturl !== "undefined") {
if (window.location.protocol == 'https:') {
nexturl = nexturl.replace('http:', window.location.protocol);
} else {
nexturl = nexturl.replace('https:', window.location.protocol);
}
nexturl = window.ajaxInfiniteScroll.removeQueryStringParameter('_', nexturl);
nexturl = window.ajaxInfiniteScroll.removeQueryStringParameter('ajax', nexturl);
}
return nexturl;
};
/** adds extra functionality to Infinite AJAX Scroll */
ias.extension(new IASPagingExtension());
ias.on('pageChange', function(pageNum, scrollOffset, url) {
window.page = pageNum;
});
/** added to prevent jquery to add extra "_" parameter to link */
ias.on('load', function(event) {
var url = event.url;
event.ajaxOptions.cache = true;
event.url = window.ajaxInfiniteScroll.removeQueryStringParameter('_', event.url);
});
ias.on('loaded', function(data, items) {
/** fix lazy load images */
window.ajaxInfiniteScroll.reloadImages(items);
window.ajaxInfiniteScroll.dataLayerUpdate(data);
});
/** fix ajax add to cart */
ias.on('rendered', function(items) {
window.ajaxInfiniteScroll.fixAddToCart();
/** re-init Pearl related elements */
window.ajaxInfiniteScroll.reloadQuickView();
window.ajaxInfiniteScroll.reloadCategoryPage();
/** update next/prev head links */
if (window.showCanonical == 1) {
window.ajaxInfiniteScroll.reloadCanonicalPrevNext();
}
$('.product-item-info a').each(function() {
if( typeof $(this).attr('data-item-page') === 'undefined') {
$(this).attr('data-item-page', window.page);
}
});
$(document).trigger("wpproductlabels:init");
$('li.product-item').trigger('contentUpdated');
if (window.isSlCustomPopupUsed && parseInt(window.isSlCustomPopupUsed)) {
$('li.product-item').find('.towishlist').each(function() {
$(this).removeAttr('data-post');
})
}
$.mage.formKey();
});
/** adds a text when there are no more pages to load */
ias.extension(new IASNoneLeftExtension({
html: '<span class="ias-no-more">' + window.textNoMore + '</span>'
}));
/** displays a customizable loader image when loading a new page */
var loadingHtml = '<div class="ias-spinner">';
loadingHtml += '<img src="{src}"';
if (window.wp_ajax_useCustomPlaceholder == '1') {
loadingHtml += "style='max-width:" + window.wp_ajax_placeholderCustomWidth +"'";
}
loadingHtml += '/>';
loadingHtml += '<span>' + window.textLoadingMore + '</span>';
loadingHtml += '</div>';
ias.extension(new IASSpinnerExtension({
src: window.loadingImage,
html: loadingHtml
}));
/** adds "Load More" and "Load Previous" button */
if (window.LoadMore > 0) {
ias.extension(new IASTriggerExtension({
text: window.textNext,
html: '<button class="button action ias-load-more" type="button"><span>{text}</span></button>',
textPrev: 'Load previous items',
htmlPrev: '<button class="button action ias-load-prev" type="button"><span>{text}</span></button>',
offset: window.LoadMore
}));
} else {
ias.extension(new IASTriggerExtension({
textPrev: 'Load previous items',
htmlPrev: '<button class="button action ias-load-prev" type="button"><span>{text}</span></button>',
offset: 1000
}));
}
/** adds history support */
ias.extension(new IASHistoryExtension({prev: '.previous'}));
});
}
},
updateContent: function (content) {
this._updateContent(content)
},
changeUrl: function (paramName, paramValue, defaultValue) {
var urlPaths = this.options.url.split('?'),
baseUrl = urlPaths[0],
urlParams = urlPaths[1] ? urlPaths[1].split('&') : [],
paramData = this.getParams(urlParams, paramName, paramValue, defaultValue);
window.isSorting = (paramName == 'product_list_order' || paramName == 'product_list_limit' || paramName == 'p') ? true : false;
if( paramName == 'product_list_mode') {// paramName == 'product_list_order' - to remove adavancedsorting by ajax
var ajaxParam = false;
for (var i = urlParams.length; i--;) {
if (urlParams[i] === 'ajax=1') {
urlParams.splice(i, 1);
ajaxParam = true;
}
}
if (ajaxParam) {
paramData = this.getParams(urlParams, paramName, paramValue, defaultValue);
}
location.href = baseUrl + (paramData.length ? '?' + paramData : '');
} else {
this.makeAjaxCall(baseUrl, paramData, true);
}
},
backToTop: function()
{
var stickyHeader = $('.sticky-header, .sticky-header-mobile'),
stickyHeaderHeight = 0;
if (stickyHeader.length) {
stickyHeaderHeight = parseInt(stickyHeader.outerHeight());
}
$('html, body').animate({
scrollTop: ($('.column.main').offset().top - stickyHeaderHeight)
}, 'slow');
},
makeAjaxCall: function (baseUrl, paramData, pushState) {
var self = this;
var isSlideIn = $('body').hasClass('slider-layer');
var ajaxScrollTop = $('#layered-filter-block').hasClass('ajax-scroll-top');
if (ajaxScrollTop && !isSlideIn) {
self.backToTop();
}
var showLoader = true;
if (window.wp_ajax_useCustomPlaceholder == '1' && window.isSorting) {
$('.page-wrapper').loader("show");
showLoader = false;
}
var jqxhr = $.ajax({
url: baseUrl,
data: (paramData && paramData.length > 0) ? paramData + '&ajax=1' : 'ajax=1',
type: 'get',
dataType: 'json',
global: false,
cache: true,
showLoader: showLoader,
beforeSend: function (xhr){
xhr.setRequestHeader('X-Requested-With', 'XMLHttpRequest');
if(typeof window.page === 'undefined') {
window.page = $('.product-item-info a').last().attr('data-item-page');
}
}
}).done(function (response) {
if (response.success) {
$('.swatch-option-tooltip').hide();
self.updateUrl(baseUrl, paramData, pushState);
self.updateContent(response.html);
self.slidersUpdate();
}
});
jqxhr.always(function() {
if (window.wp_ajax_useCustomPlaceholder == '1') {
$('.page-wrapper').loader("hide");
}
/** fix lazy load image width */
$("img.lazy").each(function() {
$(this).css({'max-width':'100%'});
});
self.reinitializeIas();
$('.product.photo.product-item-photo').on('click', function(e) {
e.preventDefault();
var page = $(this).attr('data-item-page');
var url = window.location.href;
self.resetIasPagination(page, url);
var href = $(this).attr('href');
window.location.href = href;
});
$('.product-item-info a').each(function() {
if( typeof $(this).attr('data-item-page') === 'undefined') {
$(this).attr('data-item-page', window.page);
}
});
if(require.defined('ias') && window.ajaxCatalog == 'nextPage') {
window.ajaxInfiniteScroll.addPageSelector('.pages li.item a.page');
}
if ($('body').hasClass('slider-layer')) self.resetPage();
if ($('body').hasClass('slider-down-layer')) self.slideUpReset();
self.reloadQuickView();
window.shouldOpenMinicart = '1';
$.mage.formKey();
});
},
resetIasPagination: function(page, url) {
if(require.defined('ias') && window.ajaxCatalog == 'infiniteScroll') {
jQuery.ias().destroy();
var newUrl = url.replace(/(&p=|\?p=).*?(&|$)/,'$1' + page + '$2');
window.history.replaceState("", "", newUrl);
}
},
reloadQuickView: function() {
var quickView = $('.weltpixel-quickview');
if (quickView.length) {
$('.weltpixel-quickview').bind('click', function() {
var prodUrl = $(this).attr('data-quickview-url');
if (prodUrl.length) {
window.quickview.displayContent(prodUrl);
}
});
if (window.wpQwListMode == 'list') {
quickView.each(function (key, item) {
if (!$(item).hasClass('wp-qw-adjusted')) {
var imageWrapper = $(item).closest('.product-item').find('.product-item-info').get(0);
var imagePhotoLink = $(item).closest('.product-item-info').find('.product-item-photo').get(0);
$(imageWrapper).prepend('<div class="product photo product-item-photo product-image-list"></div>');
var imageCustomDiv = $(item).closest('.product-item-info').find('.product-image-list').get(0);
$(imagePhotoLink).appendTo(imageCustomDiv)
var imagePhoto = $(item).closest('.product-item-info').find('.product-image-list').get(0);
$(item).show().appendTo(imagePhoto);
$(item).addClass('wp-qw-adjusted');
$(item).css('display', '');
}
});
}
}
},
slidersUpdate: function () {
$('.wp-slide-in').not(':first').remove();
$('.wp-slide-out').not(':first').remove();
$('.wp-filters').not(':first').remove();
$('.wp-ln-overlay').not(':first').remove();
$('.wp-ln-slider-js').not(':first').remove();
$('.wp-ln-selected-js').not(':first').remove();
},
resetPage: function () {
var slideInBlock = $('#layered-filter-block');
if(slideInBlock.hasClass('auto-close')) {
//$('.slide-in-filter').hide('slide', {direction: "left"}, 500, function () {
$('body').removeClass('wp-ln-open').css({'height': 'auto', 'overflow': 'auto'});
$('.wp-ln-overlay').hide();
$('.block-search, a.logo').css({'z-index': '10'});
//});
}
},
slideUpReset: function () {
var slideDownBlock = $('#layered-filter-block');
if(slideDownBlock.hasClass('auto-close')) {
//$('.wp-slide-down-add.active').off('click');
//$('.wp-slide-down-add:not(active)').on('click', self.lnSlideDown());
$('.wp-filters span.wp-slide-down-add').removeClass('active');
$('.products.wrapper').animate({marginTop: '0px'}, 1000);
$('.slide-down-filter').slideUp(1000);
$('.wp-filters').off('click');
} else {
$('.wp-filters span.wp-slide-down-add').removeClass('active');
$('.wp-filters').off('click');
}
},
markSelected: function () {
var elem = self.elem.parent();
if(elem.hasClass('wp-ln-selected')) {
elem.removeClass('wp-ln-selected');
} else {
elem.addClass('wp-ln-selected');
}
},
removeQueryStringParameter: function (key, url)
{
if (!url) url = window.location.href;
var hashParts = url.split('#'),
regex = new RegExp("([?&])" + key + "=.*?(&|#|$)", "i");
if (hashParts[0].match(regex)) {
url = hashParts[0].replace(regex, '$1');
url = url.replace(/([?&])$/, '');
if (typeof hashParts[1] !== 'undefined' && hashParts[1] !== null)
url += '#' + hashParts[1];
}
return url;
},
getUrlParams: function (url) {
var params = {
p: "1"
};
var parser = document.createElement('a');
parser.href = url;
var query = parser.search.substring(1);
var vars = query.split('&');
for (var i = 0; i < vars.length; i++) {
var pair = vars[i].split('=');
params[pair[0]] = decodeURIComponent(pair[1]);
}
return params;
}
});
return $.mage.productListToolbarForm;
});
@@ -0,0 +1,90 @@
define([
'jquery',
'mage/mage'
], function ($) {
"use strict";
let stickyFilters = {
options: {
mobileThreshold: '786',
isStickyFiltersEnabled: '0',
},
initialPosition: $('.block.filter').offset() && $('.block.filter').offset().top || 0,
init: function (mobileThreshold, isStickyFiltersEnabled) {
this.options.mobileThreshold = mobileThreshold;
this.options.isStickyFiltersEnabled = isStickyFiltersEnabled;
let that = this;
$(window).scroll(function () {
let screenWidth = $(window).width();
if (isStickyFiltersEnabled === '1' && (screenWidth >= mobileThreshold)) {
that.makeStickyFilters();
}
});
},
makeStickyFilters: function () {
let that = this,
horizontalFilters = $('.block.filter'),
sc = $(window).scrollTop(),
stickyMenuHeights = that.calculateStickyHeaderHeight(),
pageHeader = $('.page-wrapper div.sticky-header'),
containerShowLimit = that.initialPosition - stickyMenuHeights.outerHeight;
if (sc > containerShowLimit) {
pageHeader.addClass('no-box-shadow', 100);
horizontalFilters.addClass("sticky-filters filters-box-shadow");
horizontalFilters.css('top', stickyMenuHeights.height);
} else {
horizontalFilters.removeClass("sticky-filters filters-box-shadow");
pageHeader.removeClass('no-box-shadow', 100);
horizontalFilters.css('top', '');
}
},
calculateStickyHeaderHeight: function () {
let that = this,
headerSection = $('.page-wrapper div.page-header'),
navMenuSection = $('.page-wrapper div.sticky-header-nav'),
pageHeader = $('.page-wrapper div.sticky-header'),
stickyHeaderHeights = {
outerHeight: 0,
height: 0
};
switch (that.getHeaderVersion(headerSection)) {
case "v4":
if (headerSection.is(':visible') && navMenuSection.is(':visible')) {
stickyHeaderHeights.outerHeight = headerSection.outerHeight() + navMenuSection.outerHeight();
stickyHeaderHeights.height = navMenuSection.height() + $(".panel.wrapper").height();
}
break;
default :
if (pageHeader.is(':visible')) {
stickyHeaderHeights.height = pageHeader.height();
stickyHeaderHeights.outerHeight = pageHeader.height();
}
break;
}
return stickyHeaderHeights;
},
getHeaderVersion: function (headerSection) {
if (headerSection.hasClass('page-header-v1')) {
return 'v1';
} else if (headerSection.hasClass('page-header-v2')) {
return 'v2';
} else if (headerSection.hasClass('page-header-v3')) {
return 'v3';
} else if (headerSection.hasClass('page-header-v4')) {
return 'v4';
} else
return 'clean';
}
}
return stickyFilters;
});
@@ -0,0 +1,25 @@
define([
"jquery"
], function ($) {
"use strict";
window.wpFilterSelect = {
markSelected: function() {
$.each($('#wp_ln_shopby_items li'), function() {
var id = $(this).data('attr-id');
if(id) {
var filterElem = $('#wp_ln_attr_' + id);
var filterSwatchElem = $('#wp_ln_swatch_attr_' + id);
if(filterElem.length) {
filterElem.addClass('wp-ln-selected');
}
if(filterSwatchElem.length) {
filterSwatchElem.addClass('wp-ln-selected');
}
}
});
}
}
});
@@ -0,0 +1,30 @@
define([
"jquery"
], function ($) {
"use strict";
window.wpInstantSearch = {
searchOptions: function() {
$('.wp-instant-search-inp').keyup(function() {
var id, input, filter, li, a, i;
id = $(this).data('attr-id');
if(id) {
input = $('#instant_search_'+id);
filter = input.val().toUpperCase();
li = $('#'+ id + '_items li');
for (i = 0; i < li.length; i++) {
a = li[i].getElementsByTagName("a")[0];
if (a.innerText.toUpperCase().indexOf(filter) > -1) {
li[i].style.display = "";
} else {
li[i].style.display = "none";
}
}
}
})
}
}
});
@@ -0,0 +1,69 @@
define([
"jquery"
], function ($) {
"use strict";
window.wpShowMoreLess = {
initMoreLess: function() {
$(document).ready(function(){
$.each($('.wp-ln-actions'), function() {
var visibleItems = $(this).attr('data-visibleItems'),
visibleItemsStep = $(this).attr('data-visibleItemsStep'),
attrId = $(this).attr('data-attrId'),
elId = attrId + '_items',
ulSize = $('#' + elId + ' li').length,
loadMoreId = '#loadMore_' + attrId,
showLessId = '#showLess_' + attrId,
x = parseInt(visibleItems),
initialX = x,
xStep = parseInt(visibleItemsStep);
if(visibleItems > 0 && visibleItems.length > 0 && visibleItems < 99 && ulSize > visibleItems) {
$(loadMoreId).show();
$("#"+ elId + " li:lt(" + visibleItems + ")").show();
$(showLessId).hide();
} else {
$("#"+ elId + " li").show();
$(loadMoreId).hide();
$(showLessId).hide();
}
$(loadMoreId).click(function () {
if(xStep == 99) {
$('#' + elId + ' li:lt(' + ulSize + ')').show();
$(this).hide();
$(showLessId).show();
} else {
x = ( x + xStep <= ulSize) ? x + xStep : ulSize;
$('#' + elId + ' li:lt(' + x + ')').show();
if(ulSize == x){
$(this).hide();
$(showLessId).show();
}else{
$(showLessId).show();
}
}
});
$(showLessId).click(function () {
if(xStep == 99) {
$('#' + elId + ' li:gt(' + x + ')').hide();
$('#' + elId + ' li:eq(' + x + ')').hide();
$(this).hide();
$(loadMoreId).show();
} else {
x = ( x - xStep < 0 || x == ulSize) ? initialX : x - xStep;
$('#' + elId + ' li').not(':lt(' + x + ')').hide();
if(x <= visibleItems){
$(this).hide();
$(loadMoreId).show();
}else{
$(loadMoreId).show();
}
}
});
});
});
}
}
});