Updated readme

This commit is contained in:
Rob Gloudemans
2013-05-30 17:08:42 +02:00
parent e549a74e1f
commit fd7fe0a617

View File

@@ -29,6 +29,7 @@ The shoppingcart gives you the following methods to use:
**Cart::add()**
```php
/**
* Add a row to the cart
*
@@ -40,19 +41,38 @@ The shoppingcart gives you the following methods to use:
*/
Cart::add('293ad', 'Product 1', 1, 9.99, array('size' => 'large'));
```
**Cart::addBatch()**
/**
* Add multiple rows to the cart
*
* @param Array $items An array of items to add, use array keys corresponding to the 'add' method's parameters
*/
Cart::addBatch(array(
array('id' => '293ad', 'name' => 'Product 1', 'qty' => 1, 'price' => 10.00),
array('id' => '4832k', 'name' => 'Product 2', 'qty' => 1, 'price' => 10.00, 'options' => array('size' => 'large'))
));
**Cart::update()**
/**
* Update the quantity of one row of the cart
*
* @param string $rowId The rowid of the item you want to update
* @param integer $qty New quantity of the item
* @param integer|Array $attribute New quantity of the item|Array of attributes to update
* @return boolean
*/
$rowId = 'da39a3ee5e6b4b0d3255bfef95601890afd80709';
Cart::update($rowId, 2);
OR
Cart::update($rowId, array('name' => 'Product 1'));
**Cart::remove()**
/**