Follow us on Twitter X-Cart on Facebook Wiki
Shopping cart software Solutions for online shops and malls
 

Add a product thumbnail to tell-a-friend email & invoice

 
Reply
   X-Cart forums > X-Cart 4 > Dev Questions
 
Thread Tools Search this Thread
  #1  
Old 01-08-2005, 04:23 AM
 
Jerrad Jerrad is offline
 

X-Adept
  
Join Date: Nov 2004
Location: The Netherlands
Posts: 484
 

Default 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!
__________________
X-Cart 4.0.12
Heavy modified with paid, free and forum mods.
PHP 5.2.5 | MYSQL 5.0.51a
Reply With Quote

The following user thanks Jerrad for this useful post:
jargirl (06-21-2012)
  #2  
Old 01-08-2005, 06:52 AM
 
balinor balinor is offline
 

Veteran
  
Join Date: Oct 2003
Location: Connecticut, USA
Posts: 30,253
 

Default

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!
__________________
Padraic Ryan
Ryan Design Studio
Professional E-Commerce Development
Reply With Quote
  #3  
Old 01-08-2005, 07:34 AM
 
Jerrad Jerrad is offline
 

X-Adept
  
Join Date: Nov 2004
Location: The Netherlands
Posts: 484
 

Default

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

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!
__________________
X-Cart 4.0.12
Heavy modified with paid, free and forum mods.
PHP 5.2.5 | MYSQL 5.0.51a
Reply With Quote
  #4  
Old 01-08-2005, 08:44 AM
  adpboss's Avatar 
adpboss adpboss is offline
 

X-Man
  
Join Date: Feb 2003
Location: Ontario, Canada
Posts: 2,389
 

Default

Great MOD!
Reply With Quote
  #5  
Old 01-08-2005, 09:09 AM
 
Jerrad Jerrad is offline
 

X-Adept
  
Join Date: Nov 2004
Location: The Netherlands
Posts: 484
 

Default

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...
__________________
X-Cart 4.0.12
Heavy modified with paid, free and forum mods.
PHP 5.2.5 | MYSQL 5.0.51a
Reply With Quote
  #6  
Old 01-08-2005, 09:11 AM
  adpboss's Avatar 
adpboss adpboss is offline
 

X-Man
  
Join Date: Feb 2003
Location: Ontario, Canada
Posts: 2,389
 

Default

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!

Reply With Quote
  #7  
Old 01-08-2005, 09:19 AM
 
Jerrad Jerrad is offline
 

X-Adept
  
Join Date: Nov 2004
Location: The Netherlands
Posts: 484
 

Default

Great! Shall I contact you in 2007 or just wait till you pm me?
__________________
X-Cart 4.0.12
Heavy modified with paid, free and forum mods.
PHP 5.2.5 | MYSQL 5.0.51a
Reply With Quote
  #8  
Old 01-08-2005, 09:28 AM
  adpboss's Avatar 
adpboss adpboss is offline
 

X-Man
  
Join Date: Feb 2003
Location: Ontario, Canada
Posts: 2,389
 

Default

LOL. I'll post. Just don't switch cart software befoe 2k7 ok?
Reply With Quote
  #9  
Old 01-13-2005, 07:10 AM
  shan's Avatar 
shan shan is offline
 

X-Guru
  
Join Date: Sep 2002
Location: Birmingham, UK
Posts: 6,163
 

Default

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
__________________
Looking for a reliable X-cart host ?
You wont go wrong with either of these.

EWD Hosting
Hands On Hosting
Reply With Quote
  #10  
Old 01-13-2005, 09:05 AM
 
Jerrad Jerrad is offline
 

X-Adept
  
Join Date: Nov 2004
Location: The Netherlands
Posts: 484
 

Default

Thanks for the reply, shan!
I just took a look between the admin php files 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...

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?
__________________
X-Cart 4.0.12
Heavy modified with paid, free and forum mods.
PHP 5.2.5 | MYSQL 5.0.51a
Reply With Quote
Reply
   X-Cart forums > X-Cart 4 > Dev Questions



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump


All times are GMT -8. The time now is 06:08 PM.

   

 
X-Cart forums © 2001-2020