|
@@ -55,16 +55,12 @@ class Cart:
|
|
|
|
|
|
self.__total += product.price * count
|
|
self.__total += product.price * count
|
|
|
|
|
|
- def remove(self, product:Product, count=1):
|
|
|
|
|
|
+ def remove(self, product:Product, number=1):
|
|
if number >= self.goods[product]:
|
|
if number >= self.goods[product]:
|
|
number = self.goods[product]
|
|
number = self.goods[product]
|
|
self.goods[product] = self.goods.get(product, 0) - number
|
|
self.goods[product] = self.goods.get(product, 0) - number
|
|
self.__total -= number * product.price
|
|
self.__total -= number * product.price
|
|
- '''
|
|
|
|
- else:
|
|
|
|
- self.__total -= self.goods[product] * product.price
|
|
|
|
- self.goods[product] = 0
|
|
|
|
- '''
|
|
|
|
|
|
+
|
|
|
|
|
|
@property
|
|
@property
|
|
def total(self):
|
|
def total(self):
|