protected function updateTotals($keepDiscount = false)
    {
        $this->setSubtotal();

        if (! $keepDiscount) {
            $this->discount = $this->discountPercentage = 0;
            $this->couponId = null;
        }

        $this->setShippingCharges();

        $this->netTotal = round($this->subtotal - $this->discount + $this->shippingCharges, 2);

        $this->tax = round(($this->netTotal * config('cart_manager.tax_percentage')) / 100, 2);

        $this->total = round($this->netTotal + $this->tax, 2);

        $this->setPayableAndRoundOff();
    }
protected function updateTotals($keepDiscount = false)
    {
        $this->setSubtotal();

        if (! $keepDiscount) {
            $this->discount = $this->discountPercentage = 0;
            $this->couponId = null;
        }

        $this->setShippingCharges();

        $this->netTotal = round($this->subtotal - $this->discount + $this->shippingCharges, 2);

        $this->tax = round(($this->netTotal * config('cart_manager.tax_percentage')) / 100, 2);

        $this->total = round($this->netTotal + $this->tax, 2);

        $this->setPayableAndRoundOff();
    }
protected function updateTotals ( $ keepDiscount = false ) { $ this -> setSubtotal ( ) ; if ( ! $ keepDiscount ) { $ this -> discount = $ this -> discountPercentage = 0 ; $ this -> couponId = null ; } $ this -> setShippingCharges ( ) ; $ this -> netTotal = round ( $ this -> subtotal - $ this -> discount + $ this -> shippingCharges , 2 ) ; $ this -> tax = round ( ( $ this -> netTotal * config ( 'cart_manager.tax_percentage' ) ) / 100 , 2 ) ; $ this -> total = round ( $ this -> netTotal + $ this -> tax , 2 ) ; $ this -> setPayableAndRoundOff ( ) ; }
Sets the total variables of the object.

@param bool Weather to keep the discount in the cart
@return void
Sets the total variables of the object .