How do I check and indicate that a product is already in the cart?
This StackExchange question explains how to set an array of IDs for items in your cart, and then compare those IDs against the IDs of a list of products: Check if cart contains valid products for discount code