Welcome to Vortx Community Forum, where you can ask questions and receive answers from the staff at Vortx and other members of the community.

If you had a user account on our previous forums website, you will need to register a new account here.

Learn more about...

AspDotNetStorefront
DotFeed

Cerate new customer in code prior to creating cart

I'm auto-generating a shopping cart for a new user. This is 9.5, so there is no customer record for a new user. (I'm guessing that, since ThisCustomer.CustomerID = 0). How can I create a new customer in code? AspDotNetStorefrontCore is included in my cart generation module.

Thanks

Abbott
asked May 25, 2015 in MultiStore by AbbottF (370 points)

1 Answer

+1 vote

Hi there Abbott,

Something like this should do the trick:

Customer.Current.RequireCustomerRecord()

or

ThisCustomer.RequireCustomerRecord()

This forces a customer to be created in the database.

Hope this helps!

Trisha

Alynnlee Productions, Ltd. / Vibe Commerce
Add-ons and Connectors for AspDotNetStorefront: http://www.vibecommerce.com/add-ons/

answered May 27, 2015 by pligon (1,750 points)
Thanks. It's just what I needed.

 

Abbott
...