|
22 | 22 | <?php if ($block->canShowBlock()) : ?> |
23 | 23 | <?php |
24 | 24 | $filters = $block->getFilters(); |
25 | | - $layerConfig = $this->helper('Mageplaza\AjaxLayer\Helper\Data')->getLayerConfiguration($filters); |
| 25 | + $layerConfig = $this->helper(\Mageplaza\AjaxLayer\Helper\Data::class)->getLayerConfiguration($filters); |
26 | 26 | $filtered = count($block->getLayer()->getState()->getFilters()); |
27 | 27 | ?> |
28 | 28 | <div class="block filter" id="layered-filter-block" |
|
32 | 32 | <img src="<?php echo $block->getViewFileUrl('images/loader-1.gif'); ?>" alt="Loading..."> |
33 | 33 | </div> |
34 | 34 | </div> |
35 | | - <div class="block-title filter-title" data-count="<?php /* @escapeNotVerified */ |
36 | | - echo $filtered; ?>"> |
37 | | - <strong data-role="title"><?php /* @escapeNotVerified */ |
38 | | - echo __('Shop By') ?></strong> |
| 35 | + <div class="block-title filter-title" data-count="<?php echo $filtered; ?>"> |
| 36 | + <strong data-role="title"><?php echo __('Shop By') ?></strong> |
39 | 37 | </div> |
40 | 38 | <div class="block-content filter-content"> |
41 | 39 | <?php echo $block->getChildHtml('state') ?> |
42 | 40 | <?php if ($block->getLayer()->getState()->getFilters()) : ?> |
43 | 41 | <div class="block-actions filter-actions"> |
44 | | - <a href="<?php /* @escapeNotVerified */ |
45 | | - echo $block->getClearUrl() ?>" |
46 | | - class="action clear filter-clear"><span><?php /* @escapeNotVerified */ |
47 | | - echo __('Clear All') ?></span></a> |
| 42 | + <a href="<?php echo $block->getClearUrl() ?>" class="action clear filter-clear"> |
| 43 | + <span><?php echo __('Clear All') ?></span> |
| 44 | + </a> |
48 | 45 | </div> |
49 | 46 | <?php endif; ?> |
50 | 47 | <?php $wrapOptions = false; ?> |
51 | | - <?php foreach ($filters |
52 | | - |
53 | | - as $key => $filter) : ?> |
54 | | - <?php if ($filter->getItemsCount()) : ?> |
55 | | - <?php if (!$wrapOptions) : ?> |
56 | | - <strong role="heading" aria-level="2" |
57 | | - class="block-subtitle filter-subtitle"><?php echo __('Shopping Options') ?></strong> |
58 | | - <div class="filter-options" id="narrow-by-list" data-role="content"> |
59 | | - <?php $wrapOptions = true; |
60 | | - endif; ?> |
61 | | - <div data-role="ln_collapsible" class="filter-options-item" |
62 | | - attribute="<?php echo $filter->getRequestVar() ?>"> |
63 | | - <div data-role="ln_title" class="filter-options-title"><?php /* @escapeNotVerified */ |
64 | | - echo __($filter->getName()) ?></div> |
65 | | - <div data-role="ln_content" class="filter-options-content"><?php /* @escapeNotVerified */ |
66 | | - echo $block->getChildBlock('renderer')->setFilter($filter)->render($filter); ?></div> |
67 | | - </div> |
| 48 | + <?php foreach ($filters as $key => $filter) : ?> |
| 49 | + <?php if ($filter->getItemsCount()) : ?> |
| 50 | + <?php if (!$wrapOptions) : ?> |
| 51 | + <strong role="heading" aria-level="2" class="block-subtitle filter-subtitle"> |
| 52 | + <?php echo __('Shopping Options') ?> |
| 53 | + </strong> |
| 54 | + <div class="filter-options" id="narrow-by-list" data-role="content"> |
| 55 | + <?php $wrapOptions = true; |
| 56 | + endif; ?> |
| 57 | + <div data-role="ln_collapsible" class="filter-options-item" attribute="<?php echo $filter->getRequestVar() ?>"> |
| 58 | + <div data-role="ln_title" class="filter-options-title"><?php echo __($filter->getName()) ?></div> |
| 59 | + <div data-role="ln_content" class="filter-options-content"><?php echo $block->getChildBlock('renderer')->setFilter($filter)->render($filter); ?></div> |
| 60 | + </div> |
68 | 61 | <?php endif; ?> |
69 | | - <?php endforeach; ?> |
70 | | - <?php if ($wrapOptions) : ?> |
71 | | - </div> |
72 | | - <?php else : ?> |
73 | | - <script> |
74 | | - require([ |
75 | | - 'jquery' |
76 | | - ], function ($) { |
77 | | - $('#layered-filter-block').addClass('filter-no-options'); |
78 | | - }); |
79 | | - </script> |
| 62 | + <?php endforeach; ?> |
| 63 | + <?php if ($wrapOptions) : ?> |
| 64 | + </div> |
| 65 | + <?php else : ?> |
| 66 | + <script> |
| 67 | + require([ |
| 68 | + 'jquery' |
| 69 | + ], function ($) { |
| 70 | + $('#layered-filter-block').addClass('filter-no-options'); |
| 71 | + }); |
| 72 | + </script> |
80 | 73 | <?php endif; ?> |
81 | | - |
82 | 74 | <script type="text/x-magento-init"> |
83 | 75 | { |
84 | 76 | ".block-content.filter-content":{ |
85 | 77 | "mpAjax": <?php echo $layerConfig ?> |
86 | 78 | } |
87 | 79 | } |
88 | | - |
89 | 80 | </script> |
90 | 81 | </div> |
91 | 82 | </div> |
|
0 commit comments