diff --git a/services/CartBundleService.php b/services/CartBundleService.php index b0cbc6d..a433a13 100644 --- a/services/CartBundleService.php +++ b/services/CartBundleService.php @@ -42,15 +42,20 @@ public function cartItemsCount() { // Get the current cart $cart = craft()->commerce_cart->getCart(); - $cartItemsCount = count( $cart->lineItems ); + $lineItems = $cart->lineItems; // Only worry about doing more processing if there are enough items in the cart to bundle - if ( $cartItemsCount > 1 ) { + if ( count( $lineItems ) > 1 ) { $lineItems = $this->bundleItems( $cart->lineItems ); - $cartItemsCount = count( $lineItems ); } - return $cartItemsCount; + $qty = 0; + + foreach ( $lineItems as $item ) { + $qty += $item->qty; + } + + return $qty; } /**