Skip to content

Commit a8d7b28

Browse files
committed
Update README.md
1 parent 4369ebe commit a8d7b28

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

README.md

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -151,6 +151,9 @@ Getting an item on a cart: **Cart::get()**
151151
$itemId = 456;
152152

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

156159
Getting cart's contents and count: **Cart::getContent()**
@@ -280,6 +283,11 @@ $condition->getTarget(); // the target of which the condition was applied
280283
$condition->getName(); // the name of the condition
281284
$condition->getType(); // the type
282285
$condition->getValue(); // the value of the condition
286+
287+
// You can get the conditions calculated value by providing the subtotal, see below:
288+
$subTotal = Cart::getSubTotal();
289+
$condition = Cart::getCondition('VAT 12.5%');
290+
$conditionCalculatedValue = $condition->getCalculatedValue($subTotal);
283291
```
284292

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

530538
## Changelogs
531539

540+
**2.1.0
541+
- added new Cart Method: getCalculatedValue($totalOrSubTotalOrPrice)
542+
- added new Item Method: getPriceSum()
543+
532544
**2.0.0 (breaking change)
533545
- major changes in dealing with conditions (Please see [Conditions](#conditions) section, and read carefully)
534546
- All conditions added on per item bases should have now target => 'item' instead of 'subtotal'

0 commit comments

Comments
 (0)