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 a product thumbnail to tell-a-friend email & invoice (https://forum.x-cart.com/showthread.php?t=11342)

Jerrad 01-08-2005 04:23 AM

Add a product thumbnail to tell-a-friend email & invoice
 
I thought it would be nice if tell-a-friend email's, besides a description and link, also a thumbnail of the product showed.
Therefore I put the following code into skin1/mail/html/send2friend.tpl :

Code:

{include file="product_thumbnail.tpl" productid=$product.productid image_x=$product.image_x image_y=$product.image_y product=$product.product tmbn_url=$product.tmbn_url id="product_thumbnail"}


Which results in:
http://home.zonnet.nl/jumpers/tellafriend.jpg

I did the same with skin1/mail/html/order_data.tpl which results in:
http://home.zonnet.nl/jumpers/invoice.jpg
Now customers can see a thumbnail of the product they ordered in the invoice which shows up in checkout and orderstatus.

Only problem is the order comfirmation email. Somehow the thumbnail(s) of the ordered product(s) won't show up. It just shows the "no image available" thumbnail. Same goes for the wishlist email, btw.
http://home.zonnet.nl/jumpers/invoice_email.jpg
Furthermore, I would like to reduce the size of the thumbnails. Not for the whole shop, but only for the thumbs when they used for the above.

I hope that somebody else finds a way that the order comfirmation email also shows a thumb of the product.
Any advise how to reduce the thumbnails is also welcome.

Thanks!

balinor 01-08-2005 06:52 AM

Nice work Jerrad. I can't help you with the images in the e-mail (it is hard enough getting the images in the store to function correctly!) but I think I can help you with the resizing issue. Try replacing this:

Code:

image_x=$product.image_x image_y=$product.image_y

with this:

Code:

image_x=100

Where 100 is whatever number you want the x dimension to be. You could also get rid of the x variable and set the dimension for y as well. This worked fine for me in products.tpl, I don't see why it shouldn't work in the e-mail templates. Just a thought!

Jerrad 01-08-2005 07:34 AM

Thanks for the compliment and for your help, balinor!
Resizing the thumbnails the way you described works great! :D

I've changed the 100 into 50 so that the thumbs still show the products
good enough but don't blow up the whole email and invoice layout.

http://home.zonnet.nl/jumpers/invoice_2.jpg

I really hope that somebody know or can figure out why the thumbs won't show up in the order confirmation email.

Thanks again!

adpboss 01-08-2005 08:44 AM

Great MOD!

Jerrad 01-08-2005 09:09 AM

Thanks alot, adpboss!

But it would be a really great mod if we could do the same with
the order confirmation & wishlist emails. Don't you think so?

Maybe you can look into it... :wink:

adpboss 01-08-2005 09:11 AM

No problemo!

Order confirmation = ADP task # 9784
Wishlist email = ADP task # 9785

I should be able to get to these in 2007. Bookmark this thread! ;)

:D

Jerrad 01-08-2005 09:19 AM

Great! Shall I contact you in 2007 or just wait till you pm me? :wink:

adpboss 01-08-2005 09:28 AM

LOL. I'll post. Just don't switch cart software befoe 2k7 ok?

shan 01-13-2005 07:10 AM

you would need to refer to the php file that displys the image if using code outside of xcart

have a look at how its done in the generate html links option when you search products in admin

Jerrad 01-13-2005 09:05 AM

Thanks for the reply, shan!
I just took a look between the admin php files 8O but could you
please be so kind to point me to the file that generates the html links?

Furthermore; the product thumbnail in the tell-a-friend emails
does show up, so the used code for generating thumbs does work
outside x-cart.
It's only not working for the comfirmation and wishlist emails.

EDIT:
In skin1/admin/main I found product_links.tpl which contains
the code that produces the html thumbnail link
Code:

{include file="product_thumbnail.tpl" productid=$product.productid image_x=$product.image_x image_y=$product.image_y product=$product.product full_url="y"}

But it makes no difference when I use this code instead of the code
mentioned in my first post... :cry:

Therefore I took a look at the source code of the emails and noticed
the following:
Working tell-a-friend email -
Code:

<td width="160" align="center"><font face="Verdana" size="2">[img]cid:t_132.jpg[/img]</font>

Not working comfirmation email -
Code:

<TD align="center" width="110">[img]cid:image.php[/img]</font>

The first one finds the right thumbnail and the second email has
a empty IMG id, only has a image.php and therefore shows the
not-available-image (?)
But strange enough it does show the right product name...

Any thoughts/ideas about this, shan or anybody else?

andreas04031 02-17-2005 02:53 PM

Hi, did you ever figured this out? I have the same issue with 4.0.11 - Invoce looks just fine, send to friend and order email - no image, thanks, Andy

Jerrad 02-19-2005 02:50 AM

Hi andreas.
I've had no luck solving this. But the way I did it the tell-a-friend
email works properly - complete with product thumbnail.
The emails without images are the order email and wishlist email.

A few days ago walteis posted a topic with something simular, with
the difference that he managed to have a wishlist email which 'only'
misses the first image. The rest of the products al have images!
You can find it here:
http://forum.x-cart.com/viewtopic.php?t=16841

No idea what causes this and it's a pity that nobody else seems to
know it either.

walteis 02-19-2005 02:47 PM

Ok, got it to work, but it's really, really ugly.

In mail/html/sendall2friend.tpl add this code:
Code:

<!--
{ if $smarty.section.num.first}
{include file="product_thumbnail.tpl" productid="xxxxxx" image_x=$wl_products[0].image_x image_y=$wl_products[0].image_y product=$wl_products[0].product full_url="Y" id="product_thumbnail"}
{/if }
-->


where xxxxxx is a product that we no longer sell but is still in the database. In reality, xxxxxx just has to be a product ID that is NOT in the products array coming into the wishlist. I chose an old product to ensure that it would never be in that array.

I don't like this kludge one bit, but working is better than not working, eh?

Walt

Jerrad 02-20-2005 03:00 AM

Hi walteis,
Didn't the code in my first post work for you?

Code:

{include file="product_thumbnail.tpl" productid=$product.productid image_x=$product.image_x image_y=$product.image_y product=$product.product tmbn_url=$product.tmbn_url id="product_thumbnail"}

With this code the tell-a-friend email shows a product thumbnail.

walteis 02-20-2005 06:03 AM

That's the code I used from the start - but if you recall the first one would never display. The little kludge I gave above will solve that problem.

Walt

Jerrad 02-20-2005 06:22 AM

But tell a friend emails can only include one product and wishlist
emails can have several products.

Please correct me if I'm wrong.

walteis 02-20-2005 06:44 AM

Ah, I see the problem - I listed the wrong template. It should be wishlist_sendall2friend.tpl.

Good catch.

Walt

Jerrad 02-20-2005 07:27 AM

Aha, now I understand the mix-up :lol:

But I'm not sure where to put the code in the email template and
what to use for the "xxxxxx" product id.
Is it possible you show your wishlist_sendall2friend.tpl?
And did you tried this yet with the order comfirmation email?

Thanks, walteis :D :D

walteis 02-20-2005 08:28 AM

Ok, here's my wishlist_sendall2friend.tpl:

Code:

{* $Id: wishlist_sendall2friend.tpl,v 1.3.2.1 2004/10/21 07:51:07 max Exp $ *}
{config_load file="$skin_config"}


<FONT size="2">
{$lng.eml_mail_header_part1}
{$config.Company.company_name}
{$lng.eml_mail_header_part2_wishlist}
</FONT>



{$lng.lbl_hello}

{section name=num loop=$wl_products}
{if $smarty.section.num.first}


{$userinfo.firstname} {$userinfo.lastname}
{if $smarty.section.num.total eq 1}
{$lng.eml_has_recommended}:
{else}
{$lng.lbl_gift_registry_msg}:
{/if}



{/if}
<HR noshade size="1">
<!--
{ if $smarty.section.num.first}
{include file="product_thumbnail.tpl" productid="16193" image_x=$wl_products[0].image_x image_y=$wl_products[0].image_y product=$wl_products[0].product full_url="Y" id="product_thumbnail"}
{/if }
-->
<FONT color="#AA0000">{$wl_products[num].product}</FONT>
<TABLE border="0" cellpadding="0" cellspacing="0"><TR><TD>
{$wl_products[num].fulldescr|truncate:250:"..."}</TD></TR></TABLE>


{include file="product_thumbnail.tpl" productid=$wl_products[num].productid image_x=$wl_products[num].image_x image_y=$wl_products[num].image_y product=$wl_products[num].product full_url="Y" id="product_thumbnail"}



{$lng.lbl_price}: <FONT color="#00AA00">{include file="currency.tpl" value=$wl_products[num].taxed_price|default:$wl_products[num].price}</FONT>

{/section}

<HR noshade size="1">

{$lng.eml_please_click_link}:


{$catalogs.customer}/cart.php?mode=friend_wl&wlid={$wlid}

{include file="mail/html/signature.tpl"}


We just created a dummy product (16193) to use.

HTH,

Walt

Jerrad 02-20-2005 09:17 AM

Thanks alot walteis, got the wishlist email working now! :D :D

Any idea if it will work this way with the order comfirmation email?

andreas04031 02-21-2005 05:53 AM

well, thanks for the effort. I'll give it a shot when I have a little spare time, right now I'm in work up to the elbows...thanks guys, Andy

Jerrad 02-22-2005 09:41 AM

Hi walteis,
I've tried to implement your code into the comfirmation email, but
without any succes of course... :lol:
Any idea of your code could work like it did for the wishlist emails,
or is the logic totally different?

Any advise is more then welcome!

walteis 02-25-2005 08:58 AM

Jerrad,

Really don't know about the confirmation emails. We re-did ours but didn't try to put images in them.

Sorry,

Walt

WPOO 08-28-2005 12:44 PM

I don't see a image any idea's
 
Does anyone know why i do not see a image? I'm using the standaard send2friend in x-cart 4.0.14.


Thanks

artist122 09-21-2005 12:22 AM

CUstomer E-mail receipt
 
Has anyone gotten the thumbnail to show up in the Customer notification E-mail yet???

Jerrad 09-21-2005 12:28 AM

Unfortunately, still trying without any succes...

MythNReality 11-25-2005 04:43 PM

Re: CUstomer E-mail receipt
 
Quote:

Originally Posted by artist122
Has anyone gotten the thumbnail to show up in the Customer notification E-mail yet???

tried, but didn't work...anyone?

Jerrad 11-26-2005 01:14 AM

Unfortunately I haven't solved this.
I "managed" to get thumbnails with "no image available" displayed in the
customer notification email, but that's it...

I still hope that anyone else can fix this and get the product thumbs working in the notification email.

MythNReality 11-26-2005 08:48 PM

It was nice to give it a try tho...thank you anyways~

markwhoo 11-28-2005 10:23 AM

Wouldn't this depend on whether the image was in the databas or in the file system?

I would imagine with the security of xcart right now, that the images in the databas would not show easily, however if they wer ein the file system, they might just do as described.

Has anyone looked into this?

Jerrad 11-28-2005 10:36 AM

All my images are already in the file system.
Displaying product thumbails for the "tell a friend"-emails works great, it simply won't work with the confirmation emails...

Any ideas or suggestions?

markwhoo 11-28-2005 10:38 AM

no sorry,

I would have thought that the same code inserts would do the trick.

I just thought the image location may be causing the issues.

tangodancer 12-07-2005 04:52 PM

Jerrad,

I tried your code in 4.0.14 and the picture shows a placeholder but not the actual image. Is there a difference with version 4.0.14? Also, how do I get it to pull the picture externally from a server on the internet rather then embedding it in the message, so spam engines etc don't assume its spam or junk mail. Any ideas?

Thanks!

ecommerce 07-31-2006 05:30 PM

did anybody get this to work on the order confirmation email?

thumbnails in the order confirmation email

Brow 12-16-2006 10:25 AM

Re: Add a product thumbnail to tell-a-friend email & invoice
 
Guys, how can I get this to work with product options as well?

It works great with the product, but I also need it to show the product option as well.

Any ideas?

shipmerchant 06-15-2007 06:09 PM

Re: Add a product thumbnail to tell-a-friend email & invoice
 
Here is the code I used to add the product image to the email invoice, this actually adds an image colum too.

First of two entries:

Code:

<TH bgColor="#cccccc">{$lng.lbl_product}</TH>
{* line 15  below added to display product image column on email invoice*}
<TH bgColor="#cccccc">{$lng.lbl_image}</TH>



Then on the same file
find:

Code:

{* include file="product_thumbnail.tpl" productid=$product.productid image_x=$config.Appearance.thumbnail_width product=$product.product tmbn_url=$product.tmbn_url *}
<TD align="center">
<img src="{$http_location}/image.php?productid={$product.productid}" width="75"> </TD>



On v4.1.7 its L45 to 47 you could vary the width as well just change the "75" value above.

Enjoy!

divinechic 03-06-2008 12:29 PM

Re: Add a product thumbnail to tell-a-friend email & invoice
 
I tried this mod in 4.1.9 Gold and it didn't seem to work. Does anyone know how to get this to work for this version of x-cart?

Quote:

Originally Posted by Jerrad
I thought it would be nice if tell-a-friend email's, besides a description and link, also a thumbnail of the product showed.
Therefore I put the following code into skin1/mail/html/send2friend.tpl :

Code:

{include file="product_thumbnail.tpl" productid=$product.productid image_x=$product.image_x image_y=$product.image_y product=$product.product tmbn_url=$product.tmbn_url id="product_thumbnail"}


Which results in:
http://home.zonnet.nl/jumpers/tellafriend.jpg

I did the same with skin1/mail/html/order_data.tpl which results in:
http://home.zonnet.nl/jumpers/invoice.jpg
Now customers can see a thumbnail of the product they ordered in the invoice which shows up in checkout and orderstatus.

Only problem is the order comfirmation email. Somehow the thumbnail(s) of the ordered product(s) won't show up. It just shows the "no image available" thumbnail. Same goes for the wishlist email, btw.
http://home.zonnet.nl/jumpers/invoice_email.jpg
Furthermore, I would like to reduce the size of the thumbnails. Not for the whole shop, but only for the thumbs when they used for the above.

I hope that somebody else finds a way that the order comfirmation email also shows a thumb of the product.
Any advise how to reduce the thumbnails is also welcome.

Thanks!


kube 03-06-2008 01:39 PM

Re: Add a product thumbnail to tell-a-friend email & invoice
 
Quote:

Originally Posted by divinechic
I tried this mod in 4.1.9 Gold and it didn't seem to work. Does anyone know how to get this to work for this version of x-cart?


try it with product.variantid and type=W or a combo of one or the other...

Code:

{include file="product_thumbnail.tpl" productid=$product.variantid image_x=$product.image_x image_y=$product.image_y product=$product.product tmbn_url=$product.tmbn_url id="product_thumbnail" type="W"}

divinechic 03-06-2008 03:19 PM

Re: Add a product thumbnail to tell-a-friend email & invoice
 
I am a little confused as to what you mean. I copied the code as you put it an it didn't work. What do you mean by

"try it with product.variantid and type=W or a combo of one or the other..."

divinechic 03-06-2008 03:22 PM

Re: Add a product thumbnail to tell-a-friend email & invoice
 
Here is my sendtofriend code with the code you gave me, it isn't working, should I do something different?

Code:

{* $Id: send2friend.tpl,v 1.3.2.1 2006/11/29 09:31:11 max Exp $ *}
{config_load file="$skin_config"}
{include file="mail/mail_header.tpl"}
{assign var=max_truncate value=$config.Email.max_truncate}{math assign="max_space" equation="x+5" x=$max_truncate}{assign var="max_space" value="%-"|cat:$max_space|cat:"s"}
{$lng.eml_hello}
{$lng.eml_send2friend|substitute:"sender":$name}
{$product.product}
===========================================
{include file="product_thumbnail.tpl" productid=$product.variantid image_x=$product.image_x image_y=$product.image_y product=$product.product tmbn_url=$product.tmbn_url id="product_thumbnail" type="W"}
{$product.descr}
{$lng.lbl_price}: {include file="currency.tpl" value=$product.taxed_price}

{$lng.eml_click_to_view_product}:
 {$catalogs.customer}/product.php?productid={$product.productid}
{include file="mail/signature.tpl"}



All times are GMT -8. The time now is 11:46 PM.

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