Advertisement
Guest User

Untitled

a guest
Jan 18th, 2017
128
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.22 KB | None | 0 0
  1. <?php
  2. $category = Mage::getSingleton('catalog/layer')->getCurrentCategory();
  3. $categories = $category->getCollection()
  4. ->addAttributeToSelect(array('name', 'thumbnail'))
  5. ->addAttributeToFilter('is_active', 1)
  6. ->addIdFilter($category->getChildren())
  7. ?>
  8. <ul class="subcategories">
  9. <?php foreach ($categories as $category): ?>
  10. <li>
  11. <a href="<?php echo $category->getUrl() ?>"><img src="<?php echo Mage::getBaseUrl('media') . 'catalog' . DS . 'category' . DS . $category->getThumbnail() ?>" alt="<?php echo $this->htmlEscape($category->getName()) ?>" />
  12. <span><?php echo $category->getName() ?></span></a>
  13. </li>
  14. <?php endforeach; ?>
  15. </ul>
  16.  
  17. <?php if($category->getThumbnail()): ?>
  18. <img id="slide-img-1" src="<?php echo $this->helper('catalog/image')->init($category, 'thumbnail')->resize(135, 135); ?>" /></a>
  19. <?php endif; ?>
  20.  
  21. <?php if($category->getThumbnail()){ ?>
  22. <img id="slide-img-1" src="<?php echo $this->helper('catalog/image')->init($category, 'thumbnail')->resize(135, 135); ?>" /></a>
  23. <?php else: ?>
  24. <img id="slide-img-1" src="placeholderUri" /></a>
  25. <?php endif; ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement