Skip to content

Commit

Permalink
Update README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
darryldecode committed Mar 19, 2015
1 parent 4369ebe commit a8d7b28
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -151,6 +151,9 @@ Getting an item on a cart: **Cart::get()**
$itemId = 456;

Cart::get($itemId);

// You can also get the sum of the Item multiplied by its quantity, see below:
$summedPrice = Cart::get($itemId)->getPriceSum();
```

Getting cart's contents and count: **Cart::getContent()**
Expand Down Expand Up @@ -280,6 +283,11 @@ $condition->getTarget(); // the target of which the condition was applied
$condition->getName(); // the name of the condition
$condition->getType(); // the type
$condition->getValue(); // the value of the condition

// You can get the conditions calculated value by providing the subtotal, see below:
$subTotal = Cart::getSubTotal();
$condition = Cart::getCondition('VAT 12.5%');
$conditionCalculatedValue = $condition->getCalculatedValue($subTotal);
```

NOTE: All cart based conditions should be applied before calling **Cart::getTotal()**
Expand Down Expand Up @@ -529,6 +537,10 @@ $items->each(function($item)

## Changelogs

**2.1.0
- added new Cart Method: getCalculatedValue($totalOrSubTotalOrPrice)
- added new Item Method: getPriceSum()

**2.0.0 (breaking change)
- major changes in dealing with conditions (Please see [Conditions](#conditions) section, and read carefully)
- All conditions added on per item bases should have now target => 'item' instead of 'subtotal'
Expand Down

0 comments on commit a8d7b28

Please sign in to comment.