changed the strategy for cart values calculation (taxes per row),

test,
some fixes
This commit is contained in:
sartoric
2020-01-14 22:33:12 +01:00
parent 3abb164ddd
commit 9cdacf901c
3 changed files with 58 additions and 20 deletions

View File

@@ -375,7 +375,7 @@ class Cart
}
/**
* Get the subtotal (total - tax) of the items in the cart.
* Get the discount of the items in the cart.
*
* @return float
*/
@@ -387,7 +387,7 @@ class Cart
}
/**
* Get the subtotal (total - tax) of the items in the cart as formatted string.
* Get the discount of the items in the cart as formatted string.
*
* @param int $decimals
* @param string $decimalPoint
@@ -401,11 +401,11 @@ class Cart
}
/**
* Get the subtotal (total - tax) of the items in the cart.
* Get the price of the items in the cart.
*
* @return float
*/
public function initialFloat()
public function initialFloat() // TODO: rename and use priceTotal
{
return $this->getContent()->reduce(function ($initial, CartItem $cartItem) {
return $initial + ($cartItem->qty * $cartItem->price);
@@ -413,7 +413,7 @@ class Cart
}
/**
* Get the subtotal (total - tax) of the items in the cart as formatted string.
* Get the price of the items in the cart as formatted string.
*
* @param int $decimals
* @param string $decimalPoint