Move the checking whether the product is already in the order into the code contract.