I think The CustomerAttributeValue table is more for the UI side, and contains the 'valid values' - e.g. the drop-down or radio-button items that the customer sees/selects when you configure a CustomerAttribute to be of those types.
asenol70 wrote:
When I look into original source code downloaded from nopcommerce version 4.3
There is a file NopCustomerDefaults.cs. In the file FirstName and LastName are defined as generic attributes.
But they are not custom attributes (they are not defined by person using nopcommerce admin panel), and also they are not fields (columns) of Customer table.
Then where on earth they are tied to database? Where do the following code get data from (a code line of payment plugin)?
nopc43\Libraries\Nop.Core\Domain\Customers\NopCustomerDefaults.cs
When I look at http://localhost:15536/Admin/Setting/CustomerUser in admin panel of nopcommerce, there is no custom attribute defined for customer.
Also in SSMS, no rows returned from the query below
What is the purpose of NopCustomerDefaults.cs file?
There is a file NopCustomerDefaults.cs. In the file FirstName and LastName are defined as generic attributes.
But they are not custom attributes (they are not defined by person using nopcommerce admin panel), and also they are not fields (columns) of Customer table.
Then where on earth they are tied to database? Where do the following code get data from (a code line of payment plugin)?
var customerName = _genericAttributeService.GetAttribute<string>(customer, NopCustomerDefaults.FirstNameAttribute);
nopc43\Libraries\Nop.Core\Domain\Customers\NopCustomerDefaults.cs
#region Customer attributes
/// <summary>
/// Gets a name of generic attribute to store the value of 'FirstName'
/// </summary>
public static string FirstNameAttribute => "FirstName";
/// <summary>
/// Gets a name of generic attribute to store the value of 'LastName'
/// </summary>
public static string LastNameAttribute => "LastName";
/// <summary>
/// Gets a name of generic attribute to store the value of 'Gender'
/// </summary>
public static string GenderAttribute => "Gender";
When I look at http://localhost:15536/Admin/Setting/CustomerUser in admin panel of nopcommerce, there is no custom attribute defined for customer.
Also in SSMS, no rows returned from the query below
SELECT [Id] ,[Name],[IsRequired] ,[AttributeControlTypeId] ,[DisplayOrder]
FROM [nopcom].[dbo].[CustomerAttribute]
What is the purpose of NopCustomerDefaults.cs file?