User Guide
Shopping Cart Reference 157
AddItem(DbRecordset,qty)
Adds an item to the shopping cart, retrieving information from any data in the
bindings array (see AddBinding above) and the Recordset based on column names
provided in the Shopping Cart's data map. The DbRecordset parameter is a
reference to a Drumbeat Recordset. The qty is the number of items to be added. If
no quantity is passed, a default value of 1 is used. If the cart is persisted as a
cookie, it updates the cookie to reflect the newly added item. Returns the row of
the item that has just been added.
AddItemAllowMultiples(DbRecordset,qty)
Same as AddItem method except that it allows an item with the same ProductID
to be added multiple times.
AdjustmentExists(Name)
Checks the shopping cart's adjustment array to see if an adjustment with the
name of the supplied parameter exists. Returns true if the adjustment name exists,
otherwise returns false.
Destroy()
Destroys existing references to a given shopping cart element when its data is
inserted into a database. If the cart is persisted as a cookie, it destroys the
cookie as well.
FindItem(itemID)
Checks whether an item with a ProductID corresponding to the itemID
parameter exists in the shopping cart. Returns the row number if the item is
found, otherwise returns -1. In cases where multiple rows with the same itemID
exist (see AddItemAllowMultiples), returns the row number of the last occurrence
of the item.
FormatNumberAsMoney(N)
General utility method that takes a parameter N and returns a string
representation in currency format. For instance, if N is 5,
FormatNumberAsMoney(5) returns 5.00. Note that this method does not return
a string containing a currency symbol
FormatToHundredths(N)
General utility method that takes a numeric argument and formats is to the
hundredths place. Useful for formatting floating point numbers that may have
lots of decimal places.