// Context part 20

git-svn-id: http://dev.prestashop.com/svn/v1/branches/1.5.x@7740 b9a71923-0436-4b27-9f14-aed3839534dd
This commit is contained in:
tDidierjean
2011-07-26 15:55:04 +00:00
parent fddc7a6a75
commit 51b4c8591d
10 changed files with 72 additions and 73 deletions
+4 -4
View File
@@ -118,15 +118,15 @@ class AttributeCore extends ObjectModel
* @param integer $qty Quantity needed
* @return boolean Quantity is available or not
*/
static public function checkAttributeQty($id_product_attribute, $qty, Context $context = null)
static public function checkAttributeQty($id_product_attribute, $qty, Shop $shop = null)
{
if (!$context)
$context = Context::getContext();
if (!$shop)
$$shop = Context::getContext()->shop;
$sql = 'SELECT quantity
FROM '._DB_PREFIX_.'stock
WHERE id_product_attribute = '.(int)$id_product_attribute
.$context->shop->sqlSharedStock();
.$shop->sqlSharedStock();
$result = (int)Db::getInstance()->getValue($sql);
return ($result AND $qty <= $result);