投稿総数:
3
カルマ:
15
参加:
2017/06/09
ロケーション:
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
投稿総数:
3
カルマ:
15
参加:
2017/06/09
ロケーション:
India
thank you soo much , worked like charm.
投稿総数:
2
カルマ:
10
参加:
2013/06/29
ロケーション:
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 }
投稿総数:
2
カルマ:
10
参加:
2013/06/29
ロケーション:
Poland
It wasn't show up becouse I didn't define "System name" in CustomerRole