1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283 |
- <?php
- /**
- * Mageplaza
- *
- * NOTICE OF LICENSE
- *
- * This source file is subject to the Mageplaza.com license that is
- * available through the world-wide-web at this URL:
- * https://www.mageplaza.com/LICENSE.txt
- *
- * DISCLAIMER
- *
- * Do not edit or add to this file if you wish to upgrade this extension to newer
- * version in the future.
- *
- * @category Mageplaza
- * @package Mageplaza_AjaxLayer
- * @copyright Copyright (c) Mageplaza (http://www.mageplaza.com/)
- * @license https://www.mageplaza.com/LICENSE.txt
- */
- ?>
- <?php if ($block->canShowBlock()): ?>
- <?php
- $filters = $block->getFilters();
- $layerConfig = $this->helper('Mageplaza\AjaxLayer\Helper\Data')->getLayerConfiguration($filters);
- $filtered = count($block->getLayer()->getState()->getFilters());
- ?>
- <div class="block filter" id="layered-filter-block"
- data-mage-init='{"collapsible":{"openedState": "active", "collapsible": true, "active": false, "collateral": { "openedState": "filter-active", "element": "body" } }}'>
- <div id="ln_overlay" class="ln_overlay">
- <div class="loader">
- <img src="<?php echo $block->getViewFileUrl('images/loader-1.gif'); ?>" alt="Loading...">
- </div>
- </div>
- <div class="block-title filter-title" data-count="<?php /* @escapeNotVerified */ echo $filtered; ?>">
- <strong data-role="title"><?php /* @escapeNotVerified */ echo __('Shop By') ?></strong>
- </div>
- <div class="block-content filter-content">
- <?php echo $block->getChildHtml('state') ?>
- <?php if ($block->getLayer()->getState()->getFilters()): ?>
- <div class="block-actions filter-actions">
- <a href="<?php /* @escapeNotVerified */ echo $block->getClearUrl() ?>"
- class="action clear filter-clear"><span><?php /* @escapeNotVerified */ echo __('Clear All') ?></span></a>
- </div>
- <?php endif; ?>
- <?php $wrapOptions = false; ?>
- <?php foreach ($filters as $key => $filter): ?>
- <?php if ($filter->getItemsCount()): ?>
- <?php if (!$wrapOptions): ?>
- <strong role="heading" aria-level="2"
- class="block-subtitle filter-subtitle"><?php echo __('Shopping Options') ?></strong>
- <div class="filter-options" id="narrow-by-list" data-role="content">
- <?php $wrapOptions = true;
- endif; ?>
- <div data-role="ln_collapsible" class="filter-options-item"
- attribute="<?php echo $filter->getRequestVar() ?>">
- <div data-role="ln_title" class="filter-options-title"><?php /* @escapeNotVerified */ echo __($filter->getName()) ?></div>
- <div data-role="ln_content" class="filter-options-content"><?php /* @escapeNotVerified */ echo $block->getChildBlock('renderer')->setFilter($filter)->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; ?>
- <script type="text/x-magento-init">
- {
- ".block-content.filter-content":{
- "mpAjax": <?php echo $layerConfig ?>
- }
- }
- </script>
- </div>
- </div>
- <?php endif; ?>
|