Magento列出所有带缩略图的类别

时间:2013-09-05 18:07:55

标签: magento

我使用一个代码来显示所有类别和拇指,工作正常,但在列表中显示 有一种方法可以显示另一个吗?喜欢的页面中显示的产品

<ul> <?php $children =
Mage::getModel('catalog/category')->getCategories(2); // put your main
root category id here foreach ($children as $category):
$category=Mage::getModel('catalog/category')->load($category->getId());
echo '<li><a href="' . $category->getUrl() . '">' .
$category->getName() . '</a></li>'; ?> <img src="<?php echo
Mage::getBaseUrl('media')?>catalog/category/<?php echo
$category->getThumbnail() ?>" height="100" width='100'> <?php 
$children =
Mage::getModel('catalog/category')->getCategories($category->getId());
foreach ($children as $category):
$category=Mage::getModel('catalog/category')->load($category->getId());
echo '<li><a href="' . $category->getUrl() . '">' .
$category->getName() . '</a></li>'; ?> <img src="<?php echo
Mage::getBaseUrl('media')?>catalog/category/<?php echo
$category->getThumbnail() ?>" height="100" width='100'>

<?php  $children =
Mage::getModel('catalog/category')->getCategories($category->getId());
foreach ($children as $category):
$category=Mage::getModel('catalog/category')->load($category->getId());
echo '<li><a href="' . $category->getUrl() . '">' .
$category->getName() . '</a></li>'; ?> <img src="<?php echo
Mage::getBaseUrl('media')?>catalog/category/<?php echo
$category->getThumbnail() ?>" height="100" width='100'> <?php
endforeach; ?>

<?php endforeach; ?>


<?php endforeach; ?> </ul>

0 个答案:

没有答案