ok, in the view i've added this:
Nop/Web/View/Custommer/Register.cshtml
<tr class="row">
<td class="item-name">
@Html.LabelFor(model => model.Title):
</td>
<td class="item-value">
@Html.EditorFor(model => model.Title)
@Html.ValidationMessageFor(model => model.Title)
</td>
</tr>
the map :
nop.core.domain.customers.customer.cs
i've added this line in the posicion 168.
public virtual string Title { get; set; }
the register action in customer:
[HttpPost]
[CaptchaValidator]
public ActionResult Register(RegisterModel model, bool? captchaValid)
{
//check whether registration is allowed
if (_customerSettings.UserRegistrationType == UserRegistrationType.Disabled)
return RedirectToRoute("RegisterResult", new { resultId = (int)UserRegistrationType.Disabled });
if (_workContext.CurrentCustomer.IsRegistered())
{
//Already registered customer.
_authenticationService.SignOut();
//Save a new record
_workContext.CurrentCustomer = _customerService.InsertGuestCustomer();
}
var customer = _workContext.CurrentCustomer;
if (captchaValid.HasValue && !captchaValid.Value)
ModelState.AddModelError("", _localizationService.GetResource("Common.WrongCaptcha"));
if (ModelState.IsValid)
{
bool isApproved = _customerSettings.UserRegistrationType == UserRegistrationType.Standard;
var registrationRequest = new CustomerRegistrationRequest(customer, model.Email,
_customerSettings.UsernamesEnabled ? model.Username : model.Email, model.Password, PasswordFormat.Hashed, isApproved);
var registrationResult = _customerService.RegisterCustomer(registrationRequest);
if (registrationResult.Success)
{
//properties
if (_dateTimeSettings.AllowCustomersToSetTimeZone)
customer.TimeZoneId = model.TimeZoneId;
//VAT number
if (_taxSettings.EuVatEnabled)
{
customer.VatNumber = model.VatNumber;
string vatName = string.Empty;
string vatAddress = string.Empty;
customer.VatNumberStatus = _taxService.GetVatNumberStatus(customer.VatNumber, out vatName, out vatAddress);
//send VAT number admin notification
if (!String.IsNullOrEmpty(customer.VatNumber) && _taxSettings.EuVatEmailAdminWhenNewVatSubmitted)
_workflowMessageService.SendNewVatSubmittedStoreOwnerNotification(customer, customer.VatNumber, vatAddress, _localizationSettings.DefaultAdminLanguageId);
}
//save
_customerService.UpdateCustomer(customer);
//form fields
if (_customerSettings.GenderEnabled)
_customerService.SaveCustomerAttribute(customer, SystemCustomerAttributeNames.Gender, model.Gender);
_customerService.SaveCustomerAttribute(customer, SystemCustomerAttributeNames.FirstName, model.FirstName);
_customerService.SaveCustomerAttribute(customer, SystemCustomerAttributeNames.LastName, model.LastName);
if (_customerSettings.DateOfBirthEnabled)
{
DateTime? dateOfBirth = null;
try
{
dateOfBirth = new DateTime(model.DateOfBirthYear.Value, model.DateOfBirthMonth.Value, model.DateOfBirthDay.Value);
}
catch { }
_customerService.SaveCustomerAttribute(customer, SystemCustomerAttributeNames.DateOfBirth, dateOfBirth);
}
if (_customerSettings.CompanyEnabled)
_customerService.SaveCustomerAttribute(customer, SystemCustomerAttributeNames.Company, model.Company);
if (_customerSettings.NewsletterEnabled)
{
//save newsletter value
var newsletter = _newsLetterSubscriptionService.GetNewsLetterSubscriptionByEmail(model.Email);
if (newsletter != null)
{
if (model.Newsletter)
{
newsletter.Active = true;
_newsLetterSubscriptionService.UpdateNewsLetterSubscription(newsletter);
}
else
_newsLetterSubscriptionService.DeleteNewsLetterSubscription(newsletter);
}
else
{
if (model.Newsletter)
{
_newsLetterSubscriptionService.InsertNewsLetterSubscription(new NewsLetterSubscription()
{
NewsLetterSubscriptionGuid = Guid.NewGuid(),
Email = model.Email,
Active = true,
CreatedOnUtc = DateTime.UtcNow
});
}
}
}
if (_customerSettings.ShowCustomersLocation)
{
_customerService.SaveCustomerAttribute(customer, SystemCustomerAttributeNames.LocationCountryId, model.LocationCountryId);
}
//login customer now
if (isApproved)
_authenticationService.SignIn(customer, true);
//associated with external account (if possible)
TryAssociateAccountWithExternalAccount(customer);
//notifications
if (_customerSettings.NotifyNewCustomerRegistration)
_workflowMessageService.SendCustomerRegisteredNotificationMessage(customer, _localizationSettings.DefaultAdminLanguageId);
switch (_customerSettings.UserRegistrationType)
{
case UserRegistrationType.EmailValidation:
{
//email validation message
_customerService.SaveCustomerAttribute(customer, SystemCustomerAttributeNames.AccountActivationToken, Guid.NewGuid().ToString());
_workflowMessageService.SendCustomerEmailValidationMessage(customer, _workContext.WorkingLanguage.Id);
//result
return RedirectToRoute("RegisterResult", new { resultId = (int)UserRegistrationType.EmailValidation });
}
break;
case UserRegistrationType.AdminApproval:
{
return RedirectToRoute("RegisterResult", new { resultId = (int)UserRegistrationType.AdminApproval });
}
break;
case UserRegistrationType.Standard:
{
//send customer welcome message
_workflowMessageService.SendCustomerWelcomeMessage(customer, _workContext.WorkingLanguage.Id);
return RedirectToRoute("RegisterResult", new { resultId = (int)UserRegistrationType.Standard });
}
break;
default:
{
return RedirectToAction("Index", "Home");
}
break;
}
}
else
{
foreach (var error in registrationResult.Errors)
ModelState.AddModelError("", error);
}
}
//If we got this far, something failed, redisplay form
model.AllowCustomersToSetTimeZone = _dateTimeSettings.AllowCustomersToSetTimeZone;
foreach (var tzi in _dateTimeHelper.GetSystemTimeZones())
model.AvailableTimeZones.Add(new SelectListItem() { Text = tzi.DisplayName, Value = tzi.Id, Selected = (tzi.Id == _dateTimeHelper.DefaultStoreTimeZone.Id) });
model.DisplayVatNumber = _taxSettings.EuVatEnabled;
//form fields
model.GenderEnabled = _customerSettings.GenderEnabled;
model.CompanyEnabled = _customerSettings.CompanyEnabled;
model.NewsletterEnabled = _customerSettings.NewsletterEnabled;
model.DateOfBirthEnabled = _customerSettings.DateOfBirthEnabled;
model.UsernamesEnabled = _customerSettings.UsernamesEnabled;
model.LocationEnabled = _customerSettings.ShowCustomersLocation;
model.DisplayCaptcha = _captchaSettings.Enabled;
if (_customerSettings.ShowCustomersLocation)
{
foreach (var c in _countryService.GetAllCountries())
{
model.AvailableLocations.Add(new SelectListItem() { Text = c.Name, Value = c.Id.ToString(), Selected = (c.Id == model.LocationCountryId) });
}
}
return View(model);
}
thanks.