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
Customer
_files
attribute_user_defined_custom_attribute.php
Go to the documentation of this file.
1
<?php
7
$objectManager
=
\Magento\TestFramework\Helper\Bootstrap::getObjectManager
();
8
10
$attribute1
=
$objectManager
->create(\
Magento
\Customer\Model\Attribute::class);
11
$attribute1
->setName(
12
'custom_attribute1'
13
)->setEntityTypeId(
14
1
15
)->setIsUserDefined(
16
1
17
)->setAttributeSetId(
18
1
19
)->setAttributeGroupId(
20
1
21
)->setFrontendInput(
22
'text'
23
)->setFrontendLabel(
24
'custom_attribute_frontend_label'
25
)->setBackendType(
26
'varchar'
27
)->setSortOrder(
28
1221
29
)->save();
30
32
$attribute2
=
$objectManager
->create(\
Magento
\Customer\Model\Attribute::class);
33
$attribute2
->setName(
34
'custom_attribute2'
35
)->setEntityTypeId(
36
1
37
)->setIsUserDefined(
38
1
39
)->setAttributeSetId(
40
1
41
)->setAttributeGroupId(
42
1
43
)->setFrontendInput(
44
'text'
45
)->setFrontendLabel(
46
'custom_attributes_frontend_label'
47
)->setSortOrder(
48
1222
49
)->save();
50
52
$attribute3
=
$objectManager
->create(\
Magento
\Customer\Model\Attribute::class);
53
$attribute3
->setName(
54
'customer_image'
55
)->setEntityTypeId(
56
1
57
)->setIsUserDefined(
58
1
59
)->setAttributeSetId(
60
1
61
)->setAttributeGroupId(
62
1
63
)->setFrontendInput(
64
'image'
65
)->setFrontendLabel(
66
'customer_image'
67
)->setBackendType(
68
'varchar'
69
)->setSortOrder(
70
1223
71
)->save();
$attribute1
$attribute1
Definition:
attribute_user_defined_custom_attribute.php:10
$objectManager
$objectManager
Definition:
attribute_user_defined_custom_attribute.php:7
Magento
$attribute2
$attribute2
Definition:
attribute_user_defined_custom_attribute.php:32
$attribute3
$attribute3
Definition:
attribute_user_defined_custom_attribute.php:52
Magento\TestFramework\Helper\Bootstrap\getObjectManager
static getObjectManager()
Definition:
Bootstrap.php:125