user2170841
user2170841

Reputation: 1

How to set up logged into account feature in Netsuite?

The company I work for uses Netsuite for our web store. There is a shopping cart option with log in feature. Currently, it is difficult for the customer to tell when they are logged in as there is no change to the log in text/no logged in message. I have searched the header tags and template options but do not see how to change this. Any suggestions on how to have log in bolded or a different color, etc to show when a customer is logged into their account? Thanks. FYI the site is www.JLSmithco.com

Upvotes: 0

Views: 371

Answers (2)

Benj Sicam
Benj Sicam

Reputation: 210

Use this code:

<%
var shoppingSession = nlapiGetWebContainer().getShoppingSession();

if (!shoppingSession.isLoggedIn()) 
    //Do your thing when not logged in
else
    //Do your thing when logged in
%>

You may also find this on: https://stackoverflow.com/a/18007573/1770588

Upvotes: 0

Gonzalo
Gonzalo

Reputation: 992

There are multiple ways you can achieve this.

The easiest one would be using the tag instead of and . This tag creates links for customers to register and log in, or links to log out if customer is already logged in.

Another option would be using javascript to check if there's a customer logged in. If it is, then replace the Log in and Register buttons for a Logout button. You can check if a customer is logged in by using:

var isLoggedIn = "<%=getCurrentAttribute('customer','email')%>" != "";

Upvotes: 1

Related Questions