The main item object available in pricing scripts. Represents the product variant being priced and provides access to all product information, attributes, pricing data, and methods for file handling and attribute management.

This object is the primary interface for accessing product data and performing pricing calculations in pricing scripts.

Hierarchy

  • Item

Properties

ActualSku: string

The actual SKU based on the current attribute combination. If no attributes are selected, this will be the same as the product SKU. This value reflects the specific configuration of the product being priced.

Example

var configuredSku = Item.ActualSku;
AdditionalShippingCharge: number

Additional shipping charge for this specific product variant. This value is added to the base shipping cost and represents any extra shipping fees specific to this item.

Example

var totalShipping = baseShippingCost + Item.AdditionalShippingCharge;
Attributes: Attribute[]

Array of attributes with Key, Value, IsRequired, Prompt, PriceAdjustment, etc.

BatchTiers: Tier[]

Array of batch tiers (same as PricingTiers but for batch tier table)

CanSetWeight: boolean

Indicates whether the weight can be set or modified for this item. Some products may have fixed weights that cannot be changed, while others allow weight adjustments based on attributes or custom settings.

Example

if (Item.CanSetWeight) {
// Allow weight adjustments in the UI
}
CartItemIndex: number

Index of this item in the other order item array (-1 if not in array)

CartItems: Item[]

Alias of OtherOrderItems

Categories: string[]

Array of category names that this product belongs to. Categories are used for product organization, filtering, and category-specific pricing rules.

Example

if (Item.Categories.includes("Premium")) {
return Item.Price * 1.1; // 10% premium markup
}
CustomerRoles: string[]

Array of customer role system names

Department: string

Department name of user

DiscountCode: string

Value of the currently used discount code

Email: string

User email

Height: number

The height of the item in the configured dimension unit (typically inches or centimeters). This value is used for packaging calculations and dimensional pricing.

Example

var packagingCost = calculatePackagingCost(Item.Width, Item.Height, Item.Length);
IsBatch: boolean

Whether this is a batch job

IsInOtherOrderItems: boolean

Whether this item is in the other order item array

IsVersion: boolean

Whether this is a version of a job

Length: number

The length of the item in the configured dimension unit (typically inches or centimeters). This value is used for packaging calculations and dimensional pricing.

Example

var packagingCost = calculatePackagingCost(Item.Width, Item.Height, Item.Length);
NumberOfPages: number

Number of pages (-1 if not valid)

NumberOfRecords: number

Number of records (-1 if not valid)

NumberOfVersions: number

Number of versions

OldPrice: number

The old price from the product variant, typically used for displaying price comparisons or discounts. This value represents the previous price before any recent price changes.

Example

if (Item.OldPrice > Item.Price) {
var discount = Item.OldPrice - Item.Price;
return "Save $" + discount.toFixed(2);
}
OrderItemIndex: number

Index of this item in the other order item array (0 if not in array)

OtherOrderItems: Item[]

Array of other order items using the same custom pricing script

PackQuantity: number

The pack quantity, calculated as the order quantity divided by the product variant's OrderPackQuantity. This represents how many packs are being ordered.

Example

var packPrice = Item.Price * Item.PackQuantity;
Price: number

The standard product variant price in the base currency. This is the base price before any attribute adjustments, tier pricing, or special pricing is applied.

Example

var basePrice = Item.Price;
var adjustedPrice = basePrice * 1.2; // 20% markup
PricePerRecord: number

Price per record (-1 if not valid)

PricingTiers: Tier[]

Array of pricing tiers with Price, Quantity, and CustomerRole

ProductCost: number

The product cost, representing the actual cost to produce or acquire the product. This value is used for margin calculations and profit analysis.

Example

var margin = Item.Price - Item.ProductCost;
var marginPercentage = (margin / Item.Price) * 100;
ProductName: string

The name of the product as displayed to customers. This is the human-readable product name used in the user interface and order confirmations.

Example

var displayName = Item.ProductName;
Quantity: number

The order quantity for this item. This represents how many units of this product variant are being ordered. Used for quantity-based pricing and tier calculations.

Example

var tier = HelperMethods.FindTier(Item.Quantity, Item.PricingTiers);
QuantitySelectorMode: number

The quantity selector mode for this product. This determines how quantity selection is handled in the user interface and affects pricing calculations.

Example

switch (Item.QuantitySelectorMode) {
case 1: // Individual units
return Item.Price * Item.Quantity;
case 2: // Packs
return Item.Price * Item.PackQuantity;
}
Sku: string

The Stock Keeping Unit (SKU) of the product variant. This is the unique identifier for the product variant and is used for inventory management and order processing.

Example

var productIdentifier = Item.Sku;
SpecialPrice: number

The special price for the product variant, if applicable. This value is null if no special pricing is currently active. Special pricing typically overrides the standard price for promotional periods.

Example

var finalPrice = Item.SpecialPrice || Item.Price;
SpecialPriceEndDate: Date

The end date for special pricing, if applicable. This value is null if no special pricing is currently active. Used to determine if special pricing should be applied based on current date.

Example

var now = new Date();
if (Item.SpecialPriceEndDate && now <= Item.SpecialPriceEndDate) {
return Item.SpecialPrice;
}
SpecialPriceStartDate: Date

The start date for special pricing, if applicable. This value is null if no special pricing is currently active. Used to determine if special pricing should be applied based on current date.

Example

var now = new Date();
if (Item.SpecialPriceStartDate && now >= Item.SpecialPriceStartDate) {
return Item.SpecialPrice;
}
Versions: ItemVersion[]

Array of versions with JobId, CustomName, and Quantity

VersionsSumQuantity: number

Sum of all quantities of all versions

Weight: number

The weight of the item in the configured weight unit (typically grams or ounces). This value is used for shipping calculations and weight-based pricing.

Example

var shippingCost = calculateShippingByWeight(Item.Weight);
Width: number

The width of the item in the configured dimension unit (typically inches or centimeters). This value is used for packaging calculations and dimensional pricing.

Example

var packagingCost = calculatePackagingCost(Item.Width, Item.Height, Item.Length);

Methods

  • Shortcut method to retrieve an attribute value by name

    Parameters

    • attribute: string

      Name of the attribute

    Returns string

    Attribute value

  • Get file information for attached files

    Parameters

    • attributeId: string

      ID of the attribute

    • readContent: boolean

      Whether to read file content

    Returns FileInfo

    FileInfo object

  • Get file information for a specific configurable file from Global Data

    Parameters

    • filename: string

      Name of the file

    Returns FileInfo

    FileInfo object

  • Set the attribute value permanently to the given value

    Parameters

    • attribute: string

      Name of the attribute

    • value: string

      Value to set

    Returns void

Generated using TypeDoc