News:

Support the VirtueMart project and become a member

Main Menu

Image in email order confirmation

Started by vis18neu, October 28, 2012, 11:52:41 AM

Previous topic - Next topic

vis18neu

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?

olayemi

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
                 }
              }
               
            ?>