Update
This commit is contained in:
@@ -54,12 +54,12 @@ class CartController extends Controller
|
||||
$unitPrice = round($unitPrice, 2);
|
||||
|
||||
// Unieke sleutel in sessie op basis van product + configuratie
|
||||
$cartKey = md5($product->id . '_' . $validated['material'] . '_' . $validated['color'] . '_' . $scale);
|
||||
$cartKey = md5($product->id.'_'.$validated['material'].'_'.$validated['color'].'_'.$scale);
|
||||
|
||||
$cart = session()->get('cart', []);
|
||||
|
||||
if (isset($cart[$cartKey])) {
|
||||
$cart[$cartKey]['quantity'] += (int)$validated['quantity'];
|
||||
$cart[$cartKey]['quantity'] += (int) $validated['quantity'];
|
||||
} else {
|
||||
$cart[$cartKey] = [
|
||||
'id' => $product->id,
|
||||
@@ -72,7 +72,7 @@ class CartController extends Controller
|
||||
'scale' => $scale,
|
||||
'infill' => $validated['infill'] ?? 'Standaard (20%)',
|
||||
'price' => $unitPrice,
|
||||
'quantity' => (int)$validated['quantity'],
|
||||
'quantity' => (int) $validated['quantity'],
|
||||
];
|
||||
}
|
||||
|
||||
@@ -99,7 +99,7 @@ class CartController extends Controller
|
||||
$cart = session()->get('cart', []);
|
||||
|
||||
if (isset($cart[$validated['key']])) {
|
||||
$cart[$validated['key']]['quantity'] = (int)$validated['quantity'];
|
||||
$cart[$validated['key']]['quantity'] = (int) $validated['quantity'];
|
||||
session()->put('cart', $cart);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user