Image Thumbnails in order details page

Hi, Hoping someone has the technical know how to to do this and be kind enough to share. I am using V 2.2.2



I wish to add thumbnails to the Order Details Page.



I have succeeded so far in addding the following line to the admin/views/order/details.tpl



Just after the line that says ```php

{$lang.product} ``` on line 184

I added ```php {$lang.Image} ``` on line 185


Then around line 201 - 204 you will se this code. After this code that says:

```php {if !$oi.deleted_product}{/if}{$oi.product|unescape}{if !$oi.deleted_product}{/if}
{hook name="orders:product_info"}
{if $oi.product_code}

{$lang.sku}: {$oi.product_code}

{/if}
{/hook} ```



I added the following:

```php

{include file="common_templates/image.tpl" image=$product.main_pair.icon|default:$product.main_pair.detailed image_id=$product.main_pair.image_id image_width=50 object_type=$object_type href="products.update?product_id=`$oi.product_id`"|fn_url}


<br />
<br />
The result I get is as shown in picture below:<br />
<br />
As you can see I cant seem to get the images to show up.<br />
<br />
Any Advice would be highly appreciated.<br />
<br />
I am sure it's probably something very trivial in the code.<br />
<br />
Please help...I am now Lost   <img src="upload://2gefrk5yIQmBF7b3nb7uvIojpeG.gif" class="bbc_emoticon" alt=":("><p><a href="127.0.0.1/uploads/monthly_10_2011/post-10170-0-81750000-1319412449.jpg">Screenshot.jpg</a></p>

I totally feel you on the whole free option, but Seonid has a pretty sweet looking addon for this at http://www.cs-cart.seonid.com/cs-cart-addons/order-product-images.html It is like $35 but might save you a ton of work.



He also has a free one available at the bottom of that page.



Thanks,



Brandon

Thanks for the tip - I was looking for that as well.

[quote name=‘brandonvd’ timestamp=‘1319415862’ post=‘124408’]

I totally feel you on the whole free option, but Seonid has a pretty sweet looking addon for this at http://www.cs-cart.seonid.com/cs-cart-addons/order-product-images.html It is like $35 but might save you a ton of work.



He also has a free one available at the bottom of that page.



Thanks,



Brandon

[/quote]





Cheers for that Brandon, The free addon is great and I am using it now. but I still need the admin side images for the order details page and as you said, the Free Option… :rolleyes: … Man times are really hard and tight !!!



I will see if I can manipulate the free one and try and adapt it to the order details page. If it works, I will share with all.



Any help from the CS community in this would be Highly appreciated.

Finally…I managed to do it.



Ok here is a step by step for anyone interested.



Always make sure you have a copy of your original files before messing around with the code.



First copy the file images.tpl which is in the following location:



skins/basic/[color=“#FF0000”]customer[/color]/common_templates/images.tpl



Rename it to whatever you want… I called it orderdetails_image.tpl



Then Place this new copied file into the following location:



skins/basic/[color=“#FF0000”]admin[/color]/common_templates/



[color=“#FF0000”]Note: make sure you have renamed it as you do not want to overwrite the existing original images.tpl in the folder[/color]



Next open details.tpl which is in the following location:



skins/basic/admin/views/orders/



At around line 184 or 185 you will see {$lang.product}



before that line insert this {$lang.image}



so it will look like this : {$lang.image}
{$lang.product}




Next go to the code which is around line 200 or 201, that says {foreach from=$order_info.items item="oi" key="key"}
{hook name="orders:items_list_row"}
{if !$oi.extra.parent}




And just after that, insert the following code: ```php

{assign var=im_pair value=$oi.product_id|fn_get_image_pairs:'product':'M'}

{if $im_pair}{include file=“common_templates/orderdetails_image.tpl” images=$im_pair object_type=“product” image_width=50}{/if}

```


Save your file and you know have image thumbnails in the order details page.

You can change the image size to whatever suits you, I kept mine at 50


Tested in v 2.2.2

Screenshot-fixed.jpg

thanks!



works with 2.09 - 2.2

Does this work with v2.2.5?



Thanks.



UPDATE: Got it working with v2.2.5!



Thank you for sharing the code.