Posting in the Magento forums has been disabled pending the implementation of a new and improved forum solution which should better serve the community.

For new questions please post at magento.stackexchange.com, the community-run support site for the Magento community. We will be providing updates on the new forum solution soon. For questions or concerns please email community@magento.com.

Magento Forum

Page 1 of 2
How to add product image in Admin>Sales>Order>View
 
cckean31
Jr. Member
 
Total Posts:  11
Joined:  2008-09-07
 

Hi,

I wanted to add the relevant product images in the Admin>Sales>Order>View..this is easy for the florist (it is for an online florist) to refer to the product images to arrange the ordered product ...which object or functions that i suppose to call from there?

CK

 
Magento Community Magento Community
Magento Community
Magento Community
 
ebjewelry
Jr. Member
 
Total Posts:  1
Joined:  2009-09-11
 

Were you ever able to complete this?  I am interested in adding the same thing.  Any help/tips would be appreciated.  Even if you found out that you could never do it.

Thanks.

 
Magento Community Magento Community
Magento Community
Magento Community
 
tahiragwan
Jr. Member
 
Avatar
Total Posts:  10
Joined:  2009-06-16
 

Anyone has solution for this. please tell.

 
Magento Community Magento Community
Magento Community
Magento Community
 
Nils123
Jr. Member
 
Total Posts:  3
Joined:  2009-12-21
 

I am on same boat. pls provide some help.

Thanks

 
Magento Community Magento Community
Magento Community
Magento Community
 
Spyder DSN
Jr. Member
 
Total Posts:  11
Joined:  2008-10-17
Newcastle upon Tyne, United Kingdom
 

Simply add this code to:

app\design\adminhtml\default\core\template\sales\order\view\items\renderer\default.phtml

just before

<?php echo $this->getColumnHtml($_item'name'?>

//#################################################### Display Thumbnail ####################################################
    
    
    $imageCollection Mage::getModel('catalog/product')->load($_item['product_id']);
    
     if (
count($imageCollection->getMediaGalleryImages()) > 0{ ?><ul style="float:left; margin-right:10px">   
     
<?php
     $i
=0;
           foreach (
$imageCollection->getMediaGalleryImages() as $_image)
            
{
             
             
// Change 0 to any higher number if you like to display more images
             
if($i == 0{
             
             $imageId
=$_item['product_id'"_" $i++;?>
             
<li>
    <
a href="#" onclick="Popup=window.open('<?php echo $this->helper('catalog/image')->init($imageCollection, 'image', $_image->getFile())->resize(600); ?>','Popup','toolbar=no,location=no,status=no,menubar=no,scrollbars=yes,resizable=no, width=620,height=700,left=430,top=23'); return false;">
    <
img src="<?php echo $this->helper('catalog/image')->init($imageCollection, 'thumbnail', $_image->getFile())->resize(100); ?>" alt="<?php echo $this->htmlEscape($_image->getLabel()) ?>" title="<?php echo $this->htmlEscape($_image->getLabel()) ?>" />
</
a>         </li>


    
<?php } $i++;
             
}      
             ?>
</ul<?php
        }
      
    
//#################################################### Display Thumbnail Finish ####################################################

Enjoy wink

 
Magento Community Magento Community
Magento Community
Magento Community
 
mafareed
Jr. Member
 
Total Posts:  11
Joined:  2010-04-28
 

This solution didn’t work for me. Didn’t give any errors, the page only loaded up to the Information link in the left menu. Rest was blank. Any ideas??? Thanks

 
Magento Community Magento Community
Magento Community
Magento Community
 
mafareed
Jr. Member
 
Total Posts:  11
Joined:  2010-04-28
 

Hey I figured why it didn’t work in ur code the opening <?php and ending ?> are missing. I didn’t notice that earlier. My Bad. Neat Script friend. Thanks a lot.

 
Magento Community Magento Community
Magento Community
Magento Community
 
MagePsycho
Moderator
 
Avatar
Total Posts:  1702
Joined:  2009-06-23
 

If you would like to use base image only (not the gallery images) then i suggest you to use the following code:

<img id="image" src="<?php echo Mage::helper('catalog/image')->init($productObject, 'image'); ?>" alt="" title="" />

Thanks

 
Magento Community Magento Community
Magento Community
Magento Community
 
Sam C
Jr. Member
 
Total Posts:  12
Joined:  2010-08-23
 

Hello, everyone, I want to click product name to link to product page, how to change the code?

sorry for my English.

 
Magento Community Magento Community
Magento Community
Magento Community
 
monkeybrains
Jr. Member
 
Total Posts:  6
Joined:  2011-01-15
 

Can anyone please help me with this for Magento ver. 1.4.2.0

I can’t get it to work even if I put the opening and closing php in

I would greatly appreciate any help with this.

 
Magento Community Magento Community
Magento Community
Magento Community
 
tani
Jr. Member
 
Total Posts:  2
Joined:  2011-09-08
 

Can anyone help me caouse i am new on magento and want to uploads image product.
But i cant ia have tried one week and no soluition?
Please help me

Image Attachments
Untitled.jpg
 
Magento Community Magento Community
Magento Community
Magento Community
 
Spyder DSN
Jr. Member
 
Total Posts:  11
Joined:  2008-10-17
Newcastle upon Tyne, United Kingdom
 

New code compatible with 1.6.x add this code to:

app\\design\\adminhtml\\default\\default\\template\\sales\\order\\view\\items\\renderer\\default.phtml

<?php echo $this->getColumnHtml($_item\'name\'?>
<?php //######## Display Thumbnail
        
$imageCollection Mage::getModel(\'catalog/product\')->load($_item[\'product_id\']);
        
$i=0;
        foreach (
$imageCollection->getMediaGalleryImages() as $_image{
        
if($i == 0{
        ?>
        
        
<a href=\"#\" onclick=\"Popup=window.open(\'<?php echo $this->helper(\'catalog/image\')->init($imageCollection, \'image\', $_image->getFile())->resize(600); ?>\',\'Popup\',\'toolbar=no,location=no,status=no,menubar=no,scrollbars=yes,resizable=no, width=620,height=700,left=430,top=23\'); return false;\" style=\"float:left; margin-right:10px\">
        
        <
img src=\"<?php echo $this->helper(\'catalog/image\')->init($imageCollection, \'thumbnail\', $_image->getFile())->resize(100); ?>\" 
        
alt=\"<?php echo $this->htmlEscape($_image->getLabel()) ?>\" 
        
title=\"<?php echo $this->htmlEscape($_image->getLabel()) ?>\" />
        </
a>
<?php } $i++; }  //######## Display Thumbnail End 
?>
 
Magento Community Magento Community
Magento Community
Magento Community
 
ljames28
Jr. Member
 
Total Posts:  3
Joined:  2012-01-23
 

A small tweak to make it work with configurable items.

Replace

$imageCollection = Mage::getModel(’catalog/product’)->load($_item[’product_id’]);

With

$imageCollection = Mage::getModel(’catalog/product’);
$imageCollection->load($imageCollection->getIdBySku($_item[’sku’]));

 
Magento Community Magento Community
Magento Community
Magento Community
 
Beermonster
Member
 
Total Posts:  68
Joined:  2010-09-03
 

I’ve tried to get this working on 1.6.2 and nothing happens, has anyone got it working? if so how?

 
Magento Community Magento Community
Magento Community
Magento Community
 
Beermonster
Member
 
Total Posts:  68
Joined:  2010-09-03
 

I don’t like bumping threads but I’m still wanting to know how to get this to work, I can add the link where I want it but I don’t know how to get it to work correctly, all I want to know is what do I put in place of the ## in this

<a href="##">Image</a>

 
Magento Community Magento Community
Magento Community
Magento Community
 
Ravi_B
Jr. Member
 
Avatar
Total Posts:  10
Joined:  2012-04-01
 

Awesome post…

thanks alot.. works perfectly.

 
Magento Community Magento Community
Magento Community
Magento Community
Magento Community
Magento Community
Back to top
Page 1 of 2