From 73a6b8f9919816a6638b2da41f38692bf735b977 Mon Sep 17 00:00:00 2001 From: darryl fernandez Date: Tue, 16 Jun 2015 00:29:38 -0700 Subject: [PATCH] Update README.md --- README.md | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/README.md b/README.md index 310ea8d..ab7a36f 100644 --- a/README.md +++ b/README.md @@ -276,6 +276,10 @@ $condition = new \Darryldecode\Cart\CartCondition(array( 'type' => 'tax', 'target' => 'subtotal', 'value' => '12.5%', + 'attributes' => array( // attributes field is optional + 'description' => 'Value added tax', + 'more_data' => 'more data here' + ) )); Cart::condition($condition); @@ -307,6 +311,7 @@ foreach($carConditions as $condition) $condition->getName(); // the name of the condition $condition->getType(); // the type $condition->getValue(); // the value of the condition + $condition->getAttributes(); // the attributes of the condition, returns an empty [] if no attributes added } // You can also get a condition that has been applied on the cart by using its name, use below: @@ -315,6 +320,7 @@ $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 +$condition->getAttributes(); // the attributes of the condition, returns an empty [] if no attributes added // You can get the conditions calculated value by providing the subtotal, see below: $subTotal = Cart::getSubTotal(); @@ -614,6 +620,9 @@ $items->each(function($item) ## Changelogs +**2.4.0 +- added new method on a condition: $condition->getAttributes(); (Please see [Conditions](#conditions) section) + **2.3.0 - added new Cart Method: Cart::addItemCondition($productId, $itemCondition) - added new Cart Method: Cart::getTotalQuantity()