Merge tag 'v2.0.17' into develop
2.0.17 v2.0.17
This commit is contained in:
commit
67070483da
@ -153,10 +153,13 @@ class Cart:
|
|||||||
def get_total_price(self):
|
def get_total_price(self):
|
||||||
return sum(self.get_item_prices())
|
return sum(self.get_item_prices())
|
||||||
|
|
||||||
|
def get_weight_for_all_items(self):
|
||||||
|
for item in self:
|
||||||
|
yield round(Decimal(item['variant'].weight.value) * item['quantity'], 3)
|
||||||
|
|
||||||
def get_total_weight(self):
|
def get_total_weight(self):
|
||||||
if len(self) > 0:
|
if len(self) > 0:
|
||||||
for item in self:
|
return sum(self.get_weight_for_all_items())
|
||||||
return item['variant'].weight.value * sum(self.get_all_item_quantities())
|
|
||||||
else:
|
else:
|
||||||
return 0
|
return 0
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user