public function count($withItemQty = true)
    {
        $count = 0;

        foreach ($this->getItems() as $item) {
            if ($withItemQty) {
                $count += $item->qty;
            } else {
                $count++;
            }
        }

        return $count;
    }
public function count($withItemQty = true)
    {
        $count = 0;

        foreach ($this->getItems() as $item) {
            if ($withItemQty) {
                $count += $item->qty;
            } else {
                $count++;
            }
        }

        return $count;
    }
public function count ( $ withItemQty = true ) { $ count = 0 ; foreach ( $ this -> getItems ( ) as $ item ) { if ( $ withItemQty ) { $ count += $ item -> qty ; } else { $ count ++ ; } } return $ count ; }
Get the count based on qty, or number of unique items.

@param bool $withItemQty

@return int
Get the count based on qty or number of unique items .