This class can be used to manage shopping carts that preserve the items between visits. Recommended for Smarty template.
It stores the cart items in a MySQL database table, so the items are not lost after the session on which the items were added is not lost.
The cart items are associated to a session identifier that can be stored in a persistent cookie to allow recovering the cart items later.
The class can add items to a cart, check if the item was already added, update the quantity of an item, clear all the cart items, calculate the cart items total cost, dispĺay all the cart items, etc.. |