php OpenCart:向主菜单添加类别?
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/11388857/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
OpenCart: Add categories to main menu?
提问by MeltingDog
I've just installed OpenCart for the first time, deleted all the dummy products and categories it comes with and added my own. However, now nothing appears in my menu - no product categories. I can't seem to fine where to add items to menus.
我第一次安装 OpenCart,删除了它附带的所有虚拟产品和类别,并添加了我自己的。但是,现在我的菜单中没有任何内容 - 没有产品类别。我似乎不知道将项目添加到菜单的位置。
Can anyone point me in the right direction? Thanks
任何人都可以指出我正确的方向吗?谢谢
UPDATE:
更新:
THis is the php in my header tpl file:
这是我的头文件 tpl 中的 php:
?php if ($categories) { ?>
<div id="menu">
<ul>
<?php foreach ($categories as $category) { ?>
<li><a href="<?php echo $category['href']; ?>"><?php echo $category['name']; ?></a>
<?php if ($category['children']) { ?>
<div>
<?php for ($i = 0; $i < count($category['children']);) { ?>
<ul>
<?php $j = $i + ceil(count($category['children']) / $category['column']); ?>
<?php for (; $i < $j; $i++) { ?>
<?php if (isset($category['children'][$i])) { ?>
<li><a href="<?php echo $category['children'][$i]['href']; ?>"><?php echo $category['children'][$i]['name']; ?></a></li>
<?php } ?>
<?php } ?>
</ul>
<?php } ?>
</div>
<?php } ?>
</li>
<?php } ?>
</ul>
</div>
I have not acutally changed any of it from the original
我没有真正改变它的任何原始
采纳答案by Sathishkumar
Create a new parent category and sub categories in Catalog->Category->insertthen add the new product Catalog->product->insert. Product should be appear in frond end. for more details see this video tutorials : http://www.opencart.com/index.php?route=documentation/screencast
在Catalog->Category->insert 中创建一个新的父类和子类,然后添加新产品Catalog->product->insert。产品应该出现在前端。有关更多详细信息,请参阅此视频教程:http: //www.opencart.com/index.php?route =documentation/ screencast

