init
This commit is contained in:
+65
@@ -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; ?>
|
||||
Reference in New Issue
Block a user