I'm attempting to modify the cart to list every item individually - even duplicate products.
I'm picking up someone else's project and have been asked to modify it. Totally new to Laravel so I'm out my depth
i found in Cart::insert the check if an item is already in the basket, but I can't understand how to give it a new $itemidentifier if it already exists.
if ($this->has($itemIdentifier)) {
$item['quantity'] = $this->item($itemIdentifier)->quantity + $item['quantity'];
I'm guessing i need to modify createItemIdentifier somehow but every attempt so far has just resulted in adding to the cart not adding the item (I think I'm just changing the $itemIdentifier for the existing cart item not creating a new one).
Just looking for a pointer of where to look, please.
I'm attempting to modify the cart to list every item individually - even duplicate products. I'm picking up someone else's project and have been asked to modify it. Totally new to Laravel so I'm out my depth
i found in
Cart::insert
the check if an item is already in the basket, but I can't understand how to give it a new$itemidentifier
if it already exists.I'm guessing i need to modify
createItemIdentifier
somehow but every attempt so far has just resulted in adding to the cart not adding the item (I think I'm just changing the$itemIdentifier
for the existing cart item not creating a new one). Just looking for a pointer of where to look, please.