File tree Expand file tree Collapse file tree 1 file changed +30
-0
lines changed Expand file tree Collapse file tree 1 file changed +30
-0
lines changed Original file line number Diff line number Diff line change @@ -201,6 +201,17 @@ Check if cart is empty: **Cart::isEmpty()**
201201Cart::isEmpty();
202202```
203203
204+ Get cart total quantity: ** Cart::getTotalQuantity()**
205+
206+ ``` php
207+ /**
208+ * get total quantity of items in the cart
209+ *
210+ * @return int
211+ */
212+ $cartTotalQuantity = Cart::getTotalQuantity();
213+ ```
214+
204215Get cart subtotal: ** Cart::getSubTotal()**
205216
206217``` php
@@ -388,6 +399,25 @@ Then Finally you can call **Cart::getSubTotal()** to get the Cart sub total with
388399$cartSubTotal = Cart::getSubTotal(); // the subtotal will be calculated based on the conditions you have provided
389400```
390401
402+ Add condition to exisiting Item on the cart: ** Cart::addItemCondition($productId, $itemCondition)**
403+
404+ Adding Condition to an existing Item on the cart is simple as well.
405+
406+ This is very useful when adding new conditions on an item during checkout process like coupons and promo codes.
407+ Let's see the example how to do it:
408+
409+ ``` php
410+ $productID = 456;
411+ $coupon101 = new CartCondition(array(
412+ 'name' => 'COUPON 101',
413+ 'type' => 'coupon',
414+ 'target' => 'item',
415+ 'value' => '-5%',
416+ ));
417+
418+ Cart::addItemCondition($productID, $coupon101);
419+ ```
420+
391421Clearing Cart Conditions: ** Cart::clearCartConditions()**
392422``` php
393423/**
You can’t perform that action at this time.
0 commit comments