//small fix

git-svn-id: http://dev.prestashop.com/svn/v1/branches/1.5.x@16727 b9a71923-0436-4b27-9f14-aed3839534dd
This commit is contained in:
vAugagneur
2012-08-06 14:47:52 +00:00
parent cd5a54afd1
commit b1e130854f
2 changed files with 7 additions and 2 deletions
+6 -1
View File
@@ -4829,12 +4829,17 @@ class ProductCore extends ObjectModel
*/
public function getDefaultCategory()
{
return Db::getInstance()->getValue('
$default_category = Db::getInstance()->getValue('
SELECT product_shop.`id_category_default`
FROM `'._DB_PREFIX_.'product` p
'.Shop::addSqlAssociation('product', 'p').'
WHERE p.`id_product` = '.(int)$this->id);
if (!$default_category)
return array('id_category_default' => Context::getContext()->shop->id_category);
else
return $default_category;
}
public static function getShopsByProduct($id_product)