diff --git a/store/models.py b/store/models.py index a638ea4..90f4d0c 100644 --- a/store/models.py +++ b/store/models.py @@ -459,14 +459,14 @@ class Checklist(models.Model): if self.price_snapshot_id: return self.price_snapshot.commission_rub - commission = (self.price_rub * Decimal(settings.COMMISSION_OVER_150K) - if self.price_rub > 150_000 - else GlobalSettings.load().commission_rub) - - # Add commission of bottom-most category - if self.category_id: + if self.price_rub > 150_000: + commission = self.price_rub * Decimal(settings.COMMISSION_OVER_150K) + elif self.category_id: + # Add commission of bottom-most category category_commission = getattr(self.category, 'commission', 0) - commission += category_commission * self.price_rub / 100 + commission = self.price_rub / 100 * category_commission + else: + commission = GlobalSettings.load().commission_rub return commission