您好我正在努力使这两列只下拉一列。我无法确定如何修改代码来执行此操作。这是打开购物车的自定义。
public function drawMenuItem($children, $level = 0, $columChunk = 0, $lang_id = 1,$setting) {
$lang_id = (int)$this->config->get('config_language_id');
$this->load->model('catalog/category');
$html = '<div class="itemMenu level' . $level . '">';
$countChildren = 0;
$ClassNoChildren = '';
foreach ($children as $child) {
$activeChildCat = $this->model_catalog_category->getCategories($child['category_id']);
$activeChildCat = $this->getCategoryByLevelMax($activeChildCat,$setting);
if ($activeChildCat) {
$countChildren++;
}
}
if ($countChildren == 0 && $columChunk == 1) {
$ClassNoChildren = ' nochild';
}
foreach ($children as $child) {
$info = $this->model_catalog_category->getCategory($child['category_id']);
$level = (int) $this->getCategoryLevelByCateId($child['category_id']);
$active = '';
//$currentCate = $this->getCurrentCategoriesId($lang_id);
$cate_id = (int) $child['category_id'];
// if (in_array($cate_id, $currentCate)) {
if ($this->haveCateChildren($cate_id, $lang_id)) {
$active = ' actParent';
} else {
$active = ' act';
}
//}
// --- format category name ---
$name = strip_tags($child['name']);
if (count($child) > 0) {
$parameters = null;
$link = $this->url->link('product/category', "path=".$child['category_id']);
$html.= '<a class="itemMenuName level' . $level . $active . $ClassNoChildren . '" href="' . $link . '"><span>' . $name .'</span></a>';
if($setting['hlevel'] > 2 && $level <= $setting['hlevel'] ) {
$activeChildren = $this->model_catalog_category->getCategories($child['category_id']);
$activeChildren = $this->getCategoryByLevelMax($activeChildren,$setting);
if (count($activeChildren) > 0) {
$html.= '<div class="itemSubMenu level' . $level . '">';
//$html.= $this->drawMenuItem($activeChildren, $level + 1);
$html.= $this->drawMenuItem($activeChildren, $level ,$columChunk, $lang_id,$setting);
$html.= '</div>';
}
}
}
}
$html.= '</div>';
return $html;
}