Created
August 16, 2013 15:38
-
-
Save pierreandreroy/6250967 to your computer and use it in GitHub Desktop.
Add image to product recently viewed block in Magento
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php if ($_products = $this->getRecentlyViewedProducts()): ?> | |
<div class="block block-list block-viewed"> | |
<div class="block-title"> | |
<strong><span><?php echo $this->__('Recently Viewed Products') ?></span></strong> | |
</div> | |
<div class="block-content"> | |
<ol id="recently-viewed-items"> | |
<?php foreach ($_products as $_item): ?> | |
<li class="item"> | |
<p><img class="product-image" src="<?php echo $this->helper('catalog/image')->init($_item, 'small_image')->resize(50, 50) ?>" width="50" height="50" alt="<?php echo $this->htmlEscape($_item->getName()) ?>" /> </p> | |
<p class="product-name"><a href="<?php echo $this->getProductUrl($_item) ?>"><?php echo $this->helper('catalog/output')->productAttribute($_item, $_item->getName() , 'name') ?></a></p> | |
</li> | |
<?php endforeach; ?> | |
</ol> | |
<script type="text/javascript">decorateList('recently-viewed-items');</script> | |
</div> | |
</div> | |
<?php endif; ?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment