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?


All times are GMT -8. The time now is 02:56 PM.

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