Removed addBatch method, the add method should be used. Also added events to the cart

This commit is contained in:
Rob Gloudemans
2013-12-30 22:02:59 +01:00
parent 59ce0283b0
commit 160a2e3bd4
3 changed files with 46 additions and 15 deletions

View File

@@ -32,6 +32,7 @@ Look at one of the following topics to learn more about LaravelShoppingcart
* [Collections](#collections)
* [Instances](#instances)
* [Exceptions](#exceptions)
* [Events](#events)
* [Example](#example)
## Usage
@@ -241,6 +242,17 @@ The Cart package will throw exceptions if something goes wrong. This way it's ea
| *ShoppingcartInvalidQtyException* | When a not numeric quantity is passed |
| *ShoppingcartInvalidRowIDException* | When the rowId that got passed doesn't exists in the current cart |
## Events
The cart also has events build in. There are five events available for you to listen for.
| Event | Fired |
|----------------------------------------------------------------|
| cart.add($item) | When a single item is added |
| cart.batch($items) | When a batch if items is added |
| cart.update($rowId) | When an item in the cart is updated |
| cart.remove($rowId) | When an item is removed from the cart |
| cart.destroy() | When the cart is destroyed |
## Example