@KenWhitesell @oneflydown
Thanks A lot Guys. which you a happy days.
Kind of struggling with this way of Implementation,
I changed the Implementation a little, removed the Item
Class and made OrderItem
Class has attribute product
with ForeignKeyField
to Product
Class Instead of Item
Class with OneToOneField
into Product
Class.
and i reset the DataBase and Migrations also.
now the logic is working one time only when i click add to cart it works., but when i click again it suppose to add one more product to the cart, instead it show this error
AttributeError at /baskets/add-to-basket/elegance-chair-c4-50x50-137964
'OrderItem' object has no attribute 'exists'
and Highlighted this line:
if order.items.get(product__slug=product.slug).exists():