Update Cart.php

This commit is contained in:
Patrick
2022-02-05 19:16:38 +01:00
committed by GitHub
parent 3bbaadfea5
commit f73b44bbf7

View File

@@ -142,7 +142,7 @@ class Cart
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);
return $this->addCartItem($cartItem);