From 900244c5b28c26c9001e1200709e1e095b224b69 Mon Sep 17 00:00:00 2001 From: tDidierjean Date: Fri, 15 Apr 2011 10:17:10 +0000 Subject: [PATCH] [-] FO : fixed bug #PSCFI-1395 - PackCore static function "IsInStock" doesn't work for packs git-svn-id: http://dev.prestashop.com/svn/v1/branches/1.5.x@5915 b9a71923-0436-4b27-9f14-aed3839534dd --- classes/Pack.php | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/classes/Pack.php b/classes/Pack.php index ac848e0e7..14a20cd2f 100644 --- a/classes/Pack.php +++ b/classes/Pack.php @@ -82,10 +82,9 @@ class PackCore extends Product public static function isInStock($id_product) { - // Not enough, the quantity must be > to the item quantity of the pack, not just > 0 $items = self::getItems((int)($id_product), Configuration::get('PS_LANG_DEFAULT')); foreach ($items AS $item) - if ($item->quantity == 0 AND !$item->isAvailableWhenOutOfStock((int)($item->out_of_stock))) + if ($item->quantity < $item->pack_quantity AND !$item->isAvailableWhenOutOfStock((int)($item->out_of_stock))) return false; return true; }