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 |
---|---|---|
| total amount of item (unit cost * quantity) | |
|
| 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. |
|
| item description |
|
| item description with newlines changed to <br> tags for easier display |
| discount, if any | |
| formatted amount with currency symbols, commas, and periods | |
|
| formatted discount with currency symbols, commas, and periods |
|
| if true, the item has a discount. useful to show/hide table colums or divs |
highlight | boolean | if true, this item should be highlighted for some reason |
|
| the item position in the current cart. |
|
| internal unique id of the item |
merchantItemId | string | item id |
| an array of item options, if any | |
| quantity of item in the cart | |
|
| flag to instruct cart engine to remove this item. if remove is true, the item is removed. see view_cart.vm for usage example. |
|
| if true, the arbitrary unit cost should be displayed. |
|
| default is 80 (pixels) |
|
| Â |
|
| default is 80 (pixels) |
|
| 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 |
---|---|---|
|
| notice this is a formatted string with currency symbols |
|
| if an arb. cost is in place, this is the value. |
|
| Â |
|
| notice this is a formatted string with currency symbols |
|
| the item position in the current cart. |
|
| item id |
|
| internal unique id of the item |
| item options | |
|
| Â |
|
| flag to instruct cart engine to remove this item. if remove is true, the item is removed. see view_cart.vm for usage example. |
|
| default is 80 (pixels) |
|
| Â |
|
| default is 80 (pixels) |
|
| Â |
|
| 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. |
|
| 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. |