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.

shipmerchant 03-19-2010 05:03 PM

Re: Add thumbnail image on email invoice.
 
Quote:

Originally Posted by 01bodyjewellery
Any ideas why my emails just have a box with a red dot in the order?

Not sure, does the product you selected have a thumb associated with it?
The thumb should show provided there is one there.

shipmerchant 03-19-2010 05:06 PM

Re: Add thumbnail image on email invoice.
 
Quote:

Originally Posted by 01bodyjewellery
Any ideas why my emails just have a box with a red dot in the order?

Not sure, does this particulat item have a thumb associated with it? The image should show up.

isaels@i-artsupplies.co.u 06-16-2010 11:22 PM

Re: Add thumbnail image on email invoice.
 
I have 4.3.1 and have tried both codes and dont seem to be able to get either to work. I take it I am supposed to repeace the code below into the relevant lines?

Quote:

************* 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_ra tes 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_ra tes 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_ra tes eq "Y" and $_userinfo.tax_exempt ne "Y"*}
<td align="center">
</td>
{if $order.extra.tax_info.display_cart_products_tax_ra tes 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_ra tes eq "Y" and $_userinfo.tax_exempt ne "Y"}
<td align="center">



This is my original code before making changes, and I have put quote boxes around the code I have replaced. Is this riight? I guess not as it no works!

Quote:

{*
$Id: order_data.tpl,v 1.51 2009/11/02 15:02:25 igoryan Exp $
vim: set ts=2 sw=2 sts=2 et:
*}
<p {if $is_nomail eq 'Y'}class="invoice-products-title"{else}style="font-size: 14px; font-weight: bold; text-align: center"{/if}>{$lng.lbl_products_ordered}</p>
<table {if $is_nomail eq 'Y'}cellspacing="1" class="invoice-products"{else}cellspacing="0" cellpadding="3" width="100%" border="1"{/if} summary="{$lng.lbl_products|escape}">
<tr>
<th {if $is_nomail eq 'Y'}class="invoice-sku-column"{else}width="60" bgcolor="#cccccc"{/if}>{$lng.lbl_sku}</th>
<th{if $is_nomail ne 'Y'} bgcolor="#cccccc"{/if}>{$lng.lbl_product}</th>
{if $order.extra.tax_info.display_cart_products_tax_ra tes eq "Y" and $_userinfo.tax_exempt ne "Y"}
<th {if $is_nomail eq 'Y'}class="invoice-tax-column"{else}nowrap="nowrap" width="100" bgcolor="#cccccc"{/if}>

MY LINE 12 STARTS HERE
{if $order.extra.tax_info.product_tax_name ne ""}
{$order.extra.tax_info.product_tax_name}
{else}
{$lng.lbl_tax}
{/if}
</th>
{/if}
<th {if $is_nomail eq 'Y'}class="invoice-price-column"{else}nowrap="nowrap" width="100" bgcolor="#cccccc" align="center"{/if}>{$lng.lbl_item_price}</th>
<th {if $is_nomail eq 'Y'}class="invoice-quantity-column"{else}width="60" bgcolor="#cccccc"{/if}>{$lng.lbl_quantity}</th>
<th {if $is_nomail eq 'Y'}class="invoice-total-column"{else}width="60" bgcolor="#cccccc"{/if}>{$lng.lbl_total}</th>
</tr>
{foreach from=$products item=product}
<tr>
<td {if $is_nomail eq 'Y'}class="invoice-price-column"{else}align="center"{/if}>{$product.productcode}</td>
<td{if $is_nomail eq 'Y'} class="invoice-product-column"{/if}>
<span{if $is_nomail ne 'Y'} style="font-size: 11px;"{/if}>{$product.descr}</span>


{*BCSE Begin - Preorder Mod*}
{if $active_modules.BCSE_Preorder_Backorder}
{include file="modules/BCSE_Preorder_Backorder/order_data_product.tpl" product=$product}
{/if}
{*BCSE End*}

{if $product.product_type eq "C" and $product.display_price lt 0}
<span{if $is_nomail eq 'Y'} class="pconf-negative-price"{else} style="color:#b51800"{/if}> {$lng.lbl_pconf_discounted}</span>
{/if}
{if $active_modules.Gift_Registry}
{include file="modules/Gift_Registry/product_event_invoice.tpl"}
{/if}
{if $product.product_options ne '' && $active_modules.Product_Options}
<table summary="{$lng.lbl_product_options|escape}" cellpadding="0" cellspacing="0">
<tr>
<td{if $is_nomail ne 'Y'} valign="top"{/if}><strong>{$lng.lbl_options}:</strong></td>
<td>
{include file="modules/Product_Options/display_options.tpl" options=$product.product_options options_txt=$product.product_options_txt force_product_options_txt=$product.force_product_o ptions_txt}
</td>
</tr>
</table>
{/if}
{if $active_modules.Egoods and $product.download_key and ($order.status eq "P" or $order.status eq "C")}
<br />

MY LINE 47 STARTS HERE
<a href="{$catalogs.customer}/download.php?id={$product.download_key}" target="_blank">{$lng.lbl_download}</a>
{/if}
</td>
{if $order.extra.tax_info.display_cart_products_tax_ra tes eq "Y" and $_userinfo.tax_exempt ne "Y"}
<td {if $is_nomail eq 'Y'}class="invoice-tax-column"{else}align="center"{/if}>
{foreach from=$product.extra_data.taxes key=tax_name item=tax}
{if $tax.tax_value gt 0}
<div>
{if $order.extra.tax_info.product_tax_name eq ""}
{$tax.tax_display_name}
{/if}
{if $tax.rate_type eq "%"}
{$tax.rate_value}%
{else}
{include file="currency.tpl" value=$tax.rate_value}
{/if}
</div>
{/if}
{/foreach}
</td>
{/if}
<td {if $is_nomail eq 'Y'}class="invoice-price-column"{else}align="right" nowrap="nowrap"{/if}>{include file="currency.tpl" value=$product.display_price display_sign=$product.price_show_sign}&nbsp;&nbsp; </td>
<td {if $is_nomail eq 'Y'}class="invoice-quantity-column"{else}align="center"{/if}>{$product.amount}</td>
<td {if $is_nomail eq 'Y'}class="invoice-total-column"{else}align="right" nowrap="nowrap" style="padding-right: 5px;"{/if}>
{multi assign="total" x=$product.amount y=$product.display_price|default:$product.price|de fault:0}
{include file="currency.tpl" value=$total display_sign=$product.price_show_sign}
</td>
</tr>
{/foreach}
{if $giftcerts ne ''}
{foreach from=$giftcerts item=gc}
<tr>

THERE IS MORE CODE AFTER THIS BUT HAVE NOT PUT IT IN!

stevep 07-30-2010 08:47 PM

Re: Add thumbnail image on email invoice.
 
Nice one works a treat.

isaels@i-artsupplies.co.u 11-29-2010 06:59 AM

Re: Add thumbnail image on email invoice.
 
I think you should find it in skin1/mail/html/signature.tpl

Cheers

artistwantab 12-27-2010 11:47 AM

Re: Add thumbnail image on email invoice.
 
Does anyone know if this will work in 4.4.1?

artistwantab 12-31-2010 10:46 AM

Re: Add thumbnail image on email invoice.
 
Ok I got it to work in 4.4.1

Quote:

<tr>
<th{if $is_nomail ne 'Y'} bgcolor="#cccccc"{/if}>{$lng.lbl_product}</th>
<th{if $is_nomail ne 'Y'} bgColor="#cccccc">{$lng.lbl_image}</th>
{if $order.extra.tax_info.display_cart_products_tax_ra tes eq "Y" and $_userinfo.tax_exempt ne "Y"}
<td align="center">
<th {if $is_nomail eq 'Y'}class="invoice-tax-column"{else}nowrap="nowrap" width="100" bgcolor="#cccccc"{/if}>
{if $order.extra.tax_info.product_tax_name ne ""}
{$order.extra.tax_info.product_tax_name}
{else}
{$lng.lbl_tax}
{/if}
</th>
{/if}
{/if}

Quote:

<a href="{$catalogs.customer}/download.php?id={$product.download_key}" target="_blank">{$lng.lbl_download}</a>
{/if}
</td>
<TD align="center">
<img src="{$http_location}/image.php?id={$product.productid}" width="75">
</TD>

customcolor 03-26-2011 05:38 PM

Re: Add thumbnail image on email invoice.
 
Quote:

Originally Posted by artistwantab
Ok I got it to work in 4.4.1

where would i put that code?? you gave no lines or pages to put it in...i could really use this for my site!!

isaels@i-artsupplies.co.u 04-15-2011 01:36 PM

Re: Add thumbnail image on email invoice.
 
Has anyone got this to work in 4.3 branch?

minfinger 06-01-2011 05:52 PM

Re: Add thumbnail image on email invoice.
 
My questions is how to get it in 4.3.2 and 4.4.x


All times are GMT -8. The time now is 06:03 AM.

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