2012-10-14 43 views
2

我想在nopcommerce 2.65中的名为CustomerEnterPricePercentageSurcharge的目录设置中添加一个小数设置。我遵循How to Add New Setting Value in Customer settings线程的指示。如何在目录设置中添加新的设置值

但是,在上述线程中提到的3个步骤(下面列出并修改了目录设置)后,登录到管理部分并保存目录设置时,该值始终为0.0000。它似乎并未保存(或加载)“catalogsettings.customerenterpricepercentagesurcharge”设置值。有人能帮我澄清什么价值没有被保存?

  1. 更新Nop.Admin /模型/设置/ CatalogSettingsModel.cs与

    [NopResourceDisplayName("Admin.Configuration.Settings.Catalog.CustomerEnterPricePercentageSurcharge")] 
    public decimal CustomerEnterPricePercentageSurcharge { get; set; } 
    
  2. 更新Nop.Admin /浏览/设置/ Catalog.cshtml与

    <tr> 
        <td class="adminTitle"> 
         @Html.NopLabelFor(model => model.CustomerEnterPricePercentageSurcharge): 
        </td> 
        <td class="adminData"> 
         @Html.EditorFor(model => model.CustomerEnterPricePercentageSurcharge) 
         @Html.ValidationMessageFor(model => model.CustomerEnterPricePercentageSurcharge) 
        </td> 
    </tr> 
    
  3. 添加:

    "catalogsettings.customerenterpricepercentagesurcharge" under (configuration ->setting->AllSetting) and updating the 
    

非常感谢您的帮助。

回答

2

说实话,你真的没有在Nop.Admin/Views/Setting/Catalog.cshtml

创建一个新的领域你可以逃避这一切,根本:

  1. 中的所有设置添加一个新的价值。

  2. 然后使用它,只需添加一个新的领域:

    Nop.Core.Domain.Catalog.CatalogSettings

/// <summary> 
    /// Gets or sets a surcharge 
    /// </summary> 
    public decimal CustomerEnterPricePercentageSurcharge { get; set; } 
+0

感谢您的帮助卡洛斯。你的建议完美运作。 – maxdmvp