LukePOLO\LaraCart\CartItem::subTotal PHP Method

subTotal() public method

Gets the sub total of the item based on the qty with or without tax in the proper format.
public subTotal ( boolean $format = true, boolean $withDiscount = true, boolean $taxedItemsOnly = false ) : string
$format boolean
$withDiscount boolean
$taxedItemsOnly boolean
return string
    public function subTotal($format = true, $withDiscount = true, $taxedItemsOnly = false)
    {
        $total = $this->price(false, $taxedItemsOnly) * $this->qty;
        if ($withDiscount) {
            $total -= $this->getDiscount(false);
        }
        return LaraCart::formatMoney($total, $this->locale, $this->internationalFormat, $format);
    }