单列下拉而不是两列下拉

时间:2017-12-04 15:36:22

标签: opencart multiple-columns

您好我正在努力使这两列只下拉一列。我无法确定如何修改代码来执行此操作。这是打开购物车的自定义。

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;
    }

1 个答案:

答案 0 :(得分:0)

列是向左浮动的(float:left;),它们使CSS看起来彼此相邻。

如果删除&#34; float:left;&#34;在第75行的custommenu.css中,它将根据您的需要显示。

enter image description here