Skip to content

Commit 532cfed

Browse files
committed
cleaning up CheckoutService
1 parent e6a4c91 commit 532cfed

File tree

1 file changed

+1
-4
lines changed

1 file changed

+1
-4
lines changed

app/Services/CheckoutService.php

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -40,8 +40,6 @@ public function scan(string $item): void
4040
$product = $this->find($item);
4141

4242
$this->addToCart($product);
43-
44-
// $this->calculateTotal();
4543
}
4644

4745
private function find(string $code): object
@@ -64,9 +62,8 @@ private function addToCart(object $product)
6462

6563
public function calculateTotal(): float
6664
{
67-
// $this->total = $this->cart->flatten(1)->sum('price');
68-
6965
$groups = $this->cart->flatten(1)->groupBy('code')->all();
66+
7067
foreach ($groups as $code => $group) {
7168
$rule = $this->pricing_rules[$code] ?? NULL;
7269
if (!is_null($rule)) {

0 commit comments

Comments
 (0)