Merchello unable to cast AnonymousCustomer to ICustomer
Hello fellas,
We're building a shop for a client of ours and we keep experiencing a perticular issue with regards to the current customer.
We have an extension method on the IPrincipal object which returns the current customer (ICustomerBase):
public static ICustomerBase GetCurrentCustomer(this IPrincipal principal)
{
var context = PluggableObjectHelper.GetInstance<CustomerContextBase>("CustomerContext", UmbracoContext.Current);
return context.CurrentCustomer;
}
All to often though, we get an AnonymousCustomer returned from this method call. I am not all that comfortable with Merchello yet but is there something obvious we are doing wrong here? Or is there a better way to retrieve the current customer?
Merchello unable to cast AnonymousCustomer to ICustomer
Hello fellas,
We're building a shop for a client of ours and we keep experiencing a perticular issue with regards to the current customer.
We have an extension method on the IPrincipal object which returns the current customer (ICustomerBase):
All to often though, we get an AnonymousCustomer returned from this method call. I am not all that comfortable with Merchello yet but is there something obvious we are doing wrong here? Or is there a better way to retrieve the current customer?
// Mathias
is working on a reply...