// optimization to Product constructor (stock data is not loaded by default)

This commit is contained in:
tDidierjean
2012-01-03 13:40:50 +00:00
parent 21e4a2fb89
commit 93e2f8b5bf
5 changed files with 32 additions and 6 deletions
@@ -1022,6 +1022,21 @@ class AdminProductsControllerCore extends AdminController
$this->display = 'list';
}
/**
* Override parent to add stock data to object
* We don't want to make a "full" product load because of side effects to prices
*
* @param boolean $opt Return an empty object if load fail
* @return object
*/
protected function loadObject($opt = false)
{
$result = parent::loadObject($opt);
if ($result)
$this->object->loadStockData();
return $result;
}
/**
* postProcess handle every checks before saving products information
*