Class cmsShoppingCart

From Snapp CMS Developer Documentation

Jump to: navigation, search

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

  • data : array (required)
    • currency : string (optional) Currency Product is being purchased in
    • id : int (optional) id of a existing product in the product catalog
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

  • data : array (required)
    • delete_X : string (optional) Removes X from the Shopping Cart
    • qty_X : int (optional) Updates the Shopping Cart Item's Qty to X
    • cart_promocode: string Applies PromoCode to all Shopping Cart Items
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

  • data : array (required)
    • qty : int (required) Qty to Add to the Existing Item
    • id : int (required) ID of the Existing Shopping Cart Item
currency()

Returns the Currency the Shopping Cart is in

currencySymbol()

Returns the Currency Symbol the Shopping Cart is in

clear()

Clears the Shopping Cart

Personal tools
Core Components
Standalone Installs