Return the total amount of items added to the Cart.

@return int
348091
public function getTotalItemNumber()
    {
        return array_reduce(
            $this->cartLines->toArray(),
            function ($previousTotal, CartLineInterface $current) {
                return $previousTotal + $current->getQuantity();
            },
            0
        );
    }
628552
public function getTotalItemCount()
    {
        if ($this->rowCount !== null) {
            return $this->rowCount;
        }

        $param = null;

        if (is_array($this->select)) {
            $select = $this->select[0];
            $param = $this->select[1];
            $adt = $this->sql->getAdapter();

            $statement = $adt->query(sprintf("SELECT COUNT(1) AS c FROM (%s) AS original_select", $select), $adt::QUERY_MODE_PREPARE);
        } else {
            $select = clone $this->select;
            $select->reset(Select::LIMIT);
            $select->reset(Select::OFFSET);
            $select->reset(Select::ORDER);

            $countSelect = new Select();
            $countSelect->columns(array('c' => new Expression('COUNT(1)')));
            $countSelect->from(array('original_select' => $select));

            $statement = $this->sql->prepareStatementForSqlObject($countSelect);
        }

        $result = $statement->execute($param);
        $row = $result->current();

        $this->rowCount = $row['c'];

        return $this->rowCount;
    }
1241631
public function getDiscount() : ?int 
    {
        if ( ! $this->hasDiscount()) {
            $this->setDiscount($this->getDefaultDiscount());
        }
        return $this->discount;
    }
1021302
public function getItemsCount()
    {
        $count = 0;
        foreach ($this->feeds_registry as $feed) {
            $count += $feed->getItemsCount();
        }
        return $count;
    }
87219
public function discountAmount()
    {
        $totalDiscount = 0;

        foreach ($this->transaction->discounts as $discount) {
            $totalDiscount += $discount->amount;
        }

        return (float) $totalDiscount;
    }
1072719
public function calculateItemsTotal()
    {
        $itemsTotal = 0;

        foreach ($this->items as $item) {
            $itemsTotal += $item->getTotal();
        }

        $this->itemsTotal = $itemsTotal;

        return $this;
    }
395502
private function _getOrderTotal()
    {
        return array_reduce(
            $this->_orderShipments, 
            function($runningTotal, $item) {
                $runningTotal += $item->price;
                return $runningTotal;
            }
        );
    }
422286
public function totalExcludingTax()
    {
        return (float) array_sum(
            array_map(function (CartItem $item) {
                return $item->getTotalPriceExcludingTax();
            }, $this->items)
        );
    }
244190
public function getTotalPrice()
    {
        $totalPrice = 0;

        if ($this->count()) {
            foreach ($this->storage as $id => $item) {
                if (isset($item[ 'subTotal' ][ 'price' ])) {
                    $totalPrice += (int)$item[ 'price' ];
                }
            }
        }

        return $totalPrice;
    }
1286178
public function getTaxTotal()
    {
        $total = 0;
        $items = $this->Items();
        
        // Calculate total from items in the list
        foreach ($items as $item) {
            $tax = $item->UnitTax;
            $total += $tax * $item->Quantity;
        }
        
        $this->extend("updateTaxTotal", $total);

        $total = MathsHelper::round($total, 2);

        return $total;
    }
1192641
public function getCurrentPageLastItem()
    {
        $first = $this->getCurrentPageFirstItem();

        if (empty($first)) {
            return 0;
        }

        $last = $first + $this->limit - 1;

        if ($last > $this->total) {
            return $this->total;
        }

        return $last;
    }
820164
public function getTotalDiscountAttribute() {
        if (empty($this->shopCalculations)) $this->runCalculations();
        return round($this->shopCalculations->totalDiscount, 2);
    }
297896
public function getTotalWeight()
    {
        $total = 0;
        
        foreach ($this->Items() as $item) {
            if ($item->Weight && $item->Quantity) {
                $total = $total + ($item->Weight * $item->Quantity);
            }
        }

        $this->extend("updateTotalWeight", $total);
        
        return $total;
    }
1057605
public function count($totalItems = true)
        {
            $cart = $this->getContent();

            if(false === $totalItems) {
                return count($cart->_fields);
            }

            $count = 0;

            foreach($cart->_fields as $rowId) {
                $row = $cart->$rowId;
                $count += $row->qty;
            }

            return $count;
        }
402306
protected function getListCart()
    {
        $id = $this->getParam(0);

        if (!isset($id)) {
            return $this->cart->getList(array('limit' => $this->getLimit()));
        }

        if ($this->getParam('user')) {
            return $this->cart->getList(array('user_id' => $id, 'limit' => $this->getLimit()));
        }

        if ($this->getParam('sku')) {
            return $this->cart->getList(array('sku' => $id, 'limit' => $this->getLimit()));
        }

        if (!is_numeric($id)) {
            $this->errorAndExit($this->text('Invalid argument'));
        }

        if ($this->getParam('order')) {
            return $this->cart->getList(array('order_id' => $id, 'limit' => $this->getLimit()));
        }

        if ($this->getParam('store')) {
            return $this->cart->getList(array('store_id' => $id, 'limit' => $this->getLimit()));
        }

        $result = $this->cart->get($id);

        if (empty($result)) {
            $this->errorAndExit($this->text('Unexpected result'));
        }

        return array($result);
    }
1123581
public function getOrderTotalAmount(){
        if (isset($this->data['OrderTotal']) && isset($this->data['OrderTotal']['Amount'])){
            return $this->data['OrderTotal']['Amount'];
        } else {
            return false;
        }
    }
819604
public function getTaxTotal(): int
    {
        $taxTotal = 0;

        foreach ($this->getAdjustments(AdjustmentInterface::TAX_ADJUSTMENT) as $taxAdjustment) {
            $taxTotal += $taxAdjustment->getAmount();
        }
        foreach ($this->items as $item) {
            $taxTotal += $item->getTaxTotal();
        }

        return $taxTotal;
    }