mirror of
https://github.com/kevin-DL/LaravelShoppingcart.git
synced 2026-01-23 15:41:24 +00:00
Update Cart.php
This commit is contained in:
@@ -142,7 +142,7 @@ class Cart
|
|||||||
throw new InvalidArgumentException('$qtyOrOptions must be of array (options) or null when adding a Buyable instance');
|
throw new InvalidArgumentException('$qtyOrOptions must be of array (options) or null when adding a Buyable instance');
|
||||||
}
|
}
|
||||||
|
|
||||||
$cartItem = CartItem::fromBuyable($id, $nameOrQty ?: 1, $qtyOrOptions ?: []);
|
$cartItem = CartItem::fromBuyable($id, $nameOrQty ?: 1, new CartItemOptions($qtyOrOptions ?: []));
|
||||||
$cartItem->associate($id);
|
$cartItem->associate($id);
|
||||||
|
|
||||||
return $this->addCartItem($cartItem);
|
return $this->addCartItem($cartItem);
|
||||||
|
|||||||
Reference in New Issue
Block a user