public function getCartData()
    {
        $selectColumns = ['id', 'subtotal', 'discount', 'discount_percentage', 'coupon_id', 'shipping_charges', 'net_total', 'tax', 'total', 'round_off', 'payable'];

        $cartData = Cart::with($this->cartItemsQuery())
            ->where($this->cartIdentifier())
            ->first($selectColumns)
        ;

        // If there is no cart record for the logged in customer, try with cookie identifier
        if (! $cartData && Auth::guard(config('cart_manager.auth_guard'))->check()) {
            $cartData = Cart::with($this->cartItemsQuery())
                ->where($this->getCookieElement())
                ->first($selectColumns)
            ;

            if ($cartData) {
                $this->assignCustomerToCartRecord();
            }
        }

        if (! $cartData) {
            return [];
        }

        return $cartData->toArray();
    }
public function getCartData()
    {
        $selectColumns = ['id', 'subtotal', 'discount', 'discount_percentage', 'coupon_id', 'shipping_charges', 'net_total', 'tax', 'total', 'round_off', 'payable'];

        $cartData = Cart::with($this->cartItemsQuery())
            ->where($this->cartIdentifier())
            ->first($selectColumns)
        ;

        // If there is no cart record for the logged in customer, try with cookie identifier
        if (! $cartData && Auth::guard(config('cart_manager.auth_guard'))->check()) {
            $cartData = Cart::with($this->cartItemsQuery())
                ->where($this->getCookieElement())
                ->first($selectColumns)
            ;

            if ($cartData) {
                $this->assignCustomerToCartRecord();
            }
        }

        if (! $cartData) {
            return [];
        }

        return $cartData->toArray();
    }
public function getCartData ( ) { $ selectColumns = [ 'id' , 'subtotal' , 'discount' , 'discount_percentage' , 'coupon_id' , 'shipping_charges' , 'net_total' , 'tax' , 'total' , 'round_off' , 'payable' ] ; $ cartData = Cart :: with ( $ this -> cartItemsQuery ( ) ) -> where ( $ this -> cartIdentifier ( ) ) -> first ( $ selectColumns ) ; // If there is no cart record for the logged in customer, try with cookie identifier if ( ! $ cartData && Auth :: guard ( config ( 'cart_manager.auth_guard' ) ) -> check ( ) ) { $ cartData = Cart :: with ( $ this -> cartItemsQuery ( ) ) -> where ( $ this -> getCookieElement ( ) ) -> first ( $ selectColumns ) ; if ( $ cartData ) { $ this -> assignCustomerToCartRecord ( ) ; } } if ( ! $ cartData ) { return [ ] ; } return $ cartData -> toArray ( ) ; }
Returns current cart data.

@return array
Returns current cart data .