public function totals()
    {
        setlocale(LC_MONETARY, config('cart_manager.LC_MONETARY'));

        $totals = ['Subtotal' => money_format('%n', $this->subtotal)];

        if ($this->discount > 0) {
            $totals['Discount'] = money_format('%n', $this->discount);
        }

        if ($this->shippingCharges > 0) {
            $totals['Shipping charges'] = money_format('%n', $this->shippingCharges);
        }

        if ($this->subtotal != $this->netTotal) {
            $totals['Net total'] = money_format('%n', $this->netTotal);
        }

        $totals['Tax'] = money_format('%n', $this->tax);

        if ($this->roundOff != 0) {
            $totals['Total'] = money_format('%n', $this->total);
            $totals['Round off'] = money_format('%n', $this->roundOff);
        }

        $totals['Payable'] = money_format('%n', $this->payable);

        return $totals;
    }
public function totals()
    {
        setlocale(LC_MONETARY, config('cart_manager.LC_MONETARY'));

        $totals = ['Subtotal' => money_format('%n', $this->subtotal)];

        if ($this->discount > 0) {
            $totals['Discount'] = money_format('%n', $this->discount);
        }

        if ($this->shippingCharges > 0) {
            $totals['Shipping charges'] = money_format('%n', $this->shippingCharges);
        }

        if ($this->subtotal != $this->netTotal) {
            $totals['Net total'] = money_format('%n', $this->netTotal);
        }

        $totals['Tax'] = money_format('%n', $this->tax);

        if ($this->roundOff != 0) {
            $totals['Total'] = money_format('%n', $this->total);
            $totals['Round off'] = money_format('%n', $this->roundOff);
        }

        $totals['Payable'] = money_format('%n', $this->payable);

        return $totals;
    }
public function totals ( ) { setlocale ( LC_MONETARY , config ( 'cart_manager.LC_MONETARY' ) ) ; $ totals = [ 'Subtotal' => money_format ( '%n' , $ this -> subtotal ) ] ; if ( $ this -> discount > 0 ) { $ totals [ 'Discount' ] = money_format ( '%n' , $ this -> discount ) ; } if ( $ this -> shippingCharges > 0 ) { $ totals [ 'Shipping charges' ] = money_format ( '%n' , $ this -> shippingCharges ) ; } if ( $ this -> subtotal != $ this -> netTotal ) { $ totals [ 'Net total' ] = money_format ( '%n' , $ this -> netTotal ) ; } $ totals [ 'Tax' ] = money_format ( '%n' , $ this -> tax ) ; if ( $ this -> roundOff != 0 ) { $ totals [ 'Total' ] = money_format ( '%n' , $ this -> total ) ; $ totals [ 'Round off' ] = money_format ( '%n' , $ this -> roundOff ) ; } $ totals [ 'Payable' ] = money_format ( '%n' , $ this -> payable ) ; return $ totals ; }
Returns the cart totals with currency.

@return array
Returns the cart totals with currency .