0

I'm new to CC and in my home page I need to display a banner just if a user is logged in. I read the documentation and I think I need to work with customer groups (registered and unregistered), but didn't quite understand how to perform checks on these groups. Anyone who can help me to get closer to a solution?

0
0

When you simply want to check if a customer is logged in or not (if he is logged in that includes that he is in the customer group "registered"), you can access the Customer class and use the method isAuthenticated or alterantively the authenticated property of the Customer object initialized by that class.

For example:

<isif condition="${pdict.customer.authenticated === false}">

Customer in that case can be accsessed in different ways:

As part of a controller call:

req.currentCustomer

or as part of a basket:

currentBasket.customer

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.