Updated README

This commit is contained in:
Rob Gloudemans
2013-07-09 15:16:24 +02:00
parent 5aa48468e2
commit 5097bf9314

View File

@@ -35,18 +35,30 @@ The shoppingcart gives you the following methods to use:
/**
* Add a row to the cart
*
* @param string $id Unique ID of the item
* @param string $name Name of the item
* @param int $qty Item qty to add to the cart
* @param float $price Price of one item
* @param Array $options Array of additional options, such as 'size' or 'color'
* @param string|Array $id Unique ID of the item|Item formated as array|Array of items
* @param string $name Name of the item
* @param int $qty Item qty to add to the cart
* @param float $price Price of one item
* @param Array $options Array of additional options, such as 'size' or 'color'
*/
// Basic form
Cart::add('293ad', 'Product 1', 1, 9.99, array('size' => 'large'));
// Array form
Cart::add(array('id' => '293ad', 'name' => 'Product 1', 'qty' => 1, 'price' => 9.99, 'options' => array('size' => 'large')));
// Batch method
Cart::add(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::addBatch()**
Don't use this anymore, just pass a multidimensional array to the `Cart::add()` method
```php
/**
* Add multiple rows to the cart