Magento Extensions Rating 2024
EXTENSIONS BY CATEGORY
B2B (Business-To-Business)
Blog
Customer
ERP (Enterprise Resource Planning)
Mega Menu
One Step Checkout
Order
POS (Point Of Sale)
Search
Shopping Cart
Sitemap
SEO
Social
Stock & Inventory Management
EXTENSIONS BY DEVELOPER
aheadWorks
Amasty
Boost My Shop
BSS Commerce
Magestore
MageWorx
Mirasvit
Templates Master
Wyomind
XTENTO
Magento 2 Documentation
Magento 2 Documentation
2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
vendor
magento
module-layered-navigation
Observer
Grid
ProductAttributeGridBuildObserver.php
Go to the documentation of this file.
1
<?php
8
namespace
Magento\LayeredNavigation\Observer\Grid
;
9
10
use
Magento\Framework\Module\Manager
;
11
use
Magento\Framework\Event\ObserverInterface
;
12
13
class
ProductAttributeGridBuildObserver
implements
ObserverInterface
14
{
18
protected
$moduleManager
;
19
23
public
function
__construct
(
Manager
$moduleManager
)
24
{
25
$this->moduleManager =
$moduleManager
;
26
}
27
32
public
function
execute
(\
Magento
\Framework\Event\Observer
$observer
)
33
{
34
if
(!$this->moduleManager->isOutputEnabled(
'Magento_LayeredNavigation'
)) {
35
return
;
36
}
37
39
$grid =
$observer
->getGrid();
40
41
$grid->addColumnAfter(
42
'is_filterable'
,
43
[
44
'header'
=>
__
(
'Use in Layered Navigation'
),
45
'sortable'
=>
true
,
46
'index'
=>
'is_filterable'
,
47
'type'
=>
'options'
,
48
'options'
=> [
49
'1'
=>
__
(
'Filterable (with results)'
),
50
'2'
=>
__
(
'Filterable (no results)'
),
51
'0'
=>
__
(
'No'
),
52
],
53
'align'
=>
'center'
,
54
],
55
'is_searchable'
56
);
57
}
58
}
Magento\LayeredNavigation\Observer\Grid\ProductAttributeGridBuildObserver\__construct
__construct(Manager $moduleManager)
Definition:
ProductAttributeGridBuildObserver.php:23
Magento\LayeredNavigation\Observer\Grid
Definition:
ProductAttributeGridBuildObserver.php:8
Magento\LayeredNavigation\Observer\Grid\ProductAttributeGridBuildObserver\$moduleManager
$moduleManager
Definition:
ProductAttributeGridBuildObserver.php:18
Magento\Framework\Event\ObserverInterface
Definition:
ObserverInterface.php:16
__
__()
Definition:
__.php:13
$observer
$observer
Definition:
second_website_with_second_currency.php:38
Magento\LayeredNavigation\Observer\Grid\ProductAttributeGridBuildObserver
Definition:
ProductAttributeGridBuildObserver.php:13
Magento
Magento\Framework\Module\Manager
Definition:
Manager.php:20
Magento\Framework\Event\ObserverInterface\execute
execute(Observer $observer)