hi,
i create a link in Menu.cshtml.
but i want to display this link to Only customers who have a specific role.
i create a role with the name SpecialCustmers.
how can i display my link only to this role???
thanks.
Geschrieben: 18 September 2014 - 20:35
hi,
i create a link in Menu.cshtml.
but i want to display this link to Only customers who have a specific role.
i create a role with the name SpecialCustmers.
how can i display my link only to this role???
thanks.
Geschrieben: 18 September 2014 - 20:53
bool isSpecialCustmer = _workContext.CurrentCustomer.IsInCustomerRole("SpecialCustmers");
Marcus Gesing
Smartstore AG
Geschrieben: 19 September 2014 - 07:24
Thank you. But I received the following Compilation error:
Compiler Error Message: CS0103: The name '_workContext' does not exist in the current context
Please Help me.
Thanks a lot
Geschrieben: 19 September 2014 - 11:22
@using SmartStore.Services.Customers;
@{ bool isSpecialCustmer = EngineContext.Current.Resolve<SmartStore.Core.IWorkContext>().CurrentCustomer.IsInCustomerRole("SpecialCustmers"); }
Marcus Gesing
Smartstore AG
Geschrieben: 20 September 2014 - 07:12
thanks for your answer.