LukePOLO\LaraCart\LaraCart::total PHP Method

total() public method

Gets the total of the cart with or without tax.
public total ( boolean $format = true, boolean $withDiscount = true, $withTax = true, $withFees = true ) : string
$format boolean
$withDiscount boolean
return string
    public function total($format = true, $withDiscount = true, $withTax = true, $withFees = true)
    {
        $total = $this->subTotal(false);
        if ($withFees) {
            $total += $this->feeTotals(false);
        }
        if ($withDiscount) {
            $total -= $this->totalDiscount(false);
        }
        if ($withTax) {
            $total += $this->taxTotal(false);
        }
        return $this->formatMoney($total, null, null, $format);
    }