Try the Demo

Magento Forum

   
No images in recently viewed items? 
 
joelene
Jr. Member
 
Total Posts:  6
Joined:  2008-12-01
 

I am unable to get images to show up in my recently viewed items list - is this correct? If not can someone tell me how I can:
a) get a nice link back to the viewed item?
b) find the template that creates the recently viewed items (I am editing reports/product_viewed.phtml but it doesn’t look like it contains all the information)

Thanks!

 
Magento Community Magento Community
Magento Community
Magento Community
 
joelene
Jr. Member
 
Total Posts:  6
Joined:  2008-12-01
 

Sorry to bump this but I am under quite a tight deadline and would really appreciate some advice with this

 
Magento Community Magento Community
Magento Community
Magento Community
 
5live
Jr. Member
 
Total Posts:  28
Joined:  2007-09-01
 

try this....

<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()) ?>" />

 
Magento Community Magento Community
Magento Community
Magento Community
 
FishPig
Sr. Member
 
Avatar
Total Posts:  225
Joined:  2009-06-05
 

I find that sometimes when a product is loaded it doesn’t have all of it’s information loaded with it. If you use the following code it should load everything you need.

$_item Mage::getModel('catalog/product')->($_item->getId());

 Signature 

Free Magento extensions: Magento WordPress Integration, Magento Shop By Brand and Magento Banners

 
Magento Community Magento Community
Magento Community
Magento Community
 
loeffel
Guru
 
Avatar
Total Posts:  412
Joined:  2009-02-03
 
5live - 28 December 2008 05:25 AM

try this....

<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()) ?>" />

Thank you!

 Signature 

Erotikshop

 
Magento Community Magento Community
Magento Community
Magento Community
 
Germán W
Jr. Member
 
Total Posts:  22
Joined:  2010-02-19
 

And if you want the icons and product name, as in the “My Cart” sidebar, the code should look like this:

<div class="block-content">
        <
ol id="recently-viewed-items" class="mini-products-list">
        
<?php foreach ($_products as $_item): ?>
            
<li class="item">
                <
a href="<?php echo $this->getProductUrl($_item) ?>" class="product-image"><img 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()) ?>" /> </a>
                <
div class="product-details"><class="product-name"><a href="<?php echo $this->getProductUrl($_item) ?>"><?php echo $this->htmlEscape($_item->getName()) ?></a></p></div>
            </
li>
        
<?php endforeach; ?>
        
</ol>
        <
script type="text/javascript">decorateList('recently-viewed-items');</script>
    
</div>

This should be edited in template/reports/product_viewed.phtml

 
Magento Community Magento Community
Magento Community
Magento Community
 
slight53
Jr. Member
 
Avatar
Total Posts:  15
Joined:  2009-09-13
Basel, Switzerland
 

Thanks Germán W. It works!

 Signature 

» Are you “Ready to Race”?

 
Magento Community Magento Community
Magento Community
Magento Community
 
Dx3webs
Sr. Member
 
Avatar
Total Posts:  177
Joined:  2008-12-16
 

+1 thanks

just what i needed

 Signature 

Dx3Webs - UK Managed Magento Solutions
FAST UK Magento Hosting - Full managed service, unlimited technical support. Ask for 2 week FREE trial.
Example Magento Client
Dx3webs Demo Store - Our Demo Magento Store

 
Magento Community Magento Community
Magento Community
Magento Community
 
panticz.de
Jr. Member
 
Total Posts:  18
Joined:  2009-01-16
Germany
 

Hi, here is a HowTo if you try to move recently viewed products to the middle / bottom of the page:
http://www.panticz.de/magento-customized-recently-viewed-products

 Signature 

http://code.google.com/p/magja/ - Java Connector for Magento API
http://www.panticz.de/magento/ - Magento HowTo

 
Magento Community Magento Community
Magento Community
Magento Community
 
medlington2
Member
 
Total Posts:  61
Joined:  2011-02-04
 

Hi,

Can any of you tell me how I would go about adding the price under the product image in the recently viewed products, I had a look through \\\’product/view.phtml\\\’ as I thought the code might be in there but I cant see anything relating to the price.

While Im on the subject, does anyone know how I can add an extra bit of information thats \\\’how much you save\\\’?

I can probably figure this bit out though if I can just get the price and special price to show as I can just read them both into variables and take one from the other, its just getting those 2 vars to show thats the main issue.

Thanks

 Signature 

Website design and development Sheffield, specialising in Magento - Portable Football Goals - Short Term Car Leasing - Yoga Sheffield - Womens Fashion In Chester

 
Magento Community Magento Community
Magento Community
Magento Community
 
immaterial thought
Jr. Member
 
Total Posts:  5
Joined:  2008-01-31
 

The code to include price is in related products

<li class="item">
                <
div class="product">
                    <
a href="<?php echo $_item->getProductUrl() ?>" title="<?php echo $this->htmlEscape($_item->getName()) ?>" class="product-image"><img src="<?php echo $this->helper('catalog/image')->init($_item, 'thumbnail')->resize(50) ?>" width="50" height="50" alt="<?php echo $this->htmlEscape($_item->getName()) ?>" /></a>
                    <
div class="product-details">
                        <
class="product-name"><a href="<?php echo $_item->getProductUrl() ?>"><?php echo $this->htmlEscape($_item->getName()) ?></a></p>
                        
<?php echo $this->getPriceHtml($_itemtrue?>
                    
</div>
                </
div>
            </
li>

We have images and price displaying on the recently viewed, but price does not display for grouped products if anyone has a fix for that problem I would like to hear about it.

Thanks

 
Magento Community Magento Community
Magento Community
Magento Community
 
medlington2
Member
 
Total Posts:  61
Joined:  2011-02-04
 

Thanks, that code worked perfectly,

I’d been trying to add it in the same way but it kept throwing an error about trying to use a function outside of an object

 Signature 

Website design and development Sheffield, specialising in Magento - Portable Football Goals - Short Term Car Leasing - Yoga Sheffield - Womens Fashion In Chester

 
Magento Community Magento Community
Magento Community
Magento Community
 
pauline
Jr. Member
 
Total Posts:  6
Joined:  2010-06-19
 
Germán W - 17 March 2010 10:32 PM

And if you want the icons and product name, as in the “My Cart” sidebar, the code should look like this:

<div class="block-content">
        <
ol id="recently-viewed-items" class="mini-products-list">
        
<?php foreach ($_products as $_item): ?>
            
<li class="item">
                <
a href="<?php echo $this->getProductUrl($_item) ?>" class="product-image"><img 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()) ?>" /> </a>
                <
div class="product-details"><class="product-name"><a href="<?php echo $this->getProductUrl($_item) ?>"><?php echo $this->htmlEscape($_item->getName()) ?></a></p></div>
            </
li>
        
<?php endforeach; ?>
        
</ol>
        <
script type="text/javascript">decorateList('recently-viewed-items');</script>
    
</div>

This should be edited in template/reports/product_viewed.phtml

Thanks so much, worked like a dream! Magento can be so difficult without help like this - really appreciate it.

 Signature 

Pauline Moon
Herts Premium Websites

 
Magento Community Magento Community
Magento Community
Magento Community
 
yvanacker
Jr. Member
 
Total Posts:  2
Joined:  2011-09-07
 
5live - 28 December 2008 05:25 AM

try this....

<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()) ?>" />

It works! Thanks

 
Magento Community Magento Community
Magento Community
Magento Community
 
Boatmagic
Sr. Member
 
Avatar
Total Posts:  91
Joined:  2010-08-14
 
pauline - 14 April 2011 03:44 AM

Germán W - 17 March 2010 10:32 PM
And if you want the icons and product name, as in the “My Cart” sidebar, the code should look like this:

<div class="block-content">
        <
ol id="recently-viewed-items" class="mini-products-list">
        
<?php foreach ($_products as $_item): ?>
            
<li class="item">
                <
a href="<?php echo $this->getProductUrl($_item) ?>" class="product-image"><img 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()) ?>" /> </a>
                <
div class="product-details"><class="product-name"><a href="<?php echo $this->getProductUrl($_item) ?>"><?php echo $this->htmlEscape($_item->getName()) ?></a></p></div>
            </
li>
        
<?php endforeach; ?>
        
</ol>
        <
script type="text/javascript">decorateList('recently-viewed-items');</script>
    
</div>

This should be edited in template/reports/product_viewed.phtml

Thanks so much, worked like a dream! Magento can be so difficult without help like this - really appreciate it.

I tired this code in 1.7.0.2 and it effectively removed the entire right sidebar?

 Signature 

NEXCESS.NET Web Hosting

 
Magento Community Magento Community
Magento Community
Magento Community
 
dbcndbcn
Jr. Member
 
Total Posts:  16
Joined:  2012-09-11
 
Boatmagic - 02 February 2013 02:41 PM

pauline - 14 April 2011 03:44 AM
Germán W - 17 March 2010 10:32 PM
And if you want the icons and product name, as in the “My Cart” sidebar, the code should look like this:

<div class="block-content">
        <
ol id="recently-viewed-items" class="mini-products-list">
        
<?php foreach ($_products as $_item): ?>
            
<li class="item">
                <
a href="<?php echo $this->getProductUrl($_item) ?>" class="product-image"><img 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()) ?>" /> </a>
                <
div class="product-details"><class="product-name"><a href="<?php echo $this->getProductUrl($_item) ?>"><?php echo $this->htmlEscape($_item->getName()) ?></a></p></div>
            </
li>
        
<?php endforeach; ?>
        
</ol>
        <
script type="text/javascript">decorateList('recently-viewed-items');</script>
    
</div>

This should be edited in template/reports/product_viewed.phtml

Thanks so much, worked like a dream! Magento can be so difficult without help like this - really appreciate it.

I tired this code in 1.7.0.2 and it effectively removed the entire right sidebar?

die komplette product-viewed.phtml für Magento 1.7. mit thumbnails //Datei auch im Anhang

?>
<?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">
                <
class="product-name"><a href="<?php echo $this->getProductUrl($_item) ?>"><?php echo $this->helper('catalog/output')->productAttribute($_item$_item->getName() , 'name'?></a>
                 <
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>
            </
li>
        
<?php endforeach; ?>
        
</ol>
        <
script type="text/javascript">decorateList('recently-viewed-items');</script>
    
</div>
</
div>
<?php endif; ?>

arbeitet perfekt siehe http://dorotheabecker-eco-designer.com/

File Attachments
product_viewed.phtml  (File Size: 2KB - Downloads: 13)
 
Magento Community Magento Community
Magento Community
Magento Community
Magento Community
Magento Community
    Back to top