From 3bbaadfea553e9105611619ea113690988180344 Mon Sep 17 00:00:00 2001 From: Patrick Date: Sat, 5 Feb 2022 19:15:07 +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 62b9817..db45319 100644 --- a/src/Cart.php +++ b/src/Cart.php @@ -134,7 +134,7 @@ class Cart } /* Also allow passing a Buyable instance, get data from the instance rather than parameters */ else if ($id instanceof Buyable) { - if (! is_int($nameOrQty)) { + if (! is_null($qtyOrOptions) && ! is_int($nameOrQty)) { throw new InvalidArgumentException('$nameOrQty must be of int (quantity) when adding a Buyable instance'); }