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
Catalog
_files
product_text_attribute.php
Go to the documentation of this file.
1
<?php
8
$installer
=
\Magento\TestFramework\Helper\Bootstrap::getObjectManager
()
9
->create(\
Magento
\Catalog\Setup\CategorySetup::class);
11
$attribute
=
\Magento\TestFramework\Helper\Bootstrap::getObjectManager
()
12
->create(\
Magento
\Catalog\Model\
ResourceModel
\Eav\Attribute::class);
13
$attribute
->setData(
14
[
15
'attribute_code'
=>
'text_attribute'
,
16
'entity_type_id'
=>
$installer
->getEntityTypeId(
'catalog_product'
),
17
'is_global'
=> 1,
18
'is_user_defined'
=> 1,
19
'frontend_input'
=>
'textarea'
,
20
'is_unique'
=> 0,
21
'is_required'
=> 0,
22
'is_searchable'
=> 0,
23
'is_visible_in_advanced_search'
=> 0,
24
'is_comparable'
=> 0,
25
'is_filterable'
=> 0,
26
'is_filterable_in_search'
=> 0,
27
'is_used_for_promo_rules'
=> 0,
28
'is_html_allowed_on_front'
=> 1,
29
'is_visible_on_front'
=> 0,
30
'used_in_product_listing'
=> 0,
31
'used_for_sort_by'
=> 0,
32
'frontend_label'
=> [
'Text Attribute'
],
33
'backend_type'
=>
'text'
,
34
]
35
);
36
$attribute
->save();
37
/* Assign attribute to attribute set */
38
$installer
->addAttributeToGroup(
'catalog_product'
,
'Default'
,
'General'
,
$attribute
->getId());
Magento\Catalog\Model\ResourceModel\Product
Definition:
CollectionTest.php:6
$attribute
$attribute
Definition:
product_text_attribute.php:11
$installer
$installer
Definition:
product_text_attribute.php:8
Magento
Magento\TestFramework\Helper\Bootstrap\getObjectManager
static getObjectManager()
Definition:
Bootstrap.php:125