Total Posts:
3
Karma:
15
Joined:
6/9/2017
Location:
India
Hi, I have different custom customer role created and assigned to different customers. What I would like to have, is to show the logged in user the current role he is assigned to, I tried following by editing Views\Common\HeaderLinks.cshtml <li><a href="@Url.RouteUrl("CustomerInfo")" class="ico-account">@T("Admin.Customers.CustomerRoles.Fields.Name")</a></li> no luck the header display text as 'Name' Regards Praveen
Total Posts:
3
Karma:
15
Joined:
6/9/2017
Location:
India
thank you soo much , worked like charm.
Total Posts:
2
Karma:
10
Joined:
6/29/2013
Location:
Poland
Hi, Above solution is working for roles Administrators and Registered by why it dosn't work for "Forum Moderators" or "Custom role" created in admin area @if (EngineContext.Current.Resolve<IWorkContext>().CurrentCustomer.IsInCustomerRole("Administrators")) { <span>Administrators</span> //this work fine } @if (EngineContext.Current.Resolve<IWorkContext>().CurrentCustomer.IsInCustomerRole("Forum Moderators")) { <span>Forum Moderators</span> //this doesn't work } @if (EngineContext.Current.Resolve<IWorkContext>().CurrentCustomer.IsInCustomerRole("Custom role")) { <span>Custom role</span> //this doesn't work } @if (EngineContext.Current.Resolve<IWorkContext>().CurrentCustomer.IsInCustomerRole("Registered")) { <span>Registered</span> //this work fine }
Total Posts:
2
Karma:
10
Joined:
6/29/2013
Location:
Poland
It wasn't show up becouse I didn't define "System name" in CustomerRole