You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+8-6Lines changed: 8 additions & 6 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -19,7 +19,7 @@ For Laravel 5.1~:
19
19
```composer require "darryldecode/cart:~2.0"```
20
20
21
21
For Laravel 5.5 or 5.6~:
22
-
```composer require "darryldecode/cart:~3.0"```
22
+
```composer require "darryldecode/cart:~4.0"```
23
23
24
24
## CONFIGURATION
25
25
@@ -349,7 +349,8 @@ If the target is "subtotal" then this condition will be applied to subtotal.
349
349
If the target is "total" then this condition will be applied to total.
350
350
The order of operation also during calculation will vary on the order you have added the conditions.
351
351
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.
353
354
354
355
```php
355
356
@@ -395,14 +396,15 @@ $condition = new \Darryldecode\Cart\CartCondition(array(
395
396
'type' => 'shipping',
396
397
'target' => 'total', // this condition will be applied to cart's total when getTotal() is called.
397
398
'value' => '+15',
398
-
'order' => 1
399
+
'order' => 1 // the order of calculation of cart base conditions. The bigger the later to be applied.
399
400
));
400
401
Cart::condition($condition);
401
402
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
404
404
// pages and still be able to set an order to apply the conditions. If no order is defined defaults to 0
405
405
406
+
// NOTE!! On current version, 'order' parameter is only applicable for conditions for cart bases. It does not support on per item conditions.
407
+
406
408
// or add multiple conditions as array
407
409
Cart::condition([$condition1, $condition2]);
408
410
@@ -503,7 +505,7 @@ $item = array(
503
505
Cart::add($item);
504
506
```
505
507
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()**
507
509
508
510
Then Finally you can call **Cart::getSubTotal()** to get the Cart sub total with the applied conditions on each of the items.
0 commit comments