-
Notifications
You must be signed in to change notification settings - Fork 2
Customer Attributes
Code Slicer edited this page May 11, 2023
·
3 revisions
Allows managing eav attributes related to customers.
Use it as follows:
public function __construct(
Migration\Context $context,
private Migration\Facade\CustomerAttribute $customerAttribute
) {
parent::__construct($context);
}
Create a new attribute. Eg.:
// we suggest checking the available fields here: https://mage2gen.com/?main_version=4
$this->customerAttribute->create('fullname', [
'type' => 'text',
'label' => 'Full Name',
'input' => 'text',
'visible' => true,
'required' => false,
'user_defined' => false,
]);
Well, it's pretty much what the name implies. Eg.:
$this->customerAttribute->create('fullname', [
'required' => true,
]);
We want YOU for our community 🫵