Jump to content

  • You cannot start a new topic
  • You cannot reply to this topic

Image Thumbnails in order details page Rate Topic   - - - - -

 
  • umera
  • Junior Member
  • Members
  • Join Date: 26-Feb 08
  • 28 posts

Posted 23 October 2011 - 11:32 PM #1

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
<th>{$lang.product}</th>
on line 184

I added
<th>{$lang.Image}</th>
on line 185


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

{if !$oi.deleted_product}<a href="{"products.update?product_id=`$oi.product_id`"|fn_url}">{/if}{$oi.product|unescape}{if !$oi.deleted_product}</a>{/if}
			{hook name="orders:product_info"}
			{if $oi.product_code}<p>{$lang.sku}:&nbsp;{$oi.product_code}</p>{/if}
			{/hook}



I added the following:

<td class="product-image-table">
	{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}
</td>



The result I get is as shown in picture below:

As you can see I cant seem to get the images to show up.

Any Advice would be highly appreciated.

I am sure it's probably something very trivial in the code.

Please help...I am now Lost :(

Attached Files



 
  • brandonvd
  • is Super Awesome
  • Members
  • Join Date: 19-Dec 06
  • 2631 posts

Posted 24 October 2011 - 12:24 AM #2

I totally feel you on the whole free option, but Seonid has a pretty sweet looking addon for this at http://www.cs-cart.s...uct-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

 

Posted 24 October 2011 - 02:10 AM #3

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

 
  • umera
  • Junior Member
  • Members
  • Join Date: 26-Feb 08
  • 28 posts

Posted 24 October 2011 - 04:21 PM #4

I totally feel you on the whole free option, but Seonid has a pretty sweet looking addon for this at http://www.cs-cart.s...uct-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



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.

 
  • umera
  • Junior Member
  • Members
  • Join Date: 26-Feb 08
  • 28 posts

Posted 24 October 2011 - 06:59 PM #5

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/customer/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/admin/common_templates/

Note: make sure you have renamed it as you do not want to overwrite the existing original images.tpl in the folder

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

skins/basic/admin/views/orders/

At around line 184 or 185 you will see
<th>{$lang.product}</th>

before that line insert this
<th>{$lang.image}</th>

so it will look like this :
<th>{$lang.image}</th>
		<th>{$lang.product}</th>

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}
	<tr {cycle values="class=\"table-row\", " name="class_cycle"}>

And just after that, insert the following code:
<td>
    {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}
   </td>


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

Attached Files



 
  • pvein
  • Member
  • Members
  • Join Date: 27-Apr 09
  • 97 posts

Posted 14 November 2011 - 01:12 PM #6

thanks!

works with 2.09 - 2.2

 
  • infogirl
  • Member
  • Members
  • Join Date: 16-Mar 12
  • 16 posts

Posted 15 August 2012 - 05:25 AM #7

Does this work with v2.2.5?

Thanks.

UPDATE: Got it working with v2.2.5!

Thank you for sharing the code.