From a8d7b2880544142552f07abbb397841b973fc591 Mon Sep 17 00:00:00 2001 From: darryl fernandez Date: Wed, 18 Mar 2015 18:37:10 -0700 Subject: [PATCH] Update README.md --- README.md | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/README.md b/README.md index cfe6fa4..85f4190 100644 --- a/README.md +++ b/README.md @@ -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()** @@ -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()** @@ -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'