I've created custom customer attribues

        $attributeCodes = [
            ['code' => 'customer_company' , 'label'=> 'Societe'],
            ['code' => 'customer_siret', 'label'=> 'Siret'],
            ['code' => 'customer_forme_juridique','label' => 'Forme Juridique'],
            ['code' => 'customer_tva', 'label' => 'TVA']
        foreach ($attributeCodes as $attr){
            $attributeCode = $attr['code'];
            $attributeLabel = $attr['label'];
                    'type'         => 'varchar',
                    'label'        => $attributeLabel,
                    'input'        => 'text',
                    'required'     => false,
                    'visible'      => true,
                    'user_defined' => true,
                    'position'     => 999,
                    'system'       => 0,
            $attribute = $this->eavConfig->getAttribute(Customer::ENTITY, $attributeCode);


THey are now appearing in the customer edit form.

But when I save them, I don't see any values saved in customer_entity_varchar for any of these attributes

That being said if i'm going to magento 2 core code : src/vendor/magento/module-customer/Controller/Adminhtml/Index/Save.php and dumping there

            $customerData = $this->_extractCustomerData();

At this point the total is in the customerData so I don't get why she isn't saved after all (I don't have any error message neither).

What am I missing there ?

1 Answer 1


you can take reference from this url


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.