Showing Content to Logged In Customer

Showing Content to Logged In Customer

If your catalog has a custom SSL certificate associated with it, then you can detect if the customer is logged into their cart and then display information to them. The syntax for the velocity code is:

#if (${cart.isLoggedIn()})
  Welcome back ${cart.getCustomerProfile().getFirstName()}!
#end

Showing the Name of the Pricing Tier

If a wholesale customer is logged in then they may have a pricing tier associated with them. There are two ways to display messages based upon pricing tier. The first is to check to see if the customer has a specific tier.

#if (${cart.hasPricingTier("Wholesale")})
  We appreciate our Wholesale customers!
#end

The second option is to display all the pricing tiers they have access to:

#foreach (${ptName} in ${cart.getPricingTierNames()})
  ${ptName} <br/>
#end