Press Ctrl / CMD + C to copy this to your clipboard.
This post will be reported to the moderators as potential spam to be looked at
Hi there,
I am using Merchello 1.8.2 and Umbraco 7.2.4.
I have a custom My Account section where I want the user to be able to update their details such as Forename, Surname and Email Address etc...
The problem is, the Merchello Customer LoginName field is not updating. See below the code I am using:
var customerService = MerchelloContext.Current.Services.CustomerService;
var customer = customerService.GetByLoginName(currentMember.LoginName);
customer.FirstName = txtFirstName.Text;
customer.LastName = txtLastName.Text;
customer.Email = txtEmail.Text;
customerService.Save(customer);
I tried to use customer.LoginName = txtEmail.Text; but this won't work as LoginName is read only.
Is there any way to update this field?
Thanks in advance!
Does anyone now how to update this field through the API?
I can save same with your code. Is there any exception?
You are able to save an entry with - customer.LoginName = "ExampleLoginName"? Strange!
I am getting an error in the Error List in Visual Studio before I build:
'Merchello.Core.Models.ICustomer.LoginName' cannot be assigned to -- it is read only..
Then when I look at the LoginName property in the ICustomer interface, it is indeed read only:
string LoginName { get; }.
Can this be changed? Why is it read only?
Thanks
Anyone had this issue before? Help would be much appreciated
is working on a reply...
Write your reply to:
Upload image
Image will be uploaded when post is submitted
Merchello Customer LoginName not updating through the API
Hi there,
I am using Merchello 1.8.2 and Umbraco 7.2.4.
I have a custom My Account section where I want the user to be able to update their details such as Forename, Surname and Email Address etc...
The problem is, the Merchello Customer LoginName field is not updating. See below the code I am using:
var customerService = MerchelloContext.Current.Services.CustomerService;
var customer = customerService.GetByLoginName(currentMember.LoginName);
customer.FirstName = txtFirstName.Text;
customer.LastName = txtLastName.Text;
customer.Email = txtEmail.Text;
customerService.Save(customer);
I tried to use customer.LoginName = txtEmail.Text; but this won't work as LoginName is read only.
Is there any way to update this field?
Thanks in advance!
Does anyone now how to update this field through the API?
I can save same with your code. Is there any exception?
You are able to save an entry with - customer.LoginName = "ExampleLoginName"? Strange!
I am getting an error in the Error List in Visual Studio before I build:
'Merchello.Core.Models.ICustomer.LoginName' cannot be assigned to -- it is read only..
Then when I look at the LoginName property in the ICustomer interface, it is indeed read only:
string LoginName { get; }.
Can this be changed? Why is it read only?
Thanks
Anyone had this issue before? Help would be much appreciated
is working on a reply...