public function subTotal($format = true, $withDiscount = true, $taxedItemsOnly = false, $withTax = false)
    {
        $total = $this->price(false, $taxedItemsOnly) * $this->qty;

        if ($withDiscount) {
            $total -= $this->getDiscount(false);
        }

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

        if ($withTax) {
            $total += $this->tax(0, false, false, $withDiscount);
        }

        return LaraCart::formatMoney($total, $this->locale, $this->internationalFormat, $format);
    }
public function subTotal($format = true, $withDiscount = true, $taxedItemsOnly = false, $withTax = false)
    {
        $total = $this->price(false, $taxedItemsOnly) * $this->qty;

        if ($withDiscount) {
            $total -= $this->getDiscount(false);
        }

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

        if ($withTax) {
            $total += $this->tax(0, false, false, $withDiscount);
        }

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

@param bool $format
@param bool $withDiscount
@param bool $taxedItemsOnly
@param bool $withTax

@return string
Gets the sub total of the item based on the qty with or without tax in the proper format .