我的页脚中显示了一个子类别列表。目前该列表分为 2 列,但我希望它分为 3 列。
这是我目前正在使用的代码;
<li class='shop_online'>
<?php
#########################################
$temparray = array();
$_helper = Mage::helper('catalog/category');
$_categories = $_helper->getStoreCategories();
$currentCategory = Mage::registry('current_category');
if (count($_categories) > 0):
foreach($_categories as $_category):
$temparray[] = "<a href='".$_helper->getCategoryUrl($_category)."'>".$_category->getName()."</a>";
/*
$_category = Mage::getModel('catalog/category')->load($_category->getId());
$_subcategories = $_category->getChildrenCategories();
if (count($_subcategories) > 0):
foreach($_subcategories as $_subcategory):
$temparray[] = "<a href='".$_helper->getCategoryUrl($_subcategory)."'>".$_subcategory->getName()."</a>";
$_subsubcategory = Mage::getModel('catalog/category')->load($_subcategory->getId());
$_subsubcategories = $_subsubcategory->getChildrenCategories();
if (count($_subsubcategories) > 0):
foreach($_subsubcategories as $_subsubcategory):
$temparray[] = "<a href='".$_helper->getCategoryUrl($_subsubcategory)."'>".$_subsubcategory->getName()."</a>";
endforeach;
endif;
endforeach;
endif;
*/
endforeach;
endif;
echo "<ul class='footer_links_list'>";
if(count($temparray) > 0)
{
echo '<h3><a href="'.Mage::getBaseUrl().'shop-online'.'">SHOP ONLINE</a></h3>';
for( $i=0; $i<count($temparray); $i++ )
{
if(($i+1)%1==0 || ($i+1)%1==0)
echo "<li>".$temparray[$i]."</li>";
}
}
echo "</ul>";
#########################################
?>
</li>
我不知道如何将其分解为第三列以显示在页脚中。
formagdev1.com 是我正在开发的开发站点。
有任何想法吗?
谢谢,比尔