I want to add new setting value in Customer settings Page(/Admin/Setting/CustomerUser) after installed nopcommerce 2.5.How can I do?I got nopcommerce 2.5 source code.I'm finding the ways to customize Customer settings Page to add new seeting value.
Asked
Active
Viewed 1,433 times
2 Answers
2
you can add it in AllSetting section under configuration (configuration ->setting->AllSetting)

Shivkumar
- 1,903
- 5
- 21
- 32
1
you need to add new property in CustomerSettingsModel e.g
//Nop.Admin/Models/Setting/
public bool ZipCodeEnbale{get;set}
then add control for it in CustomerUser.cshtml
//Nop.Admin/Views/Setting/
<tr>
<td class="adminTitle">
@Html.NopLabelFor(model => model.CustomerSettings.ZipCodeEnbale):
</td>
<td class="adminData">
@Html.EditorFor(model => model.CustomerSettings.ZipCodeEnbale)
@Html.ValidationMessageFor(model => model.CustomerSettings.ZipCodeEnbale)
</td>
</tr>
after run the application you will see new property will add under Admin/Customer setting page in CustomerSeeting tab.
Note: if you ant to set default value to property while installing nopcommerec then you need to some additional chnages in InstallationService.cs in (Nop.Service) add new property value in CustomerSettings under InstallSettings method. e.g
EngineContext.Current.Resolve<IConfigurationProvider<CustomerSettings>>()
.SaveSettings(new CustomerSettings()
{
ZipCodeEnbale= true,
}

Shivkumar
- 1,903
- 5
- 21
- 32
-
I want to know also how to add it after installed nopCommerence application. – Phoenix Kyaw Sep 21 '12 at 04:29
-
you may need to add @using Nop.Core.Infrastructure; for EngineContext – Nitin Nov 12 '16 at 13:06