I've been trying to add a field to table Address, it all seems fine and no errors on build, however the issue is the value is not being saved into the databse. So I guess I am missing a mapping, but I can not find it... Anyone can help shed a light?
I have used this as a template:
https://www.nopcommerce.com/docs/73/updating-an-existing-entity-how-to-add-a-new-property.aspx
What I have added to the database/source
DB
Database Change
Added column "MarketingOk" with navchar(10), null allowed.
Used MSSQL 2008 R2's Server management studo.
Domain
\Libraries\Nop.Core\Domain\Common\Address.cs
public virtual string MarketingOk { get; set; }
and in the public Clone...
MarketingOk = this.MarketingOk,
Mapping
\Libraries\Nop.Data\Mapping\Common\AddressMap.cs
this.Property(a => a.MarketingOk).HasMaxLength(10);
Model
\Presentation\Nop.Web\Models\Common\AddressModel.cs
[NopResourceDisplayName("Address.Fields.MarketingOk")]
[AllowHtml]
public string MarketingOk { get; set; }
Views
\Presentation\Nop.Web\Views\Shared\_CreateOrUpdateAddress.cshtml
Added these in the address table, under email..
@Html.LabelFor(model => model.MarketingOk)
@Html.EditorFor(model => model.MarketingOk)
@Html.ValidationMessageFor(model => model.MarketingOk)
Thank you so much for any help...