Skip to content

Commit

Permalink
Update README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
darryldecode committed Jun 16, 2015
1 parent 7d25d94 commit 73a6b8f
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down Expand Up @@ -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:
Expand All @@ -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();
Expand Down Expand Up @@ -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()
Expand Down

0 comments on commit 73a6b8f

Please sign in to comment.