How do I add a prevent duplicate item RULE to my commerce site I am learning/working with RULES in my Drupal7 Commerce store.  I thought this would be a fairly simple rule to create, but I can't find a work around for my need.  I have a commerce site, that has our team uniforms.  Each member is entitled to one and only one patch.  If they add a second patch to their cart, I want a message to appear telling them that they can only have one patch in there cart and the add to cart process stopped. 

So here is the scenario.  


Click the Add to Cart button for first patch, order/item/patch goes
into cart
Click the Add to Cart button for a second patch, message
appears "you can't do that" and item does not go into cart


Where I am stuck is,  what to select in the RULES UI, so it will check to see what is in the cart, look at the sku or item number [both of these are unique to the item], determine if the item that is to be added a duplicate, if so, pop up warning message, do not continue the process of adding that item.

Any help would be greatly appreciated.
You're looking for the action 'commerce-order: commerce-line-items' in Rules as a way of inspecting and testing against what the user already has in their carts. The recipe outlined here goes through how to add this rule in and do some preliminary testing, I've tried to modify it for your use case:


Create rule, name it; Event: before adding a product to the cart
Add your conditions, ex. check if content is a patch
In Actions add Loop through commerce-order:commerce-line-items
Create component, single rule, name it 
Create following variables of the component and name them as you wish:

Commerce line item (line item of the order from the loop of the main rule)
Commerce product (product added to the cart)

Add condition to the component: Entity has field, Entity: [line-item-in-order], Field: commerce_product. this will bring us the product from actual line item in current order (shopping cart).
Add condition to the component: Data comparison. Data to compare: line-item-in-order:commerce-product with product-added-to-cart -- This would be where you would determine if it is also a patch
Add action to the component: Remove an item from a list. List: [order:commerce-line-items], Item to remove: [line-item-in-order].
This will completely remove duplicated product from the shopping cart and from the order as well. 
Eventually add another actions. At least Display some message to the user to inform him/her that the item has been removed sounds sensible.


Come back to your main rule created in step 1. Add action to the loop and select the component you have just created in steps 4. - 9. and set the variables.