Don't like ads? PRO users don't see any ads ;-)
Guest

Untitled

By: a guest on May 15th, 2012  |  syntax: None  |  size: 2.29 KB  |  hits: 25  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. <div id="categories">
  2. <div class="col_full">
  3.  
  4.  
  5. <div class="listing" >
  6. <?php $_maincategorylisting=$this->getCurrentCategory()?>                        
  7. <?php $_categories=$this->getCurrentChildCategories()?>
  8.  
  9. <?php if($_categories->count()):?>
  10.            <? foreach ($_categories as $_category):?>
  11.  
  12.                         <? if($_category->getIsActive()):
  13.  
  14.                         $cur_category=Mage::getModel('catalog/category')->load($_category->getId());
  15.            $layer = Mage::getSingleton('catalog/layer');
  16.            $layer->setCurrentCategory($cur_category);
  17.  
  18.                         $catName = $this->getCurrentCategory()->getName();  
  19.  
  20.                         if($_imageUrl=!$this->getCurrentCategory()->getImageUrl()):?>
  21.  
  22.                         <div class="category-box">
  23.                                 <div class="category-name">    
  24.                                         <a href="<?php echo $this->getCategoryUrl($_category)?>">
  25.                                                 <?php echo $catName ?></a>
  26.                                 </div>
  27.                                 <div class="category-image-box">
  28.                                         <a href="<?php echo $this->getCategoryUrl($_category)?>"><img src="/skin/frontend/themename/default/images/category_image_default.gif"></a>
  29.                                 </div>
  30.                         </div> 
  31.  
  32.                         <?endif?>
  33.  
  34.                         <? if($_imageUrl=$this->getCurrentCategory()->getImageUrl()):?>
  35.  
  36.          <div class="category-box">
  37.                                 <div class="category-name">    
  38.                                   <a href="<?php echo $this->getCategoryUrl($_category)?>"> <?php echo $_category->getName()?></a>
  39.                                 </div>
  40.                                 <div class="category-image-box">
  41.                                          <a href="<?php echo $this->getCategoryUrl($_category)?>"><img src="<?php echo $_imageUrl?>" height="174"></a>
  42.                                 </div>
  43.                                 <div class="category-description">
  44.                                         <?php echo $_category->getDescription(); ?>
  45.                                 </div>
  46.                                 <div class="category-goto">
  47.                                         <a href="<?php echo $this->getCategoryUrl($_category)?>"><img src="/skin/frontend/themename/default/images/category_image_default.gif"></a>
  48.                                 </div>
  49.                         </div>
  50.  
  51.  
  52.  
  53. <?                                              
  54.                         endif;
  55.                         endif;?>
  56.             <?endforeach?>
  57.  
  58.             <?php /* This resets the category back to the original pages category
  59. ****     If this is not done, subsequent calls on the same page will use the last category
  60. ****    in the foreach loop
  61. */   ?>
  62. <?php $layer->setCurrentCategory($_maincategorylisting);  ?>
  63.     <?endif;?>
  64.  
  65.  
  66. </div>
  67. <br clear=all>
  68. </div>
  69. </div>