mirror of
https://github.com/wearepixel/laravel-cart.git
synced 2026-11-14 13:51:44 +00:00
feat: add tests and fix item level conditions for database storage
This commit is contained in:
+1
-5
@@ -521,14 +521,10 @@ public function getSubTotalWithoutConditions($formatted = true)
|
||||
return Helpers::formatValue(floatval($sum), $formatted, $this->config);
|
||||
}
|
||||
|
||||
/**
|
||||
* get cart sub total
|
||||
*
|
||||
* @param bool $formatted
|
||||
*/
|
||||
public function getSubTotal($formatted = true): int|float|string
|
||||
{
|
||||
$subTotal = 0.00;
|
||||
|
||||
// add all the items together with conditions applied
|
||||
$subTotalSum = $this->getContent()->sum(function (ItemCollection $item) {
|
||||
return $item->getPriceSumWithConditions(false);
|
||||
|
||||
Reference in New Issue
Block a user