public function subTotal($format = true, $withDiscount = true)
    {
        $total = 0;

        if ($this->count() != 0) {
            foreach ($this->getItems() as $item) {
                $total += $item->subTotal(false, $withDiscount);
            }
        }

        if ($total < 0) {
            $total = 0;
        }

        return $this->formatMoney($total, null, null, $format);
    }
public function subTotal($format = true, $withDiscount = true)
    {
        $total = 0;

        if ($this->count() != 0) {
            foreach ($this->getItems() as $item) {
                $total += $item->subTotal(false, $withDiscount);
            }
        }

        if ($total < 0) {
            $total = 0;
        }

        return $this->formatMoney($total, null, null, $format);
    }
public function subTotal ( $ format = true , $ withDiscount = true ) { $ total = 0 ; if ( $ this -> count ( ) != 0 ) { foreach ( $ this -> getItems ( ) as $ item ) { $ total += $ item -> subTotal ( false , $ withDiscount ) ; } } if ( $ total < 0 ) { $ total = 0 ; } return $ this -> formatMoney ( $ total , null , null , $ format ) ; }
Gets the subtotal of the cart with or without tax.

@param bool $format
@param bool $withDiscount

@return string
Gets the subtotal of the cart with or without tax .