I use a code that changes the text of the "Add to Cart" button for a product if the item is already in the cart.
/* for single product */ add_filter