public function getQuantity(array $options, $type = null)
    {
        $options += array('order_id' => 0);

        $result = array(
            'total' => 0,
            'sku' => array()
        );

        foreach ((array) $this->getList($options) as $item) {
            $result['total'] += (int) $item['quantity'];
            $result['sku'][$item['sku']] = (int) $item['quantity'];
        }

        if (isset($type)) {
            return $result[$type];
        }

        return $result;
    }
public function getQuantity(array $options, $type = null)
    {
        $options += array('order_id' => 0);

        $result = array(
            'total' => 0,
            'sku' => array()
        );

        foreach ((array) $this->getList($options) as $item) {
            $result['total'] += (int) $item['quantity'];
            $result['sku'][$item['sku']] = (int) $item['quantity'];
        }

        if (isset($type)) {
            return $result[$type];
        }

        return $result;
    }
public function getQuantity ( array $ options , $ type = null ) { $ options += array ( 'order_id' => 0 ) ; $ result = array ( 'total' => 0 , 'sku' => array ( ) ) ; foreach ( ( array ) $ this -> getList ( $ options ) as $ item ) { $ result [ 'total' ] += ( int ) $ item [ 'quantity' ] ; $ result [ 'sku' ] [ $ item [ 'sku' ] ] = ( int ) $ item [ 'quantity' ] ; } if ( isset ( $ type ) ) { return $ result [ $ type ] ; } return $ result ; }
Returns cart quantity
@param array $options
@param string $type
@return array|integer
Returns cart quantity