// Stock Available : bug fix

git-svn-id: http://dev.prestashop.com/svn/v1/branches/1.5.x@10408 b9a71923-0436-4b27-9f14-aed3839534dd
This commit is contained in:
dSevere
2011-11-22 12:57:09 +00:00
parent 7b394c6cbd
commit e095ebccd3
2 changed files with 2 additions and 2 deletions
+1 -1
View File
@@ -392,7 +392,7 @@ class StockAvailableCore extends ObjectModel
* @param int $id_shop Optional : gets context if null @see Context::getContext() * @param int $id_shop Optional : gets context if null @see Context::getContext()
* @return bool : depends on stock @see $depends_on_stock * @return bool : depends on stock @see $depends_on_stock
*/ */
public function outOfStock($id_product, $id_shop = null) public static function outOfStock($id_product, $id_shop = null)
{ {
if (is_null($id_shop)) if (is_null($id_shop))
$id_shop = Context::getContext()->shop->getID(true); $id_shop = Context::getContext()->shop->getID(true);
@@ -3219,7 +3219,7 @@ class AdminProductsController extends AdminController
if (Tools::getValue('id_product_attribute') === false) if (Tools::getValue('id_product_attribute') === false)
return Tools::jsonEncode(array('error' => 'Undefined id product attribute')); return Tools::jsonEncode(array('error' => 'Undefined id product attribute'));
// @todo : Product class should handle that // @todo : Product class should handle that
$stock_available = new StockAvailable(StockAvailable::getIdStockAvailableByProductId($product->id, (int)Tools::getValue('id_product_attribute'))); $stock_available = new StockAvailable(StockAvailable::getStockAvailableIdByProductId($product->id, (int)Tools::getValue('id_product_attribute')));
if (!$stock_available->id) if (!$stock_available->id)
{ {
$stock_available->id_product = $product->id; $stock_available->id_product = $product->id;