Page 1 of 1

Broadleaf and changing customer information

Posted: Wed May 04, 2011 12:08 am
by Arwina
Hi everyone !!!

I follow the tutorial at http://www.broadleafcommerce.org/confluence/display/core/Eclipse+-+Mavento run the BroadleafCommerce Demo as a standalone application.

Now, I experiment some functions, I want that a Customer can change his personal informations,so once the customer is connected.

I implement a ChangeCustomerController inspired by the RegisterCustomerController and a ChangeCustomerForm inspired by the RegisterCustomerForm.

in the method :
@ModelAttribute("changeCustomerForm")
public ChangeCustomerForm initCustomerChangeForm() {
//code
}

I want the id of my client who now connected but i don't know how to do.

Thanks for your help !!!

Re: Broadleaf and changing customer information

Posted: Fri May 06, 2011 5:35 am
by jefffischer
Inject an instance of CustomerState (registered as bean id "blCustomerState"). You can use the "getCustomer" method on this service to retrieve your current customer and then get the Id from the Customer instance.

Re: Broadleaf and changing customer information

Posted: Tue May 10, 2011 4:47 am
by Arwina
Thanks a lot Jefffisher ! It works very well !