Skip to content

Commit 73a6b8f

Browse files
committed
Update README.md
1 parent 7d25d94 commit 73a6b8f

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

README.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -276,6 +276,10 @@ $condition = new \Darryldecode\Cart\CartCondition(array(
276276
'type' => 'tax',
277277
'target' => 'subtotal',
278278
'value' => '12.5%',
279+
'attributes' => array( // attributes field is optional
280+
'description' => 'Value added tax',
281+
'more_data' => 'more data here'
282+
)
279283
));
280284

281285
Cart::condition($condition);
@@ -307,6 +311,7 @@ foreach($carConditions as $condition)
307311
$condition->getName(); // the name of the condition
308312
$condition->getType(); // the type
309313
$condition->getValue(); // the value of the condition
314+
$condition->getAttributes(); // the attributes of the condition, returns an empty [] if no attributes added
310315
}
311316

312317
// 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
315320
$condition->getName(); // the name of the condition
316321
$condition->getType(); // the type
317322
$condition->getValue(); // the value of the condition
323+
$condition->getAttributes(); // the attributes of the condition, returns an empty [] if no attributes added
318324

319325
// You can get the conditions calculated value by providing the subtotal, see below:
320326
$subTotal = Cart::getSubTotal();
@@ -614,6 +620,9 @@ $items->each(function($item)
614620

615621
## Changelogs
616622

623+
**2.4.0
624+
- added new method on a condition: $condition->getAttributes(); (Please see [Conditions](#conditions) section)
625+
617626
**2.3.0
618627
- added new Cart Method: Cart::addItemCondition($productId, $itemCondition)
619628
- added new Cart Method: Cart::getTotalQuantity()

0 commit comments

Comments
 (0)