Array of shopping cart items in the current session. Contains all active shopping cart items for the current customer session. Each item provides full access to product information, attributes, and pricing data.
console("Session has " + Session.CartItems.length + " items");
for (var i = 0; i < Session.CartItems.length; i++) {
var item = Session.CartItems[i];
console("Item: " + item.ProductName + " - $" + item.Price);
}
Array of customer role system names for the current session. Contains all roles assigned to the customer in the current session. Used for role-based pricing and access control.
console("Customer roles: " + Session.CustomerRoles.join(", "));
if (Session.CustomerRoles.includes("VIP")) {
console("VIP customer - apply special pricing");
}
Department name of the customer for the current session. Represents the department or organizational unit the customer belongs to. Used for department-specific pricing and business logic.
console("Customer department: " + Session.Department);
if (Session.Department === "Education") {
console("Educational department - apply academic discount");
}
Customer email address for the current session. Provides access to the customer's email address associated with the session.
console("Session customer email: " + Session.Email);
if (Session.Email.endsWith(".edu")) {
console("Educational customer detected");
}
Alias for CartItems - array of other order items in the session. Provides the same functionality as CartItems for backward compatibility.
var totalSessionValue = 0;
for (var i = 0; i < Session.OtherOrderItems.length; i++) {
totalSessionValue += Session.OtherOrderItems[i].Price * Session.OtherOrderItems[i].Quantity;
}
console("Total session cart value: $" + totalSessionValue);
Generated using TypeDoc
The session object available in pricing scripts. Represents session-level data and provides access to customer information and shopping cart items that are available during the current session.
This object provides session-wide context for pricing calculations that may need to consider multiple items or customer session data.