Skip to content

Instantly share code, notes, and snippets.

@trev trev/filter.phtml

Created Apr 13, 2012
Embed
What would you like to do?
Magento Color Attribute Swatches Implementation
<ol>
<?php foreach ($this->getItems() as $_item): ?>
<li>
<?php if ($_item->getCount() > 0): ?>
// Add attribute option image before label
<?php if($_item->getName() == "Color") : ?>
<img src="<?php echo Mage::helper('attributeoptionimage')->getAttributeOptionImage($_item->getValue()); ?>" alt="" />
<?php endif; ?>
<a href="<?php echo $this->urlEscape($_item->getUrl()) ?>"><?php echo $_item->getLabel() ?></a>
<?php else: echo $_item->getLabel() ?>
<?php endif; ?>
(<?php echo $_item->getCount() ?>)
</li>
<?php endforeach ?>
</ol>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.