Developer forum

Forum » Templates » If statements in product detail

If statements in product detail

George Nelzo Pereira
Reply

Hi,

I have two groups of users each one with some users...
Like:
GroupA - 260 - UserA
GroupB - 261 - UserB

Then I have a product details to show the prices just for people are in this user group 260, should be not show for anonymous and for others groups...

I'm trying check this... 
<!--@If(DW_extranet_Groups=260)--> (that is not working, is never showing anything, and the user is just in 260 group)

<!--@If Defined(Global:Extranet.UserName)--> (this one is working, but is not good to hide prices for GroupB)

I'm using 8.6.0.3

Someone have ideia if is a bug or if I'm doing something wrong...

Thanks


Replies

 
Dmitriy Benyuk
Reply
This post has been marked as an answer

Hi George,

The DW_extranet_Groups tag is not showing the groups because it is not a global tag, so it will work only in the root page/design template. Instead of it you can use the global tag called:
Global:Extranet.Groups which will output the comma separated list of the current logged in user groups.
You can also use the <contains> condition for checking the groups:
<!--@If(Global:Extranet.Groups<contains>'260')-->
some output here
<!--@EndIf-->

Regards, Dmitrij

Votes for this answer: 1

 

You must be logged in to post in the forum