Menu Close
    Hire us Request quote Reading list Switch to dark mode

    How to check if the cart is virtual

    In this blog we will see how to check if the cart is virtual or not in magento 2.

    After adding the products to the cart, when ever we need to check if the products added in the cart is virtual without looping over quote item or doing some other stuffs.

    we will use the Quote object containing the quoted data and use isVirtual method of the quote class.

    Here i will show you how.

    Now, the return type we are going to get is bool. And perfom our operation using the stuff.

    Thank you for checking this blog.

    Please let me know if you find any issue.

    . . .


    Add Your Comment

    Be the first to comment.

    Back to Top
    Hire Us!
    Brief us about your requirements and we'll get back to you.
    Woo! Hooy!
    We have just received your message and our expert will get back to you shortly.
    Send Again