From 05f1d8d5ad2db82b594e0edaefa7c2491def3b6b Mon Sep 17 00:00:00 2001 From: Patrick Date: Sat, 5 Feb 2022 19:47:09 +0100 Subject: [PATCH] Update Cart.php --- src/Cart.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Cart.php b/src/Cart.php index b03817f..fe4df59 100644 --- a/src/Cart.php +++ b/src/Cart.php @@ -130,7 +130,7 @@ class Cart throw new InvalidArgumentException('$nameOrQty must be of int (quantity) or null when adding with raw parameters'); } - return $this->addCartItem(CartItem::fromAttributes($id, $nameOrQty, $price, $qtyOrOptions ?: 1, $weight, $options ?: new CartItemOptions([]))); + return $this->addCartItem(CartItem::fromAttributes($id, $nameOrQty, $price, $qtyOrOptions ?: 1, $weight ?: 0, $options ?: new CartItemOptions([]))); } /* Also allow passing a Buyable instance, get data from the instance rather than parameters */ else if ($id instanceof Buyable) {