Fix selected category in left column
This commit is contained in:
parent
c50659be85
commit
ce8ac77721
@ -284,16 +284,22 @@ class PurchaseGuide extends Module
|
||||
$id_category = $postModel->id_guide_category;
|
||||
}
|
||||
|
||||
// Get selected categories
|
||||
$model = new GuideCategory($id_category);
|
||||
if ($model->id_parent === 0) {
|
||||
$id_main_category = $id_category;
|
||||
$id_child_category = 0;
|
||||
} else {
|
||||
$mainCategory = $model->getCategoryLang($model->id_parent, $cookie->id_lang);
|
||||
$id_main_category = $mainCategory['id_guide_category'];
|
||||
$id_child_category = $id_category;
|
||||
}
|
||||
if($id_category == 0) {
|
||||
$model = new GuideCategory();
|
||||
$id_main_category = $id_child_category = 0;
|
||||
}
|
||||
else {
|
||||
// Get selected categories
|
||||
$model = new GuideCategory($id_category);
|
||||
if ($model->id_parent == 0) {
|
||||
$id_main_category = $id_category;
|
||||
$id_child_category = 0;
|
||||
} else {
|
||||
$mainCategory = $model->getCategoryLang($model->id_parent, $cookie->id_lang);
|
||||
$id_main_category = $mainCategory['id_guide_category'];
|
||||
$id_child_category = $id_category;
|
||||
}
|
||||
}
|
||||
$tree = $model->getTree($cookie->id_lang, $isEmployee);
|
||||
|
||||
$smarty->assign(array(
|
||||
|
Loading…
Reference in New Issue
Block a user