Hello,
I’m having trouble with my prestashop code. I want to disable a link in my menu for one of my item from category 5. I don’t see where the proble, is…
Here is the code : [php]
private function getCategory($id_category, $id_lang)
{
global $page_name;
$categorie = new Category($id_category, $id_lang);
if(is_null($categorie->id))
return;
$selected = ($page_name == 'category' && ((int)Tools::getValue('id_category') == $id_category)) ? ' class="sfHoverForce"' : '';
$this->_menu .= '<li'.$selected.'>';
if(count(explode('.', $categorie->name)) > 1)
$name = str_replace('.', '', strstr($categorie->name, '.'));
elseif($categorie->id==5)
$name = $categorie->name;
$this->_menu .= '<a href="#">'.$name.'</a>';
$childrens = Category::getChildren($id_category, $id_lang);
if(count($childrens))
{
$this->_menu .= '<ul>';
foreach($childrens as $children)
$this->getCategory($children['id_category'], $id_lang);
$this->_menu .= '</ul>';
$this->_menu .= '</li>';
}
else
$name = $categorie->name;
$this->_menu .= '<a href="'.$categorie->getLink().'">'.$name.'</a>';
$childrens = Category::getChildren($id_category, $id_lang);
if(count($childrens))
{
$this->_menu .= '<ul>';
foreach($childrens as $children)
$this->getCategory($children['id_category'], $id_lang);
$this->_menu .= '</ul>';
}
$this->_menu .= '</li>';
}
[/php]
Any advice ?
Thank you very much,
Tiwelle