File tree Expand file tree Collapse file tree 2 files changed +13
-1
lines changed
Expand file tree Collapse file tree 2 files changed +13
-1
lines changed Original file line number Diff line number Diff line change @@ -284,7 +284,7 @@ protected function isInStock($variants): bool
284284 }
285285 }
286286
287- if ($ stock == = 0 and $ deny ) {
287+ if ($ stock < = 0 and $ deny ) {
288288 return false ;
289289 }
290290
Original file line number Diff line number Diff line change @@ -156,6 +156,18 @@ public function outputs_in_stock()
156156 ])->save ();
157157
158158 $ this ->assertEquals ('' , $ this ->tag ('{{ if {shopify:in_stock} }}Yes{{ /if }} ' , ['slug ' => 'obi-wan ' ]));
159+
160+ $ variant ->merge ([
161+ 'inventory_quantity ' => -1 ,
162+ ])->save ();
163+
164+ $ this ->assertEquals ('' , $ this ->tag ('{{ if {shopify:in_stock} }}Yes{{ /if }} ' , ['slug ' => 'obi-wan ' ]));
165+
166+ $ variant ->merge ([
167+ 'inventory_quantity ' => null ,
168+ ])->save ();
169+
170+ $ this ->assertEquals ('' , $ this ->tag ('{{ if {shopify:in_stock} }}Yes{{ /if }} ' , ['slug ' => 'obi-wan ' ]));
159171 }
160172
161173 #[Test]
You can’t perform that action at this time.
0 commit comments