VirtueMart Forum

VirtueMart 2 + 3 + 4 => Templating & Layouts => Topic started by: vis18neu on October 28, 2012, 11:52:41 AM

Title: Image in email order confirmation
Post by: vis18neu on October 28, 2012, 11:52:41 AM
In stores with many products, I find it easier to process the order if I have image thumbnails in email order confirmation. I used this option in VM 1.1.9 and it was really helpful, but cannot figure out how to add this thumbnail in VM 2. Has anyone managed to do this?
Title: Re: Image in email order confirmation
Post by: olayemi on August 25, 2013, 14:54:10 PM
For Virtuemart 2.0.10

I got this fix after long searching and no solution so i came up with my own but crude anyway.
You can do this by  going inside     components/com_virtuemart/views/invoice/tmpl/invoice_items.php
around line 74  create a new <td> tag  </td> and add this code.

<?php
             if (!empty($item->product_quantity)) {
            
                 $db = JFactory::getDBO();
                 $qs = "SELECT file_url_thumb FROM #__virtuemart_medias WHERE virtuemart_media_id = (SELECT virtuemart_media_id FROM #__virtuemart_product_medias WHERE virtuemart_product_id =".$item->virtuemart_product_id.")"; //print_r($qs);
      $db->setQuery($qs);
      $item2 = $db->loadAssocList();
             foreach($item2 as $file_thumb){
                //echo $file_thumb['file_url_thumb'];
                 ?>
                 <img src="<?php  echo JURI::root () . $file_thumb['file_url_thumb'] ?>" />
                 <?php
                 }
              }
               
            ?>