X-Cart: shopping cart software

X-Cart forums (https://forum.x-cart.com/index.php)
-   Dev Questions (https://forum.x-cart.com/forumdisplay.php?f=20)
-   -   Add thumbnail image on email invoice. (https://forum.x-cart.com/showthread.php?t=52319)

shipmerchant 02-12-2010 04:59 PM

Add thumbnail image on email invoice.
 
1 Attachment(s)
I paid some Xcart points some time ago on this and thought I would share it with some. It will add a product thumbnail image on the email invoice. Makes packing orders easier anyway.

You could also implement it on the great custom template found in http://forum.x-cart.com/showthread.php?t=42748&highlight=email+invoice

Or in your default Xcart Order_Data.tpl

Enjoy!

Code:



************* Code for custom --  skin1/mail/html/order_data.tpl Version 4.3.1*************

You could also implement it on the great custom template found in http://forum.x-cart.com/showthread.php?t=42748&highlight=email+invoice


Line 12 ~ 17

<tr>
<th width="60" bgcolor="#cccccc">{$lng.lbl_sku}</th>
{*image on invoice*}
<th bgColor="#cccccc">{$lng.lbl_product}</th>
<th bgColor="#cccccc">{$lng.lbl_image}</th>
{if $order.extra.tax_info.display_cart_products_tax_rates eq "Y" and $_userinfo.tax_exempt ne "Y"}
<td align="center">
{*end*}
<th nowrap="nowrap" width="100" bgcolor="#cccccc">{if $order.extra.tax_info.product_tax_name ne ""}{$order.extra.tax_info.product_tax_name}{else}{$lng.lbl_tax}{/if}</th>
{/if}


***Line 42 to 45***

<a href="{$catalogs.customer}/download.php?id={$product.download_key}" class="SmallNote" target="_blank">{$lng.lbl_download}</a>
{/if}
</td>
{* added line 42 ~ 45 to add product image on email invoice width adjustment*}
<TD align="center">
<img src="{$http_location}/image.php?id={$product.productid}" width="75">
</TD>
{*end*}
{if $order.extra.tax_info.display_cart_products_tax_rates eq "Y" and $_userinfo.tax_exempt ne "Y"}
<td align="center">



************* Code for Original -- Xcart Default skin1/mail/htmlorder_data.tpl Version 4.3.1*************

Line 12 ~ 17

<tr>
<th width="60" bgcolor="#cccccc">{$lng.lbl_sku}</th>
{*image on invoice*}
{*<th bgcolor="#cccccc">{$lng.lbl_product}</th>*}
<th bgColor="#cccccc">{$lng.lbl_product}</th>
<th bgColor="#cccccc">{$lng.lbl_image}</th>
{*if $order.extra.tax_info.display_cart_products_tax_rates eq "Y" and $_userinfo.tax_exempt ne "Y"*}
<td align="center">
</td>
{if $order.extra.tax_info.display_cart_products_tax_rates eq "Y"}
<td align="center">
{*end*}


Line 47 to 50


<a href="{$catalogs.customer}/download.php?id={$product.download_key}" class="SmallNote" target="_blank">{$lng.lbl_download}</a>
{/if}
</td>
{* added l 48 ~ 51 to add product image on email invoice width can be controlled also*}
<TD align="center">
<img src="{$http_location}/image.php?id={$product.productid}" width="75">
</TD>
{if $order.extra.tax_info.display_cart_products_tax_rates eq "Y" and $_userinfo.tax_exempt ne "Y"}
<td align="center">


Here is a screen shot as well. Enjoy!

Pyro 02-12-2010 05:21 PM

Re: Add thumbnail image on email invoice.
 
Thanks for sharing! I'm not sure if I will use it, but i'm sure others will.



One question, do you print the image on the invoice that you give to customers or is this simply for you when you pack the boxes?

shipmerchant 02-12-2010 07:22 PM

Re: Add thumbnail image on email invoice.
 
Quote:

Originally Posted by Pyro
One question, do you print the image on the invoice that you give to customers or is this simply for you when you pack the boxes?


Pyro,

this is on the invoice which is emailed to the customer upon the checkout process and yes in out case its the shipping invoice as well. Keeps everyone on the same page.

SusanMoore 02-13-2010 08:29 PM

Re: Add thumbnail image on email invoice.
 
Thanks so much!

If this works in my 4.0.19 cart, I'll be overjoyed!

jonduv 03-11-2010 09:09 AM

Re: Add thumbnail image on email invoice.
 
Everything works great except when I go to print it out, the full size image prints. Is there any way to adjust this?

Thank you for your time,

Jon

shipmerchant 03-11-2010 09:23 AM

Re: Add thumbnail image on email invoice.
 
Quote:

Originally Posted by jonduv
Everything works great except when I go to print it out, the full size image prints. Is there any way to adjust this?

Thank you for your time,

Jon


Code:


<img src="{$http_location}/image.php?id={$product.productid}" width="75">


try changing the width="75" parameter

jonduv 03-11-2010 09:32 AM

Re: Add thumbnail image on email invoice.
 
Thank you for the quick response. Would adding a style to this tag force it to print the smaller size? Possibly something like this?

<img src="{$http_location}/image.php?id={$product.productid}" width="80" style="width:80px; height:90px; padding-top:5px;">

Thanks

shipmerchant 03-11-2010 09:36 AM

Re: Add thumbnail image on email invoice.
 
Quote:

Originally Posted by jonduv
Thank you for the quick response. Would adding a style to this tag force it to print the smaller size? Possibly something like this?

<img src="{$http_location}/image.php?id={$product.productid}" width="80" style="width:80px; height:90px; padding-top:5px;">

Thanks



Have not tried this since the posted code work on 2 carts 4.18 and 4.3.1. Why not try it out and post back your findings? Look forward to your reply

Freakmode 03-19-2010 06:38 AM

Re: Add thumbnail image on email invoice.
 
Any ideas why my emails just have a box with a red dot in the order?

anandat 03-19-2010 09:37 AM

Re: Add thumbnail image on email invoice.
 
Very nice mod.
It's possible to display thumbnails invoice for admin side only ?

My goal is to see which ordered products has got images & which doesn't have.


All times are GMT -8. The time now is 02:59 AM.

Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.