We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent e6a4c91 commit 532cfedCopy full SHA for 532cfed
app/Services/CheckoutService.php
@@ -40,8 +40,6 @@ public function scan(string $item): void
40
$product = $this->find($item);
41
42
$this->addToCart($product);
43
-
44
-// $this->calculateTotal();
45
}
46
47
private function find(string $code): object
@@ -64,9 +62,8 @@ private function addToCart(object $product)
64
62
65
63
public function calculateTotal(): float
66
{
67
-// $this->total = $this->cart->flatten(1)->sum('price');
68
69
$groups = $this->cart->flatten(1)->groupBy('code')->all();
+
70
foreach ($groups as $code => $group) {
71
$rule = $this->pricing_rules[$code] ?? NULL;
72
if (!is_null($rule)) {
0 commit comments