Netsuite:是否登录的 Suitescript 变量?

Nestuite: Suitescript variable for logged in or not?

我有一个网上商店 (Suitebuilder),我有一个特定的供应商只希望我们在客户登录时显示价格。所有其他供应商无论如何都允许显示价格。是否有一个 suitescript 变量让我知道是否有人登录,我可以使用它来根据特定供应商自定义模板以及是否有人登录?

您可以尝试检测 cookie,然后使用 JS 或 CSS 更改页面布局以显示不同的价格。我不了解它们,但有一些 Cookie 值可以让您知道客户何时登录。

可能还有一些 URL 参数你可以检测到,但我不记得了。

不确定,但下面是一些方法

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

您可以在您的脚本中检查已登录的客户电子邮件,以确认是否有任何实际登录。

如果您使用任何套件来实现自定义登录功能,您也可以尝试 nlapiGetLogin

nlapiGetLogin()
Returns the NetSuite login credentials of currently logged-in user.

This API is supported in user event, portlet, Suitelet, RESTlet, and SSP scripts. For information about the unit cost associated with this API, see API Governance.

Returns nlobjLogin

var login = nlapiGetLogin();  //Get credentials of currently logged-in user

如果您使用的更像是 SSP 应用程序,那么您可能可以试试这个

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