Recalculate order adjustments total after adjustment is added or removed from order.

This commit is contained in:
Kayue Yeung 2021-04-01 17:39:40 +08:00 committed by TheMilek
parent a8419bbdf2
commit 6b69753689
No known key found for this signature in database
GPG key ID: 2E44205E7374692F

View file

@ -237,6 +237,8 @@ class Order implements OrderInterface
$this->addToAdjustmentsTotal($adjustment);
$adjustment->setAdjustable($this);
}
$this->recalculateAdjustmentsTotal();
}
public function removeAdjustment(AdjustmentInterface $adjustment): void
@ -246,6 +248,8 @@ class Order implements OrderInterface
$this->subtractFromAdjustmentsTotal($adjustment);
$adjustment->setAdjustable(null);
}
$this->recalculateAdjustmentsTotal();
}
public function hasAdjustment(AdjustmentInterface $adjustment): bool