Skip to content

Commit ffdf66d

Browse files
committed
updated documentation
1 parent 9f696da commit ffdf66d

File tree

1 file changed

+8
-6
lines changed

1 file changed

+8
-6
lines changed

README.md

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ For Laravel 5.1~:
1919
```composer require "darryldecode/cart:~2.0"```
2020

2121
For Laravel 5.5 or 5.6~:
22-
```composer require "darryldecode/cart:~3.0"```
22+
```composer require "darryldecode/cart:~4.0"```
2323

2424
## CONFIGURATION
2525

@@ -349,7 +349,8 @@ If the target is "subtotal" then this condition will be applied to subtotal.
349349
If the target is "total" then this condition will be applied to total.
350350
The order of operation also during calculation will vary on the order you have added the conditions.
351351

352-
Also, when adding conditions, the 'value' field will be the bases of calculation.
352+
Also, when adding conditions, the 'value' field will be the bases of calculation. You can change this order
353+
by adding 'order' parameter in CartCondition.
353354

354355
```php
355356

@@ -395,14 +396,15 @@ $condition = new \Darryldecode\Cart\CartCondition(array(
395396
'type' => 'shipping',
396397
'target' => 'total', // this condition will be applied to cart's total when getTotal() is called.
397398
'value' => '+15',
398-
'order' => 1
399+
'order' => 1 // the order of calculation of cart base conditions. The bigger the later to be applied.
399400
));
400401
Cart::condition($condition);
401402

402-
403-
// The property 'order' lets you add different conditions through for example a shopping process with multiple
403+
// The property 'order' lets you control the sequence of conditions when calculated. Also it lets you add different conditions through for example a shopping process with multiple
404404
// pages and still be able to set an order to apply the conditions. If no order is defined defaults to 0
405405

406+
// NOTE!! On current version, 'order' parameter is only applicable for conditions for cart bases. It does not support on per item conditions.
407+
406408
// or add multiple conditions as array
407409
Cart::condition([$condition1, $condition2]);
408410

@@ -503,7 +505,7 @@ $item = array(
503505
Cart::add($item);
504506
```
505507

506-
> NOTE: All cart per-item conditions should be applied before calling **Cart::getSubTotal()**
508+
> NOTE: All cart per-item conditions should be added before calling **Cart::getSubTotal()**
507509
508510
Then Finally you can call **Cart::getSubTotal()** to get the Cart sub total with the applied conditions on each of the items.
509511
```php

0 commit comments

Comments
 (0)