I am trying to create a custom "View Cart" through SSP application. And i want to check if customer is currently logged in or not, and try to get customer information. Unfortunately, it is always returning false.
I am pretty sure, my account is logged in because i can access my Custom Center page.
I even tried in SS file. What seems to be the problem here? Thank you for any help. Any other way of checking it in SSP and SS?
SSP File :
<html>
<head>
<%=getPageFullHead()%>
<link href="http://netdna.bootstrapcdn.com/bootstrap/3.1.1/css/bootstrap.min.css" rel="stylesheet">
<script src="http://netdna.bootstrapcdn.com/bootstrap/3.1.1/js/bootstrap.min.js"></script>
<% var container = nlapiGetWebContainer(),
session = container.getShoppingSession(),
orders = session.getOrder(),
orderSummaryTotal = orders.getOrderSummary();
%>
</head>
<body>
<div><%=session.isLoggedIn()%></div>
</body>
</html>
SS File :
function service(request, response) {
var session = nlapiGetWebContainer().getShoppingSession(),
orders = session.getOrder(),
isLoggedIn = session.isLoggedIn();
response.setContentType('JSON');
response.write(JSON.stringify(isLoggedIn));
}
Tried also viewing the object in console console.log(<%=JSON.stringify(session)%>), but it gives me error like this
"Please login first before this operation."