Jump to content

Can't create customer prestasharp


Recommended Posts

Hello, i am trying to use PrestaSharp to create a customer and log in to that customer to add something to cart.

this is my code :

 

CustomerFactory customers = new CustomerFactory(baseUrl, account, password);
customer customer = new customer
{
    passwd = "123345678",
    firstname = "tst",
    lastname = "tst",
    email = "[email protected]",
    id_shop = 1,
    id_gender = 1,
    id_default_group = 1,
    id_lang = 1,
    active = 1,
    id = customers.GetAll().Count + 1
    
};
customers.Add(customer);

but i get this error message:

System.InvalidOperationException: Nullable object must have a value.

hope someone can help me.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...