CartItem SFO

There are 2 cart items! There is the CartItem and the LegacyCartItem.

Template Object
view_cart.vm

→

LegacyCartItem
single.vm
→
CartItem

Why two? The view_cart.vm was the original checkout page and has been around for nearly 20 years. The single page checkout arrived a decade ago, and to avoid breaking thousands of carts, a new object was created to cater to that checkout page. Just be sure you refer to the right object below.

 

LegacyCartItem

Properties

Field

Type

Comment/Sample

amount

BigDecimal

total amount of item (unit cost * quantity)

autoOrderSchedule

string

if the item is an auto order and the customer has chosen a schedule, this field will contain it. this field is modified later in the checkout stream.

description

string

item description

descriptionWithBreaks

string

item description with newlines changed to <br> tags for easier display

discount

BigDecimal

discount, if any

formattedAmount

BigDecimal

formatted amount with currency symbols, commas, and periods

formattedDiscount

string

formatted discount with currency symbols, commas, and periods

hasDiscount

boolean

if true, the item has a discount. useful to show/hide table colums or divs

highlightbooleanif true, this item should be highlighted for some reason

itemIndex

integer

the item position in the current cart.

merchantItemOid

integer

internal unique id of the item

merchantItemIdstringitem id

options

CartItemOption[ ]

an array of item options, if any

quantity

BigDecimal

quantity of item in the cart

remove

boolean

flag to instruct cart engine to remove this item. if remove is true, the item is removed. see view_cart.vm for usage example.

showArbitraryUnitCost

boolean

if true, the arbitrary unit cost should be displayed.

thumbnailHeight

integer

default is 80 (pixels)

thumbnailUrl

string

 

thumbnailWidth

integer

default is 80 (pixels)

viewUrl

string

the url of viewing this item. this points to the catalog page for the item, if there is one. check this value for null before automatically creating a link to it.

 

Methods

Method

Returns

Parameters

Parameter Types

Comments/Sample

See Also

 

 

CartItem

Properties

Field

Type

Comment/Sample

amount

string

notice this is a formatted string with currency symbols

arbitraryUnitCost

string

if an arb. cost is in place, this is the value.

description

string

 

discount

string

notice this is a formatted string with currency symbols

itemIndex

integer

the item position in the current cart.

merchantItemId

string

item id

merchantItemOid

integer

internal unique id of the item

options

CartItemOption[ ]

item options

quantity

integer

 

remove

boolean

flag to instruct cart engine to remove this item. if remove is true, the item is removed. see view_cart.vm for usage example.

thumbnailHeight

integer

default is 80 (pixels)

thumbnailUrl

string

 

thumbnailWidth

integer

default is 80 (pixels)

unitCostWithDiscount

string

 

viewUrl

string

the url of viewing this item. this points to the catalog page for the item, if there is one. check this value for null before automatically creating a link to it.

viewUrlTarget

string

the anchor target, if specified. used when a merchant has a flag set to show item pages in a new window, etc.

Method

Returns

Parameters

Parameter Types

Comments/Sample

getItem()Item  returns the underlying Item. While CartItem contains information specific to the current shopping cart (quantity in cart, etc), this Item object contains the general item information.

See Also