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
magento2-base
dev
tests
integration
testsuite
Magento
CatalogSearch
_files
searchable_attribute.php
Go to the documentation of this file.
1
<?php
6
declare(strict_types=1);
7
8
$objectManager
=
\Magento\TestFramework\Helper\Bootstrap::getObjectManager
();
9
$eavSetupFactory
=
$objectManager
->create(\
Magento
\Eav\Setup\EavSetupFactory::class);
11
$eavSetup
=
$eavSetupFactory
->create();
12
$eavSetup
->addAttribute(
13
\
Magento
\Catalog\Model\Product::ENTITY,
14
'test_searchable_attribute'
,
15
[
16
'label'
=>
'Test-attribute'
,
17
'global'
=> \
Magento
\Catalog\Model\
ResourceModel
\Eav\Attribute::SCOPE_STORE,
18
'required'
=> 0,
19
'user_defined'
=> 1,
20
'searchable'
=> 1,
21
'visible_on_front'
=> 1,
22
'filterable_in_search'
=> 1,
23
'used_in_product_listing'
=> 1,
24
'is_used_in_grid'
=> 1,
25
'is_filterable_in_grid'
=> 1,
26
]
27
);
Magento\Catalog\Model\ResourceModel\Product
Definition:
CollectionTest.php:6
$eavSetupFactory
$eavSetupFactory
Definition:
searchable_attribute.php:9
$eavSetup
$eavSetup
Definition:
searchable_attribute.php:11
Magento
$objectManager
$objectManager
Definition:
searchable_attribute.php:8
Magento\TestFramework\Helper\Bootstrap\getObjectManager
static getObjectManager()
Definition:
Bootstrap.php:125