0

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.

Phoenix Kyaw
  • 332
  • 1
  • 5
  • 17

2 Answers2

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