Skip to content

Commit 05637f8

Browse files
committed
Update README.md
1 parent be3d255 commit 05637f8

File tree

1 file changed

+47
-0
lines changed

1 file changed

+47
-0
lines changed

README.md

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -356,6 +356,47 @@ Then Finally you can call **Cart::getSubTotal()** to get the Cart sub total with
356356
```php
357357
$cartSubTotal = Cart::getSubTotal(); // the subtotal will be calculated based on the conditions you have provided
358358
```
359+
360+
Clearing Cart Conditions: **Cart::clearCartConditions()**
361+
```php
362+
/**
363+
* clears all conditions on a cart,
364+
* this does not remove conditions that has been added specifically to an item/product.
365+
* If you wish to remove a specific condition to a product, you may use the method: removeItemCondition($itemId,$conditionName)
366+
*
367+
* @return void
368+
*/
369+
Cart::clearCartConditions()
370+
```
371+
372+
Remove Specific Cart Condition: **Cart::removeCartCondition($conditionName)**
373+
```php
374+
/**
375+
* removes a condition on a cart by condition name,
376+
* this can only remove conditions that are added on cart bases not conditions that are added on an item/product.
377+
* If you wish to remove a condition that has been added for a specific item/product, you may
378+
* use the removeItemCondition(itemId, conditionName) method instead.
379+
*
380+
* @param $conditionName
381+
* @return void
382+
*/
383+
$conditionName = 'Summer Sale 5%';
384+
385+
Cart::removeCartCondition($conditionName)
386+
```
387+
388+
Remove Specific Item Condition: **Cart::removeItemCondition($itemId, $conditionName)**
389+
```php
390+
/**
391+
* remove a condition that has been applied on an item that is already on the cart
392+
*
393+
* @param $itemId
394+
* @param $conditionName
395+
* @return bool
396+
*/
397+
Cart::removeItemCondition($itemId, $conditionName)
398+
```
399+
359400
## Instances
360401

361402
You may also want multiple cart instances on the same page without conflicts.
@@ -484,6 +525,12 @@ $items->each(function($item)
484525

485526
```
486527

528+
## Change Log
529+
**1.1.0
530+
- added new method: clearCartConditions()
531+
- added new method: removeItemCondition($itemId, $conditionName)
532+
- added new method: removeCartCondition($conditionName)
533+
487534
## License
488535

489536
The Laravel Shopping Cart is open-sourced software licensed under the [MIT license](http://opensource.org/licenses/MIT)

0 commit comments

Comments
 (0)