Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • Paul Burns 16 posts 88 karma points
    Jan 12, 2016 @ 21:55
    Paul Burns
    0

    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!

  • Paul Burns 16 posts 88 karma points
    Jan 14, 2016 @ 01:15
    Paul Burns
    0

    Does anyone now how to update this field through the API?

  • Nguyen Hien 52 posts 133 karma points
    Jan 14, 2016 @ 06:25
    Nguyen Hien
    1

    I can save same with your code. Is there any exception?

  • Paul Burns 16 posts 88 karma points
    Jan 15, 2016 @ 20:49
    Paul Burns
    0

    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

  • Paul Burns 16 posts 88 karma points
    Jan 19, 2016 @ 20:19
    Paul Burns
    0

    Anyone had this issue before? Help would be much appreciated

Please Sign in or register to post replies

Write your reply to:

Draft