feat: add tests and fix item level conditions for database storage

This commit is contained in:
Joel Male
2025-02-25 16:31:42 +10:00
parent 158cf38f14
commit 7adf5ecd1f
4 changed files with 116 additions and 9 deletions
+1 -5
View File
@@ -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);