[-] FO : fixed mixed cache in different shops #PSCFV-3174

This commit is contained in:
dMetzger
2012-08-27 16:48:39 +00:00
parent 538c793cfe
commit 094e6bb24a
3 changed files with 23 additions and 9 deletions
+11
View File
@@ -1233,6 +1233,17 @@ class CategoryCore extends ObjectModel
return false;
return ($this->nleft >= $interval['nleft'] && $this->nright <= $interval['nright']);
}
public static function inShopStatic($id_category, Shop $shop = null)
{
if (!$shop || !is_object($shop))
$shop = Context::getContext()->shop;
if (!$interval = Category::getInterval($shop->getCategory()))
return false;
$row = Db::getInstance(_PS_USE_SQL_SLAVE_)->getRow('SELECT nleft, nright FROM `'._DB_PREFIX_.'category` WHERE id_category = '.(int)$id_category);
return ($row['nleft'] >= $interval['nleft'] && $row['nright'] <= $interval['nright']);
}
public function getChildrenWs()
{