Commit 188316c4 authored by Thorsten Buss's avatar Thorsten Buss

FIX: sum int and Money/TaxedMoney in totalItemsWithoutConditions

parent a6e147eb
......@@ -132,6 +132,9 @@ class CurrencyCart extends Cart {
*/
public function totalItemsWithoutConditions() {
$sum = $this->items()->sum(function (Item $item) {
if ($item->priceSum() instanceof Money) {
return $item->priceSum()->amount();
}
return $item->priceSum();
});
......@@ -236,4 +239,4 @@ class CurrencyCart extends Cart {
return parent::addItemCondition($productId, $itemCondition);
}
}
\ No newline at end of file
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment