cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

How to restrict the price from the Anonymous user

Former Member
0 Likes
709

Hello Experts,

Our requirement is we have to restrict the price from the User,After login only we have show case the price.How to restrict this,any OOB is their for this,please suggest me,please share your tips.Thank you..

Sindhu

Accepted Solutions (1)

Accepted Solutions (1)

0 Likes

Hello Sindhu,

you could wrap the html regarding the display of the price in the productDetailsPanel.tag-file with a -Tag like this:

 <sec:authorize access="!hasAnyRole('ROLE_ANONYMOUS')">            
     <div>price</div>
 </sec:authorize>

This will prevent anyone with the anonymous role to see the price

Former Member
0 Likes

Thanks a lot it's working.. :)

Answers (2)

Answers (2)

former_member387866
Active Contributor
0 Likes

Hi Sindhu,

You can wrap the Price Component in a BTG Segment.
The Segment will only show if the User is not Anonymous.

Or else create a new UserGroup, called something like HidePrice
Add the Anonymous user to this group.
Then set the segment to hide if the User is a member of HidePrice usergroup.

Regards,
Luke

VinayKumarS
Active Contributor
0 Likes

Sindhu,

OOB do not have such option. But we have similar requirement in our project. but we are showing the price for anonymous customer. We are not allowing customer to add a product as anonymous customer. on Add To cart method. it will call controller. we implemented a @Require Hard Login.

if you dont want to display then you might need to add a check in the code with the anonomous user.

thanks