About "Configurable customer attributes".

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.
Il y a 11 ans
In the feature list, I saw

4.  Configurable customer attributes (such as «Date of birth», «Phone number»)

But I cannot find any function that I can add my custom filed for customer in Admin area.

Does nopCommerce allow us to add custom attribute for customer?

e.g. I want to add a field called "Staff Number", do I have to change the database and modify the domain model?
Il y a 11 ans
You don't need to change the database - just use GenericAttribute
But, it will require custom coding in a few places (M,V,C).  E.g. \Presentation\Nop.Web\Administration\Controllers\CustomerController.cs

...

            model.Gender = customer.GetAttribute<string>(SystemCustomerAttributeNames.Gender);

           _genericAttributeService.SaveAttribute(customer, SystemCustomerAttributeNames.Gender, model.Gender);
This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.