Check if item already in cart – WooCommerce

By | August 13, 2018

In WooCommerce, Looking for code by which you can check Product that you going to ADD to CART already exist in Cart or not ?
By Below code you can check whether an item has already been added to your WooCommerce cart or not ?

With use of above code you can implement login like it same Product already exist in Cart than instead of adding more time or showing Error / Warning Message specially for a digital products redirect them to Cart Or Checkout page.