-
Notifications
You must be signed in to change notification settings - Fork 0
CI_Cart
Shopping Cart Class
- Class name: CI_Cart
- Namespace:
- Warning: this class is deprecated. This means that this class will likely be removed in a future version.
public string $product_id_rules = '\.a-z0-9_-'
These are the regular expression rules that we use to validate the product ID and product name alpha-numeric, dashes, underscores, or periods
- Visibility: public
- Warning: this property is deprecated. This means that this property will likely be removed in a future version.
public string $product_name_rules = '\w \-\.\:'
These are the regular expression rules that we use to validate the product ID and product name alpha-numeric, dashes, underscores, colons or periods
- Visibility: public
- Warning: this property is deprecated. This means that this property will likely be removed in a future version.
public boolean $product_name_safe = TRUE
only allow safe product names
- Visibility: public
- Warning: this property is deprecated. This means that this property will likely be removed in a future version.
protected object $CI
Reference to CodeIgniter instance
- Visibility: protected
- Warning: this property is deprecated. This means that this property will likely be removed in a future version.
protected array $_cart_contents = array()
Contents of the cart
- Visibility: protected
- Warning: this property is deprecated. This means that this property will likely be removed in a future version.
void CI_Cart::__construct($params)
Shopping Class Constructor
The constructor loads the Session class, used to store the shopping cart contents.
- Visibility: public
- Warning: this method is deprecated. This means that this method will likely be removed in a future version.
- $params mixed
boolean CI_Cart::insert($items)
Insert items into the cart and save it to the session table
- Visibility: public
- Warning: this method is deprecated. This means that this method will likely be removed in a future version.
- $items mixed
boolean CI_Cart::_insert($items)
Insert
- Visibility: protected
- Warning: this method is deprecated. This means that this method will likely be removed in a future version.
- $items mixed
boolean CI_Cart::update($items)
Update the cart
This function permits the quantity of a given item to be changed. Typically it is called from the "view cart" page if a user makes changes to the quantity before checkout. That array must contain the product ID and quantity for each item.
- Visibility: public
- Warning: this method is deprecated. This means that this method will likely be removed in a future version.
- $items mixed
boolean CI_Cart::_update($items)
Update the cart
This function permits changing item properties. Typically it is called from the "view cart" page if a user makes changes to the quantity before checkout. That array must contain the rowid and quantity for each item.
- Visibility: protected
- Warning: this method is deprecated. This means that this method will likely be removed in a future version.
- $items mixed
boolean CI_Cart::_save_cart()
Save the cart array to the session DB
- Visibility: protected
- Warning: this method is deprecated. This means that this method will likely be removed in a future version.
integer CI_Cart::total()
Cart Total
- Visibility: public
- Warning: this method is deprecated. This means that this method will likely be removed in a future version.
boolean CI_Cart::remove($rowid)
Remove Item
Removes an item from the cart
- Visibility: public
- Warning: this method is deprecated. This means that this method will likely be removed in a future version.
- $rowid mixed
integer CI_Cart::total_items()
Total Items
Returns the total item count
- Visibility: public
- Warning: this method is deprecated. This means that this method will likely be removed in a future version.
array CI_Cart::contents($newest_first)
Cart Contents
Returns the entire cart array
- Visibility: public
- Warning: this method is deprecated. This means that this method will likely be removed in a future version.
- $newest_first mixed
array CI_Cart::get_item(string $row_id)
Get cart item
Returns the details of a specific item in the cart
- Visibility: public
- Warning: this method is deprecated. This means that this method will likely be removed in a future version.
- $row_id string
boolean CI_Cart::has_options(string $row_id)
Has options
Returns TRUE if the rowid passed to this function correlates to an item that has options associated with it.
- Visibility: public
- Warning: this method is deprecated. This means that this method will likely be removed in a future version.
- $row_id string - <p>= ''</p>
array CI_Cart::product_options(string $row_id)
Product options
Returns the an array of options, for a particular product row ID
- Visibility: public
- Warning: this method is deprecated. This means that this method will likely be removed in a future version.
- $row_id string - <p>= ''</p>
string CI_Cart::format_number($n)
Format Number
Returns the supplied number with commas and a decimal point.
- Visibility: public
- Warning: this method is deprecated. This means that this method will likely be removed in a future version.
- $n mixed
void CI_Cart::destroy()
Destroy the cart
Empties the cart and kills the session
- Visibility: public
- Warning: this method is deprecated. This means that this method will likely be removed in a future version.