Class cmsShoppingCart
From Snapp CMS Developer Documentation
Contents |
Class cmsShoppingCart
Construction Configuration Options
| Config Options | Description |
|---|---|
| cms : cms object (required) | CMS Object |
| cfg : array/object | Additional Configuration Options |
Available Variables
| Config Options | Description |
|---|---|
| items : array | Array for Shopping Cart Item Objects |
| promoCode : string | Promotional Code Applied to this order |
| promoCodeMessage : string | Promo Error or Success Messages |
| subTotal : float | SubTotal of Shopping Cart Items |
| total : float | Total of the Shopping Cart |
| freight : array | Array of Freight Details |
| currency : string | Currency of Shopping Cart |
Available Functions
| add(data:array) |
|---|
|
An Array of the item you wish to add the the shopping cart Parameters
|
| checkPromo() |
|---|
|
Check is a PromoCode has been applied |
| showPromoError() |
|---|
|
Return the last Promo Code Error Message |
| update(data:array) |
|---|
|
Updates the Shopping Cart, Change of Quantity or removing of Products Parameters
|
| isEmpty() |
|---|
|
Returns true/false if the shopping cart is empty |
| clearPromoCode() |
|---|
| Removes the promo code from all shopping cart items |
| calculateFreight() |
|---|
|
Calculates the Shopping Carts Total Freight when freight is added to each shopping cart item |
| total() |
|---|
|
Returns the Total of the Shopping Cart |
| addToExisting(data:array) |
|---|
|
Add an additional qty of the item to the existing qty Parameters
|
| currency() |
|---|
|
Returns the Currency the Shopping Cart is in |
| currencySymbol() |
|---|
|
Returns the Currency Symbol the Shopping Cart is in |
| clear() |
|---|
|
Clears the Shopping Cart |
