0

I have a system where custom attributes were added in customer_grid_flat table.

That way, those attributes appear in Account Information tab of customer administration pages. However, when I try to save a data in them, data are not actually saved.

Customer attributes are note created in customer_entity table. Could that be the reason of why the attribute data are not saved? When creating custom attributes, should they be created in customer_entity table only? What is the goal of customer_grid_flat table?

Thanks

1 Answer 1

0

You will have to create custom attribute in a standard way for customer entity. If your custom attribute's data type is static then it will be visible in 'customer_entity" table otherwise it will visible in respective customer entity data type table (e.g. customer_entity_int for int data type).

The 'customer_grid_flat' table is an additional table in which you can add your custom attribute field to display it on admin customer grid with search and filter options.

I hope this help you to understand the core concept of custom attribute of customer entity. Once you follow this your custom attribute's value will start getting saved in the respective database table as explained.

1
  • Thanks.... key concept here is "static". the attribute is not static, so it was created in eav_attribute table. But now, is it possible to show this new attribute in the personal information area in registration form? I have seen the Magento templates and it seems it is not possible because register.phtml template contains all fields and the form_additional_info HTML is inserted at the end. The only solution I think is to override completely name.phtml widget. Am I right?
    – jstuardo
    Commented Jul 22, 2021 at 21:38

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.