我試圖動態地將製造商添加到下拉菜單中,我寫了一條foreach語句,但沒有任何內容顯示在首頁上。OpenCart Manufactures DropDown
任何人都可以檢查代碼,並擺脫一些光線,將不勝感激的幫助。
<?php if ($categories) { ?>
<div id="menu-holder" class="<?php echo (isset($styler['menu_style']) && ($styler['menu_style']!='')) ? $styler['menu_style']."_menu" : '' ;?>">
<div id="menu">
<ul>
<li><a href="<?php echo $home; ?>"><span class='home_icon'></span></a>
<?php foreach ($categories as $category) { ?>
<li><a href="<?php echo $category['href']; ?>"><?php echo $category['name']; ?><?php if ($category['children']) { ?><span></span><?php } ?></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<?php echo ($i==(count($category['children'])-1) ? " class='last_submenu_item'" : '');?> href="<?php echo $category['children'][$i]['href']; ?>"><span><?php echo $category['children'][$i]['name']; ?></span></a></li>
<?php } ?>
<?php } ?>
</ul>
<?php } ?>
</div>
<?php } ?>
</li>
<?php } ?>
</ul>
<ul>
<?php foreach ($manufacturers as $manufacturer) { ?>
<li><a href="<?php echo $manufacturer['href']; ?>"><?php echo $manufacturer['name']; ?></a></li>
<?php } ?>
</ul>
<ul>
<li><a href="#">Football Clubs</a></li>
</ul>
</div>
</div>
<?php } ?>
請給出你的輸出的例子HTML – vico
這是上面的代碼的輸出,應該有一個額外的鏈接箭頭指向:http://i59.tinypic.com/90ynmc.png –
讓我知道如果你們需要任何東西來幫助我這個:) –