VirtueMart Forum

VirtueMart 1.1.x [ Old version - no longer supported ] => Administration & Configuration VM 1.1 => Topic started by: ullischust on October 03, 2011, 23:00:03 pm

Title: Product thumbnail next to each item in the final order confirmation e-mail
Post by: ullischust on October 03, 2011, 23:00:03 pm
Hello,

Anyone has an idea for the following issue: I would like to display item thumbnails next to each product in the final order confirmation email (the mail that is sent to both client and admin once the client checks out his/her order).
Thanks a million in advance, as I have been trying for a long time...
I am using version 1.1.3 stable (working perfectly well)

U.S.
Title: Re: Product thumbnail next to each item in the final order confirmation e-mail
Post by: Akaruikage on October 05, 2011, 20:19:25 pm
I couldn't find an answer, either, so I decided to experiment a bit and came up with the following code to make it work. Bear in mind I am using 1.1.7, but this ought to work on 1.1.3, as well.

The file you want to edit is:

websitename.com/components/com_virtuemart/themes/[virtuemart theme]/templates/order_emails/confirmation_email.tpl.php

("websitename.com" is, obviously, the name of your website. [virtuemart theme] is the current theme you have setup for VIRTUEMART, which you configure in the administrator backend of the website).

First, scroll down to about line 159 where you see a bunch of table cells. Right under where you see:
<th><?php echo $VM_LANG->_('PHPSHOP_CART_QUANTITY') ?></th>

Make a new line that is simply:
<th> </th>
This will be an empty cell as a placeholder so everything is still in order once we insert our pictures.

After this, go to about line 182 (more or less). Here you will see:
<td><?php echo $my_qty ?></td>

Make a new line under this and insert the following code:
<td><img src="websitename.com/components/com_virtuemart/shop_image/product/<?php echo $dboi->p("product_thumb_image") ?>" alt="noimage" border="0" /></td>

Insert the edited file back into your website and test it out. Let me know how it works for you! Once again, I am on 1.1.7, so the code might be a little different.
Title: Re: Product thumbnail next to each item in the final order confirmation e-mail
Post by: ullischust on October 10, 2011, 20:51:20 pm
Hello Akaruikage,

Thank you very much for the code. It seems to be very close to working, because I get the confirmation e-mail with a little square and a red cross in it instead of the picture, like when you try to browse an image but you did not write the correct extension (when a jpg is missing or so). Do you happen to know the solution?
Have a great day!
Title: Re: Product thumbnail next to each item in the final order confirmation e-mail
Post by: Akaruikage on October 12, 2011, 05:29:44 am
Hmm... There are only two reasons why I can think it might be doing that.

1) You didn't change "websitename.com" to your website name (In the code, where you see "img src= . . . )

2) The "Product_thumb_image" in the code refers to an SQL entry in the virtuemart database. In 1.1.7, that directs to a specific product's thumbnail image. Maybe you have no thumbnail images? Or, if you do, then perhaps the sql entry is different in 1.1.3.

That's all I can think of. Sorry I can't be of more help.
Title: Re: Product thumbnail next to each item in the final order confirmation e-mail
Post by: ullischust on October 12, 2011, 17:08:03 pm
Hi Akaruikage,

It is working now!! In the "websitename.com" I had not put the "http://www" in front, now that I have, it is working perfectly well. I appreciate very much your help, as this will save us hours of work!
Have an outstanding day!!