def add_to_cart(self, product, quantity):
try:<EOL><INDENT>product_item = commerce.ProductItem.objects.get(<EOL>cart=self.cart,<EOL>product=product)<EOL>old_quantity = product_item.quantity<EOL><DEDENT>except ObjectDoesNotExist:<EOL><INDENT>old_quantity = <NUM_LIT:0><EOL><DEDENT>self.set_quantity(product, old_quantity + quantity)<EOL>
Adds _quantity_ of the given _product_ to the cart. Raises
        ValidationError if constraints are violated.