Skip to content

Commit

Permalink
Fix totalPrice calculation (#194)
Browse files Browse the repository at this point in the history
Co-authored-by: Fabian Bender <[email protected]>
  • Loading branch information
cmaier and Fabtron authored Jul 23, 2024
1 parent 19e5fb3 commit 8838a43
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -451,7 +451,7 @@ class ShoppingCart(
val totalPrice: Int
get() = data.onlineTotalPrice ?: calculateTotalPrice()

private fun calculateTotalPrice(): Int = data.items.sumOf { it.totalDepositPrice }
private fun calculateTotalPrice(): Int = data.items.sumOf { it.totalPrice } + totalDepositPrice

/**
* Returns the total sum of deposit
Expand Down

0 comments on commit 8838a43

Please sign in to comment.