Update Cart.php

This commit is contained in:
Patrick
2022-02-05 19:47:09 +01:00
committed by GitHub
parent d4dad63481
commit 05f1d8d5ad

View File

@@ -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) {