Skip to content

Commit dbe40df

Browse files
Merge pull request #4 from mageplaza/develop
Release v1.0.3
2 parents 6483a45 + 73530b5 commit dbe40df

File tree

7 files changed

+48
-38
lines changed

7 files changed

+48
-38
lines changed

Controller/Search/Result/Index.php

Lines changed: 9 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ class Index extends Action
5555
protected $_jsonHelper;
5656

5757
/**
58-
* @type \Mageplaza\LayeredNavigation\Helper\Data
58+
* @var HelperData
5959
*/
6060
protected $_moduleHelper;
6161

@@ -98,13 +98,13 @@ public function __construct(
9898
JsonData $jsonHelper,
9999
HelperData $moduleHelper
100100
) {
101-
$this->_storeManager = $storeManager;
101+
$this->_storeManager = $storeManager;
102102
$this->_catalogSession = $catalogSession;
103-
$this->_queryFactory = $queryFactory;
104-
$this->layerResolver = $layerResolver;
105-
$this->_jsonHelper = $jsonHelper;
106-
$this->_moduleHelper = $moduleHelper;
107-
$this->_helper = $helper;
103+
$this->_queryFactory = $queryFactory;
104+
$this->layerResolver = $layerResolver;
105+
$this->_jsonHelper = $jsonHelper;
106+
$this->_moduleHelper = $moduleHelper;
107+
$this->_helper = $helper;
108108

109109
parent::__construct($context);
110110
}
@@ -126,7 +126,6 @@ public function execute()
126126
$query->setId(0)->setIsActive(1)->setIsProcessed(1);
127127
} else {
128128
$query->saveIncrementalPopularity();
129-
130129
if ($query->getRedirect()) {
131130
$this->getResponse()->setRedirect($query->getRedirect());
132131

@@ -139,8 +138,8 @@ public function execute()
139138

140139
if ($this->_moduleHelper->ajaxEnabled() && $this->getRequest()->isAjax()) {
141140
$navigation = $this->_view->getLayout()->getBlock('catalogsearch.leftnav');
142-
$products = $this->_view->getLayout()->getBlock('search.result');
143-
$result = [
141+
$products = $this->_view->getLayout()->getBlock('search.result');
142+
$result = [
144143
'products' => $products->toHtml(),
145144
'navigation' => $navigation->toHtml()
146145
];

Plugin/Controller/Category/View.php

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -30,10 +30,14 @@
3030
*/
3131
class View
3232
{
33-
/** @var Data */
33+
/**
34+
* @var Data
35+
*/
3436
protected $_jsonHelper;
3537

36-
/** @var \Mageplaza\LayeredNavigation\Helper\Data */
38+
/**
39+
* @var LayerData
40+
*/
3741
protected $_moduleHelper;
3842

3943
/**
@@ -60,10 +64,14 @@ public function afterExecute(\Magento\Catalog\Controller\Category\View $action,
6064
{
6165
if ($this->_moduleHelper->ajaxEnabled() && $action->getRequest()->isAjax()) {
6266
$navigation = $page->getLayout()->getBlock('catalog.leftnav');
63-
$products = $page->getLayout()->getBlock('category.products');
67+
$products = $page->getLayout()->getBlock('category.products');
6468
if ($this->_moduleHelper->getConfigValue('mpquickview/general/enabled')) {
6569
$quickView = $page->getLayout()->getBlock('mpquickview.quickview');
66-
$result = ['products' => $products->toHtml(), 'navigation' => $navigation->toHtml(), 'quickview' => $quickView->toHtml()];
70+
$result = [
71+
'products' => $products->toHtml(),
72+
'navigation' => $navigation->toHtml(),
73+
'quickview' => $quickView->toHtml()
74+
];
6775
} else {
6876
$result = ['products' => $products->toHtml(), 'navigation' => $navigation->toHtml()];
6977
}

UserGuide.pdf

-1.78 KB
Binary file not shown.

composer.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,10 @@
22
"name": "mageplaza/module-ajax-layered-navigation",
33
"description": "Magento 2 Ajax Layered Navigation Extension",
44
"require": {
5-
"mageplaza/module-core": "^1.4.0"
5+
"mageplaza/module-core": "^1.4.4"
66
},
77
"type": "magento2-module",
8-
"version": "1.0.2",
8+
"version": "1.0.3",
99
"license": "proprietary",
1010
"authors": [
1111
{

view/frontend/templates/layer.phtml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,6 @@
2121
?>
2222

2323
<div id="layered-filter-block-container" class="layered-filter-block-container">
24-
<?php echo $block->getChildHtml() ?>
24+
<?= /** @noEscape */ $block->getChildHtml() ?>
2525
</div>
2626

view/frontend/templates/layer/view.phtml

Lines changed: 23 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -29,18 +29,18 @@
2929
data-mage-init='{"collapsible":{"openedState": "active", "collapsible": true, "active": false, "collateral": { "openedState": "filter-active", "element": "body" } }}'>
3030
<div id="ln_overlay" class="ln_overlay">
3131
<div class="loader">
32-
<img src="<?php echo $block->getViewFileUrl('images/loader-1.gif'); ?>" alt="Loading...">
32+
<img src="<?= /** @noEscape */ $block->getViewFileUrl('images/loader-1.gif') ?>" alt="Loading...">
3333
</div>
3434
</div>
35-
<div class="block-title filter-title" data-count="<?php echo $filtered; ?>">
36-
<strong data-role="title"><?php echo __('Shop By') ?></strong>
35+
<div class="block-title filter-title" data-count="<?= /** @noEscape */ $filtered ?>">
36+
<strong data-role="title"><?= /** @noEscape */ __('Shop By') ?></strong>
3737
</div>
3838
<div class="block-content filter-content">
39-
<?php echo $block->getChildHtml('state') ?>
39+
<?= /** @noEscape */ $block->getChildHtml('state') ?>
4040
<?php if ($block->getLayer()->getState()->getFilters()) : ?>
4141
<div class="block-actions filter-actions">
42-
<a href="<?php echo $block->getClearUrl() ?>" class="action clear filter-clear">
43-
<span><?php echo __('Clear All') ?></span>
42+
<a href="<?= /** @noEscape */ $block->getClearUrl() ?>" class="action clear filter-clear">
43+
<span><?= /** @noEscape */ __('Clear All') ?></span>
4444
</a>
4545
</div>
4646
<?php endif; ?>
@@ -49,32 +49,35 @@
4949
<?php if ($filter->getItemsCount()) : ?>
5050
<?php if (!$wrapOptions) : ?>
5151
<strong role="heading" aria-level="2" class="block-subtitle filter-subtitle">
52-
<?php echo __('Shopping Options') ?>
52+
<?= /** @noEscape */ __('Shopping Options') ?>
5353
</strong>
5454
<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>
55+
<?php $wrapOptions = true;
56+
endif; ?>
57+
<div data-role="ln_collapsible" class="filter-options-item"
58+
attribute="<?= /** @noEscape */ $filter->getRequestVar() ?>">
59+
<div data-role="ln_title" class="filter-options-title"><?= /** @noEscape */ __($filter->getName()) ?></div>
60+
<div data-role="ln_content" class="filter-options-content">
61+
<?= /** @noEscape */ $block->getChildBlock('renderer')->setFilter($filter)->render($filter); ?>
6062
</div>
63+
</div>
6164
<?php endif; ?>
6265
<?php endforeach; ?>
6366
<?php if ($wrapOptions) : ?>
6467
</div>
6568
<?php else : ?>
66-
<script>
67-
require([
68-
'jquery'
69-
], function ($) {
70-
$('#layered-filter-block').addClass('filter-no-options');
71-
});
72-
</script>
69+
<script>
70+
require([
71+
'jquery'
72+
], function ($) {
73+
$('#layered-filter-block').addClass('filter-no-options');
74+
});
75+
</script>
7376
<?php endif; ?>
7477
<script type="text/x-magento-init">
7578
{
7679
".block-content.filter-content":{
77-
"mpAjax": <?php echo $layerConfig ?>
80+
"mpAjax": <?= /** @noEscape */ $layerConfig ?>
7881
}
7982
}
8083
</script>

view/frontend/templates/products.phtml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,5 +21,5 @@
2121
?>
2222

2323
<div id="layer-product-list">
24-
<?php echo $block->getChildHtml() ?>
24+
<?= /** @noEscape */ $block->getChildHtml() ?>
2525
</div>

0 commit comments

Comments
 (0)