Closed PsyLogic closed 1 year ago
I'm trying to add items to the same session name but it gets only the last item added. I need to add many products to the same session 'shopping': here's the basic code following the docs:
shopping
public function addToCart(Request $request, Product $product, Cart $cart) { $this->cart = $cart->name('shopping'); $this->cart->addItem([ 'id' =>$product->uuid, 'title' => $product->title, 'quantity' => 1, 'price' => $product->price, ]); dd( $this->cart->getName(), $this->cart->getItems()); }
I'm trying to add items to the same session name but it gets only the last item added. I need to add many products to the same session '
shopping
': here's the basic code following the docs:Results: