Помогите разобраться! В чем моя ошибка?
В /catalog/view/theme/default/template/common/header.tpl
поменяла
<?php foreach ($children as $child) { ?>
<li><a href="<?php echo $child['href']; ?>"><?php echo $child['name']; ?></a></li>
<?php } ?>
на
<?php foreach ($children as $child) { ?>
<?php if ($child ['subchildren']) { ?>
<li class="dropright"><a href="<?php echo $child['href']; ?>"><?php echo $child['name']; ?></a>
<div class="dropright-menu">
<div class="dropright-inner">
<ul class="list-unstyled">
<?php foreach ($subchildren as $subchild) { ?>
<li><a href="<?php echo $subchild['href']; ?>"><?php echo $subchild['name']; ?></a></li>
<?php } ?>
</ul>
</div>
</div>
</li>
<?php } else { ?>
<li><a href="<?php echo $child['href']; ?>"><?php echo $child['name']; ?></a></li>
<?php } ?>
<?php } ?>
и в /catalog/controller/common/header.php подправила так
// Level 2
$children_data = array();
$children = $this->model_catalog_category->getCategories($category['category_id']);
foreach ($children as $child) {
$filter_data = array(
'filter_category_id' => $child['category_id'],
'filter_sub_category' => true
);
//level 3
$subchildren_data = array();
$subchildren = $this->model_catalog_category->getCategories($child['category_id']);
foreach ($subchildren as $subchild) {
$filter_data = array(
'filter_category_id' => $subchild['category_id'],
'filter_sub_category' => true
);
$subchildren_data[] = array(
'name' => $subchild['name'] . ($this->config->get('config_product_count') ? ' <span class="menu_summ">' . $this->model_catalog_product->getTotalProducts($filter_data) . '</span>' : ''),
'href' => $this->url->link('product/category', 'path=' . $category['category_id'] . '_' . $child['category_id']. '_' . $subchild['category_id']),
);
}
$children_data[] = array(
'name' => $child['name'] . ($this->config->get('config_product_count') ? ' (' . $this->model_catalog_product->getTotalProducts($filter_data) . ')' : ''),
'href' => $this->url->link('product/category', 'path=' . $category['category_id'] . '_' . $child['category_id']),
'subchildren' => $subchildren_data
);
}