bustin Posted March 4, 2013 Share Posted March 4, 2013 Hi, I would like to ask how can I put the product image into the mail that is sent to the customer? (customer order). By default the only info are given to the customer are Reference, Product, Quantity, Unit Price I would like it to show the product image also (like in the shopping cart). thanks in advance! Regards, JD 1 Link to comment Share on other sites More sharing options...
bustin Posted March 10, 2013 Author Share Posted March 10, 2013 hi, is there nobody that could help me? Link to comment Share on other sites More sharing options...
kittysgifts Posted April 4, 2013 Share Posted April 4, 2013 I'm also searching for help to do this. Can anyone gives an help? Thanks in advance. Link to comment Share on other sites More sharing options...
Kerm Posted June 6, 2013 Share Posted June 6, 2013 +1 Link to comment Share on other sites More sharing options...
designerfort Posted July 24, 2013 Share Posted July 24, 2013 Hope it will help by inserting product variables in order_conf.html under mail folder\\ <img src="{$link->getImageLink($product.link_rewrite, $product.id_image, 'home_default')}" height="{$homeSize.height}" width="{$homeSize.width}" alt="{$product.name|escape:html:'UTF-8'}" /> Hope it will help by inserting product variables in order_conf.html under mail folder\\ <img src="{$link->getImageLink($product.link_rewrite, $product.id_image, 'home_default')}" height="{$homeSize.height}" width="{$homeSize.width}" alt="{$product.name|escape:html:'UTF-8'}" /> Link to comment Share on other sites More sharing options...
AT2 Posted August 2, 2013 Share Posted August 2, 2013 (edited) you can get the url of the cover image by this code: //GET IMAGE LINK $id_image = Product::getCover((int)$product['id_product']); if (sizeof($id_image) > 0) { $image = new Image($id_image['id_image']); $image_url = _PS_BASE_URL_._THEME_PROD_DIR_.$image->getExistingImgPath().".jpg"; } you have to paste it in classes/PaymentModule.php , before the creation of the "tr" of the product. then use $image_url where you want to show the image. i did it like this: //GET IMAGE LINK $id_image = Product::getCover((int)$product['id_product']); if (sizeof($id_image) > 0) { $image = new Image($id_image['id_image']); $image_url = _PS_BASE_URL_._THEME_PROD_DIR_.$image->getExistingImgPath().".jpg"; } if (!$customization_quantity || (int)$product['cart_quantity'] > $customization_quantity) $products_list .= '<tr style="background-color: '.($key % 2 ? '#DDE2E6' : '#EBECEE').';"> <td><img src="'.$image_url.'" width="100" height="100"/></td> <td style="padding: 0.6em 0.4em;width: 15%;">'.$product['reference'].'</td> <td style="padding: 0.6em 0.4em;width: 30%;"><strong>'.$product['name'].(isset($product['attributes']) ? ' - '.$product['attributes'] : '').'</strong></td> <td style="padding: 0.6em 0.4em; width: 20%;">'.Tools::displayPrice(Product::getTaxCalculationMethod() == PS_TAX_EXC ? Tools::ps_round($price, 2) : $price_wt, $this->context->currency, false).'</td> <td style="padding: 0.6em 0.4em; width: 15%;">'.((int)$product['cart_quantity'] - $customization_quantity).'</td> <td style="padding: 0.6em 0.4em; width: 20%;">'.Tools::displayPrice(((int)$product['cart_quantity'] - $customization_quantity) * (Product::getTaxCalculationMethod() == PS_TAX_EXC ? Tools::ps_round($price, 2) : $price_wt), $this->context->currency, false).'</td> </tr>'; PS VERSION: 1.5.3.1 Edited August 2, 2013 by AT2 (see edit history) Link to comment Share on other sites More sharing options...
designerfort Posted September 2, 2013 Share Posted September 2, 2013 AT2 your solution works, You are marvellous. I applied this technique in mail order to show images and it worked smoothly. Can u advise how can i show more components of prestashop i mean if i am to show whole featured products or viewed products in mail order then how to do it. Thanks a lot in advance Link to comment Share on other sites More sharing options...
bepped Posted September 20, 2013 Share Posted September 20, 2013 Hello, i think it's great. I also have a different request, how would it be for the email alert to the shop owner (MailAlert module)? It could be very useful to show the image in that email but i guess they are managed by different classes Link to comment Share on other sites More sharing options...
Kerm Posted September 20, 2013 Share Posted September 20, 2013 You need change file /modules/mailalerts/mailalerts.php Link to comment Share on other sites More sharing options...
bepped Posted September 20, 2013 Share Posted September 20, 2013 Great, done it and works the same way Link to comment Share on other sites More sharing options...
conidig Posted December 3, 2013 Share Posted December 3, 2013 hi, i need to past all this into paymentmodule.php ? //GET IMAGE LINK $id_image = Product::getCover((int)$product['id_product']); if (sizeof($id_image) > 0) { $image = new Image($id_image['id_image']); $image_url = _PS_BASE_URL_._THEME_PROD_DIR_.$image->getExistingImgPath().".jpg"; } if (!$customization_quantity || (int)$product['cart_quantity'] > $customization_quantity) $products_list .= '<tr style="background-color: '.($key % 2 ? '#DDE2E6' : '#EBECEE').';"> <td><img src="'.$image_url.'" width="100" height="100"/></td> <td style="padding: 0.6em 0.4em;width: 15%;">'.$product['reference'].'</td> <td style="padding: 0.6em 0.4em;width: 30%;"><strong>'.$product['name'].(isset($product['attributes']) ? ' - '.$product['attributes'] : '').'</strong></td> <td style="padding: 0.6em 0.4em; width: 20%;">'.Tools::displayPrice(Product::getTaxCalculationMethod() == PS_TAX_EXC ? Tools::ps_round($price, 2) : $price_wt, $this->context->currency, false).'</td> <td style="padding: 0.6em 0.4em; width: 15%;">'.((int)$product['cart_quantity'] - $customization_quantity).'</td> <td style="padding: 0.6em 0.4em; width: 20%;">'.Tools::displayPrice(((int)$product['cart_quantity'] - $customization_quantity) * (Product::getTaxCalculationMethod() == PS_TAX_EXC ? Tools::ps_round($price, 2) : $price_wt), $this->context->currency, false).'</td> </tr>'; Link to comment Share on other sites More sharing options...
theengineer Posted October 30, 2014 Share Posted October 30, 2014 you can get the url of the cover image by this code: //GET IMAGE LINK $id_image = Product::getCover((int)$product['id_product']); if (sizeof($id_image) > 0) { $image = new Image($id_image['id_image']); $image_url = _PS_BASE_URL_._THEME_PROD_DIR_.$image->getExistingImgPath().".jpg"; } you have to paste it in classes/PaymentModule.php , before the creation of the "tr" of the product. then use $image_url where you want to show the image. i did it like this: //GET IMAGE LINK $id_image = Product::getCover((int)$product['id_product']); if (sizeof($id_image) > 0) { $image = new Image($id_image['id_image']); $image_url = _PS_BASE_URL_._THEME_PROD_DIR_.$image->getExistingImgPath().".jpg"; } if (!$customization_quantity || (int)$product['cart_quantity'] > $customization_quantity) $products_list .= '<tr style="background-color: '.($key % 2 ? '#DDE2E6' : '#EBECEE').';"> <td><img src="'.$image_url.'" width="100" height="100"/></td> <td style="padding: 0.6em 0.4em;width: 15%;">'.$product['reference'].'</td> <td style="padding: 0.6em 0.4em;width: 30%;"><strong>'.$product['name'].(isset($product['attributes']) ? ' - '.$product['attributes'] : '').'</strong></td> <td style="padding: 0.6em 0.4em; width: 20%;">'.Tools::displayPrice(Product::getTaxCalculationMethod() == PS_TAX_EXC ? Tools::ps_round($price, 2) : $price_wt, $this->context->currency, false).'</td> <td style="padding: 0.6em 0.4em; width: 15%;">'.((int)$product['cart_quantity'] - $customization_quantity).'</td> <td style="padding: 0.6em 0.4em; width: 20%;">'.Tools::displayPrice(((int)$product['cart_quantity'] - $customization_quantity) * (Product::getTaxCalculationMethod() == PS_TAX_EXC ? Tools::ps_round($price, 2) : $price_wt), $this->context->currency, false).'</td> </tr>'; PS VERSION: 1.5.3.1 May i ask You need change file /modules/mailalerts/mailalerts.php May I ask you how to add a link with customer's order in mail alerts module? Thank you in advance Link to comment Share on other sites More sharing options...
wiseprt Posted July 2, 2015 Share Posted July 2, 2015 Hello, Anyone that make it working in the prestashop ver. 1.6? Link to comment Share on other sites More sharing options...
Kerm Posted July 3, 2015 Share Posted July 3, 2015 For prestashop 1.6 all the same. Link to comment Share on other sites More sharing options...
wiseprt Posted July 3, 2015 Share Posted July 3, 2015 Hello For prestashop 1.6 all the same. Are you sure? Cause i tried it and in the paymentModule.php file into classes directory there is no any <tr> inside at all. Can you re-check this please? Link to comment Share on other sites More sharing options...
Kerm Posted July 6, 2015 Share Posted July 6, 2015 (edited) Oh, did not see, i thought it was mail alert module. For costumer email you need edit mails/en/order_conf_product_list.tpl file for prestashop 1.6.0.14 > But also in file PaymentModule.php prestashop pass varibles to this tamplate on line 495: if (count($product_var_tpl_list) > 0) { $product_list_txt = $this->getEmailTemplateContent('order_conf_product_list.txt', Mail::TYPE_TEXT, $product_var_tpl_list); $product_list_html = $this->getEmailTemplateContent('order_conf_product_list.tpl', Mail::TYPE_HTML, $product_var_tpl_list); } So if you need pass new variable into template you need do this in file Payment Module.php same way like other standard variables. Edited July 6, 2015 by Kerm (see edit history) Link to comment Share on other sites More sharing options...
wiseprt Posted July 6, 2015 Share Posted July 6, 2015 Hello, I put this in the order_conf_product_list.tpl file <td><img src="'.$image_url.'" width="100" height="100"/></td> In the PaymentModule.php in /classes directory what code i have to add? This one? //GET IMAGE LINK $id_image = Product::getCover((int)$product['id_product']); if (sizeof($id_image) > 0) { $image = new Image($id_image['id_image']); $image_url = _PS_BASE_URL_._THEME_PROD_DIR_.$image->getExistingImgPath().".jpg"; } if so... where i have to put it? Cause i tried after the $product_var_tpl_list = array(); foreach ($order->product_list as $product) { but is not working Please help Link to comment Share on other sites More sharing options...
Kerm Posted July 6, 2015 Share Posted July 6, 2015 Why you do this without basic php knowledges?Inside PaymentModule.php near line 453, you can find this code inside foreach(): $product_var_tpl = array( 'reference' => $product['reference'], 'name' => $product['name'].(isset($product['attributes']) ? ' - '.$product['attributes'] : ''), 'unit_price' => Tools::displayPrice($product_price, $this->context->currency, false), 'price' => Tools::displayPrice($product_price * $product['quantity'], $this->context->currency, false), 'quantity' => $product['quantity'], 'customization' => array() ); You need put your code before this code, and after pass new variable in template.Like that: $id_image = Product::getCover((int)$product['id_product']); if (sizeof($id_image) > 0) { $image = new Image($id_image['id_image']); $image_url = _PS_BASE_URL_._THEME_PROD_DIR_.$image->getExistingImgPath().".jpg"; } $product_var_tpl = array( 'reference' => $product['reference'], 'image_url' => $image_url, 'name' => $product['name'].(isset($product['attributes']) ? ' - '.$product['attributes'] : ''), 'unit_price' => Tools::displayPrice($product_price, $this->context->currency, false), 'price' => Tools::displayPrice($product_price * $product['quantity'], $this->context->currency, false), 'quantity' => $product['quantity'], 'customization' => array() ); And after in template write where you want this: {$product['image_url']} Link to comment Share on other sites More sharing options...
wiseprt Posted July 6, 2015 Share Posted July 6, 2015 Hi again, with the addition of {$product['image_url']} in the template file, i get link path like this one in the email "http://mysite.com/img/p/2/8/28.jpg instead of the image thumbnail. Any thoughts? Link to comment Share on other sites More sharing options...
Kerm Posted July 7, 2015 Share Posted July 7, 2015 Try this: $cover = Image::getCover((int)$product['id_product']); // array image if (sizeof($cover['id_image']) > 0) { $folder = Image::getImgFolderStatic($cover['id_image']); // folders inside /img/p/ $image = '<img src="../img/p/'.$folder.$cover['id_image'].'-medium_default.jpg" alt="" width="125" height="125" class="imgm img-thumbnail" />'; } else { $image = '<img src="../img/p/en-default-medium_default.jpg" alt="" width="125" height="125" class="imgm img-thumbnail" />'; } $product_var_tpl = array( 'reference' => $product['reference'], 'image' => $image, 'name' => $product['name'].(isset($product['attributes']) ? ' - '.$product['attributes'] : ''), 'unit_price' => Tools::displayPrice($product_price, $this->context->currency, false), 'price' => Tools::displayPrice($product_price * $product['quantity'], $this->context->currency, false), 'quantity' => $product['quantity'], 'customization' => array() ); Inside template write this: {$product['image']} and you get full image tag with image url. In code change "medium_default" on your image size type.Also if product dont have image you will see default product image in mail template: en-default-medium_default.jpg, change "en" if you have different language. 1 Link to comment Share on other sites More sharing options...
wiseprt Posted July 7, 2015 Share Posted July 7, 2015 Hi, Great news! That worked. Thanks a lot @Kerm. 1 Link to comment Share on other sites More sharing options...
PS newbi Posted July 28, 2015 Share Posted July 28, 2015 https://www.prestashop.com/forums/topic/229948-how-to-put-product-images-in-customer-order-mail/?p=2089340 Would you please explain this step by step? I am a little bit lost. Thanks Link to comment Share on other sites More sharing options...
PS newbi Posted July 28, 2015 Share Posted July 28, 2015 Oh, did not see, i thought it was mail alert module. For costumer email you need edit mails/en/order_conf_product_list.tpl file for prestashop 1.6.0.14 > But also in file PaymentModule.php prestashop pass varibles to this tamplate on line 495: if (count($product_var_tpl_list) > 0) { $product_list_txt = $this->getEmailTemplateContent('order_conf_product_list.txt', Mail::TYPE_TEXT, $product_var_tpl_list); $product_list_html = $this->getEmailTemplateContent('order_conf_product_list.tpl', Mail::TYPE_HTML, $product_var_tpl_list); } So if you need pass new variable into template you need do this in file Payment Module.php same way like other standard variables. Would you please explain step by step? I am a little bit lost Thanks Link to comment Share on other sites More sharing options...
wiseprt Posted July 28, 2015 Share Posted July 28, 2015 Inside PaymentModule.php you can find this code inside foreach(): $product_var_tpl = array( 'reference' => $product['reference'], 'name' => $product['name'].(isset($product['attributes']) ? ' - '.$product['attributes'] : ''), 'unit_price' => Tools::displayPrice($product_price, $this->context->currency, false), 'price' => Tools::displayPrice($product_price * $product['quantity'], $this->context->currency, false), 'quantity' => $product['quantity'], 'customization' => array() ); You need put your code before this code, and after pass new variable in template. You need put your code before this code, and after pass new variable in template. like that: $cover = Image::getCover((int)$product['id_product']); // array image if (sizeof($cover['id_image']) > 0) { $folder = Image::getImgFolderStatic($cover['id_image']); // folders inside /img/p/ $image = '<img src="../img/p/'.$folder.$cover['id_image'].'-medium_default.jpg" alt="" width="125" height="125" class="imgm img-thumbnail" />'; } else { $image = '<img src="../img/p/en-default-medium_default.jpg" alt="" width="125" height="125" class="imgm img-thumbnail" />'; } $product_var_tpl = array( 'reference' => $product['reference'], 'image' => $image, 'name' => $product['name'].(isset($product['attributes']) ? ' - '.$product['attributes'] : ''), 'unit_price' => Tools::displayPrice($product_price, $this->context->currency, false), 'price' => Tools::displayPrice($product_price * $product['quantity'], $this->context->currency, false), 'quantity' => $product['quantity'], 'customization' => array() ); and then inside template write this: {$product['image']} and you get full image tag with image url. In code change "medium_default" on your image size type.Also if product don't have image you will see default product image in mail template: en-default-medium_default.jpg, change "en" if you have different language. Link to comment Share on other sites More sharing options...
PS newbi Posted July 28, 2015 Share Posted July 28, 2015 Inside PaymentModule.php you can find this code inside foreach(): $product_var_tpl = array( 'reference' => $product['reference'], 'name' => $product['name'].(isset($product['attributes']) ? ' - '.$product['attributes'] : ''), 'unit_price' => Tools::displayPrice($product_price, $this->context->currency, false), 'price' => Tools::displayPrice($product_price * $product['quantity'], $this->context->currency, false), 'quantity' => $product['quantity'], 'customization' => array() ); You need put your code before this code, and after pass new variable in template. You need put your code before this code, and after pass new variable in template. like that: $cover = Image::getCover((int)$product['id_product']); // array image if (sizeof($cover['id_image']) > 0) { $folder = Image::getImgFolderStatic($cover['id_image']); // folders inside /img/p/ $image = '<img src="../img/p/'.$folder.$cover['id_image'].'-medium_default.jpg" alt="" width="125" height="125" class="imgm img-thumbnail" />'; } else { $image = '<img src="../img/p/en-default-medium_default.jpg" alt="" width="125" height="125" class="imgm img-thumbnail" />'; } $product_var_tpl = array( 'reference' => $product['reference'], 'image' => $image, 'name' => $product['name'].(isset($product['attributes']) ? ' - '.$product['attributes'] : ''), 'unit_price' => Tools::displayPrice($product_price, $this->context->currency, false), 'price' => Tools::displayPrice($product_price * $product['quantity'], $this->context->currency, false), 'quantity' => $product['quantity'], 'customization' => array() ); and then inside template write this: {$product['image']} and you get full image tag with image url. In code change "medium_default" on your image size type. Also if product don't have image you will see default product image in mail template: en-default-medium_default.jpg, change "en" if you have different language. Inside what template and where? Link to comment Share on other sites More sharing options...
wiseprt Posted July 28, 2015 Share Posted July 28, 2015 For the customer email you have to add this in the tpl file -> mails/en (or_your_language) /order_conf_product_list.tpl Link to comment Share on other sites More sharing options...
PS newbi Posted July 29, 2015 Share Posted July 29, 2015 I had to do some changes. Now it is working. Thanks. Link to comment Share on other sites More sharing options...
PS newbi Posted July 30, 2015 Share Posted July 30, 2015 A small problem. I only get cover image. I don't get the right image for the combination products. Product with color black or white and cover image is black, if i buy white i still get image for black. How do i change this? Link to comment Share on other sites More sharing options...
PS newbi Posted July 30, 2015 Share Posted July 30, 2015 I am using version 1.6.0.14. Anyone tried this? Link to comment Share on other sites More sharing options...
Kerm Posted August 3, 2015 Share Posted August 3, 2015 (edited) A small problem. I only get cover image. I don't get the right image for the combination products. Product with color black or white and cover image is black, if i buy white i still get image for black. How do i change this? Try this code, i test it work on 1.6.1: if (isset($product['id_product_attribute'])){ $result_images = Product::_getAttributeImageAssociations($product['id_product_attribute']); if (isset($result_images[0])){ $folder = Image::getImgFolderStatic($result_images[0]); // folders inside /img/p/ $image = '<img src="../img/p/'.$folder.$result_images[0].'-medium_default.jpg" alt="" width="125" height="125" class="imgm img-thumbnail" />'; } else { $cover = Image::getCover((int)$product['id_product']); // array image if (sizeof($cover['id_image']) > 0) { $folder = Image::getImgFolderStatic($cover['id_image']); // folders inside /img/p/ $image = '<img src="../img/p/'.$folder.$cover['id_image'].'-medium_default.jpg" alt="" width="125" height="125" class="imgm img-thumbnail" />'; } else { $image = '<img src="../img/p/en-default-medium_default.jpg" alt="" width="125" height="125" class="imgm img-thumbnail" />'; } } } else { $cover = Image::getCover((int)$product['id_product']); // array image if (sizeof($cover['id_image']) > 0) { $folder = Image::getImgFolderStatic($cover['id_image']); // folders inside /img/p/ $image = '<img src="../img/p/'.$folder.$cover['id_image'].'-medium_default.jpg" alt="" width="125" height="125" class="imgm img-thumbnail" />'; } else { $image = '<img src="../img/p/en-default-medium_default.jpg" alt="" width="125" height="125" class="imgm img-thumbnail" />'; } } $product_var_tpl = array( 'reference' => $product['reference'], 'image' => $image, 'name' => $product['name'].(isset($product['attributes']) ? ' - '.$product['attributes'] : ''), 'unit_price' => Tools::displayPrice($product_price, $this->context->currency, false), 'price' => Tools::displayPrice($product_price * $product['quantity'], $this->context->currency, false), 'quantity' => $product['quantity'], 'customization' => array() ); Edited August 3, 2015 by Kerm (see edit history) Link to comment Share on other sites More sharing options...
maximilian8777 Posted October 21, 2015 Share Posted October 21, 2015 Is possibile to apply this "edit" to insert picture of product in "send to a friend module" mail to customer? Link to comment Share on other sites More sharing options...
ietax Posted November 7, 2015 Share Posted November 7, 2015 Doesn't work on 1.6... any solution for new version? Link to comment Share on other sites More sharing options...
Kerm Posted November 10, 2015 Share Posted November 10, 2015 Its work on 1.6.1.x Link to comment Share on other sites More sharing options...
Kerm Posted November 17, 2015 Share Posted November 17, 2015 (edited) I made override file for easy setup and attach it to this message. Upload this file in this dir: \override\classes\PaymentModule.php After delete this file: /cache/class_index.php After you need edit your email template: \mails\en\order_conf_product_list.tpl Put this code: <td style="border:1px solid #D6D4D4;"> <table class="table"> <tr> <td width="10"> </td> <td> <font size="2" face="Open-sans, sans-serif" color="#555454"> {$product['image']} </font> </td> <td width="10"> </td> </tr> </table> </td> Before this code: <td style="border:1px solid #D6D4D4;"> <table class="table"> <tr> <td width="10"> </td> <td> <font size="2" face="Open-sans, sans-serif" color="#555454"> {$product['reference']} </font> </td> <td width="10"> </td> </tr> </table> </td> Also edit \mails\en\order_conf.html file: Put this code: <th bgcolor="#f8f8f8" style="border:1px solid #D6D4D4;background-color: #fbfbfb;color: #333;font-family: Arial;font-size: 13px;padding: 10px;">Foto</th> Before this code: <th bgcolor="#f8f8f8" style="border:1px solid #D6D4D4;background-color: #fbfbfb;color: #333;font-family: Arial;font-size: 13px;padding: 10px;">Reference</th> Good luck! My email template with this addon: PaymentModule.php Edited November 17, 2015 by Kerm (see edit history) Link to comment Share on other sites More sharing options...
akosnadasdi Posted March 13, 2016 Share Posted March 13, 2016 Hi Kerm . Is your combination image solution also working with the maileralers module? could not figure it out what to put in that maileralert.php file exactly Link to comment Share on other sites More sharing options...
Kerm Posted March 14, 2016 Share Posted March 14, 2016 No, only product main image... Link to comment Share on other sites More sharing options...
YasinTürk Posted March 19, 2016 Share Posted March 19, 2016 (edited) /modules/mailalerts/mailalerts.php mail alerts not wokring versiyon 1.6.1.3 edited Edited March 21, 2016 by Kerm Message was too long (see edit history) Link to comment Share on other sites More sharing options...
Kerm Posted March 21, 2016 Share Posted March 21, 2016 /modules/mailalerts/mailalerts.php mail alerts not wokring versiyon 1.6.1.3 edited Please upload file, do not copy all the entire code file here! If you look better you will see that this post about "Customer Order Mail", not about mailalerts module. For your question please made new post with your problem. Link to comment Share on other sites More sharing options...
logan1ro Posted March 31, 2016 Share Posted March 31, 2016 Hello Kerm, Your stept by step guide works flawless, thank you. However, the images from the email are truncated, they don't respect aspect ratio. Is there something I can do to solve this issue? Thank you again. Link to comment Share on other sites More sharing options...
Kerm Posted March 31, 2016 Share Posted March 31, 2016 Inside file PaymentModule.php find lines with number 352 and 354. You will see IMG tags inside php code, edit this lines to change image sizes or just try remove (width="160" height="213") Link to comment Share on other sites More sharing options...
rive68 Posted March 31, 2016 Share Posted March 31, 2016 HI, for PRESTASHOP 1.5.3.1? Link to comment Share on other sites More sharing options...
Kerm Posted April 11, 2016 Share Posted April 11, 2016 Hi, This method is not working for 1.6.1.4. I get a blank page in frontpage. Could you please help? Thanks a lot Its work great on 1.6.1.4, you do some thing wrong. Turn on display error and you will see where you have error. Link to comment Share on other sites More sharing options...
jesus.fernandez Posted April 11, 2016 Share Posted April 11, 2016 Its work great on 1.6.1.4, you do some thing wrong. Turn on display error and you will see where you have error. Hi, I get it to work more or less. I have two payment methods: Default bank transfer and a paid one (pay on delivery with fee). The second one is not showing pictures. Any ideas? Thanks a lot. Regards Link to comment Share on other sites More sharing options...
Kerm Posted April 12, 2016 Share Posted April 12, 2016 Need look code of this module, may be somewhere in code this module have self mail sending script, look for Mail:: in code. Link to comment Share on other sites More sharing options...
jesus.fernandez Posted April 20, 2016 Share Posted April 20, 2016 Hi thank you, I attach the file for my payondeliverywithfee module, perhaps you can have a look to help me. I have tried to add $product['image'] before $product['reference'] everywhere in code, but It does show nothing at all. Thanks a million paywithfee.php paywithfee.php Link to comment Share on other sites More sharing options...
YasinTürk Posted May 3, 2016 Share Posted May 3, 2016 How To Put Product Images In Customer Order mailalerts v3.6.0 modules?Thank You Link to comment Share on other sites More sharing options...
bilal456 Posted September 6, 2016 Share Posted September 6, 2016 hey, how to add the product image in mail alerts new_order.tpl file. Thank you. Link to comment Share on other sites More sharing options...
Kaper Posted September 19, 2016 Share Posted September 19, 2016 (edited) I made override file for easy setup and attach it to this message. Upload this file in this dir: \override\classes\PaymentModule.php After delete this file: /cache/class_index.php After you need edit your email template: \mails\en\order_conf_product_list.tpl Put this code: <td style="border:1px solid #D6D4D4;"> <table class="table"> <tr> <td width="10"> </td> <td> <font size="2" face="Open-sans, sans-serif" color="#555454"> {$product['image']} </font> </td> <td width="10"> </td> </tr> </table> </td> Before this code: <td style="border:1px solid #D6D4D4;"> <table class="table"> <tr> <td width="10"> </td> <td> <font size="2" face="Open-sans, sans-serif" color="#555454"> {$product['reference']} </font> </td> <td width="10"> </td> </tr> </table> </td> Also edit \mails\en\order_conf.html file: Put this code: <th bgcolor="#f8f8f8" style="border:1px solid #D6D4D4;background-color: #fbfbfb;color: #333;font-family: Arial;font-size: 13px;padding: 10px;">Foto</th> Before this code: <th bgcolor="#f8f8f8" style="border:1px solid #D6D4D4;background-color: #fbfbfb;color: #333;font-family: Arial;font-size: 13px;padding: 10px;">Reference</th> Thank you it WORKS in 1.6.1.0 BUT... There is one thing which i need to solve, it don´t work properly with product combinations. It show just "default" image, but not image which is assigned to combination color. See my screenshot for example. Can you please help? THANK YOU Edited September 19, 2016 by Kaper (see edit history) Link to comment Share on other sites More sharing options...
Kaper Posted November 21, 2016 Share Posted November 21, 2016 Nobody? How can i add product image into others email template? I need to show product image for example in shipped tpl. Thanks! Link to comment Share on other sites More sharing options...
imjacwu Posted February 9, 2017 Share Posted February 9, 2017 Inside PaymentModule.php you can find this code inside foreach(): $product_var_tpl = array( 'reference' => $product['reference'], 'name' => $product['name'].(isset($product['attributes']) ? ' - '.$product['attributes'] : ''), 'unit_price' => Tools::displayPrice($product_price, $this->context->currency, false), 'price' => Tools::displayPrice($product_price * $product['quantity'], $this->context->currency, false), 'quantity' => $product['quantity'], 'customization' => array() ); You need put your code before this code, and after pass new variable in template. You need put your code before this code, and after pass new variable in template. like that: $cover = Image::getCover((int)$product['id_product']); // array image if (sizeof($cover['id_image']) > 0) { $folder = Image::getImgFolderStatic($cover['id_image']); // folders inside /img/p/ $image = '<img src="../img/p/'.$folder.$cover['id_image'].'-medium_default.jpg" alt="" width="125" height="125" class="imgm img-thumbnail" />'; } else { $image = '<img src="../img/p/en-default-medium_default.jpg" alt="" width="125" height="125" class="imgm img-thumbnail" />'; } $product_var_tpl = array( 'reference' => $product['reference'], 'image' => $image, 'name' => $product['name'].(isset($product['attributes']) ? ' - '.$product['attributes'] : ''), 'unit_price' => Tools::displayPrice($product_price, $this->context->currency, false), 'price' => Tools::displayPrice($product_price * $product['quantity'], $this->context->currency, false), 'quantity' => $product['quantity'], 'customization' => array() ); and then inside template write this: {$product['image']} and you get full image tag with image url.In code change "medium_default" on your image size type. Also if product don't have image you will see default product image in mail template: en-default-medium_default.jpg, change "en" if you have different language. Hi All, I follow the above steps on 1.6.1.10 but not sure why the image still not showing up. Attached is a screenshot I have even tested on PaymentModule.php with the below code to ensure the image url is correct, which works fine. echo "<pre>"; print_r($image); echo "</pre>"; exit(); Appreciate some help/advise. Thanks in advance !! Cheers, Jac Link to comment Share on other sites More sharing options...
aurimas84 Posted April 5, 2017 Share Posted April 5, 2017 Hi, I got it worked so it shows product image in order email, but I need to show product combination image. For example if I choose to buy blue car in my order email it shows blue car, not the default product image (for example red car). Any ideas how to do it? Link to comment Share on other sites More sharing options...
octopus23 Posted April 18, 2017 Share Posted April 18, 2017 I'm on 1.6.0.9 I tried $cover = Image::getCover((int)$product['id_product']); // array image if (sizeof($cover['id_image']) > 0) { $folder = Image::getImgFolderStatic($cover['id_image']); // folders inside /img/p/ $image = '<img src="../img/p/'.$folder.$cover['id_image'].'-medium_default.jpg" alt="" width="125" height="125" class="imgm img-thumbnail" />'; } else { $image = '<img src="../img/p/en-default-medium_default.jpg" alt="" width="125" height="125" class="imgm img-thumbnail" />'; } $product_var_tpl = array( 'reference' => $product['reference'], 'image' => $image, 'name' => $product['name'].(isset($product['attributes']) ? ' - '.$product['attributes'] : ''), 'unit_price' => Tools::displayPrice($product_price, $this->context->currency, false), 'price' => Tools::displayPrice($product_price * $product['quantity'], $this->context->currency, false), 'quantity' => $product['quantity'], 'customization' => array() ); + modification on order_conf.html {$product['image']} it does not work http://i.imgur.com/p2bjLuF.jpg idea? (I'm on 1.6.0.9) Link to comment Share on other sites More sharing options...
octopus23 Posted April 23, 2017 Share Posted April 23, 2017 nobody? Link to comment Share on other sites More sharing options...
octopus23 Posted April 29, 2017 Share Posted April 29, 2017 (edited) Misery, I can not seem to include product image in the email on 1.6.0.9 Edited April 29, 2017 by octopus23 (see edit history) Link to comment Share on other sites More sharing options...
tobyisabelle Posted May 1, 2017 Share Posted May 1, 2017 Hi! I've tried everything stated in this thread but can't get the photos to show. I'm using PS 1.7.1. Can anyone advise? Thanks so much in advance! : ) Link to comment Share on other sites More sharing options...
octopus23 Posted May 6, 2017 Share Posted May 6, 2017 I'm on 1.6.0.9 I tried $cover = Image::getCover((int)$product['id_product']); // array image if (sizeof($cover['id_image']) > 0) { $folder = Image::getImgFolderStatic($cover['id_image']); // folders inside /img/p/ $image = '<img src="../img/p/'.$folder.$cover['id_image'].'-medium_default.jpg" alt="" width="125" height="125" class="imgm img-thumbnail" />'; } else { $image = '<img src="../img/p/en-default-medium_default.jpg" alt="" width="125" height="125" class="imgm img-thumbnail" />'; } $product_var_tpl = array( 'reference' => $product['reference'], 'image' => $image, 'name' => $product['name'].(isset($product['attributes']) ? ' - '.$product['attributes'] : ''), 'unit_price' => Tools::displayPrice($product_price, $this->context->currency, false), 'price' => Tools::displayPrice($product_price * $product['quantity'], $this->context->currency, false), 'quantity' => $product['quantity'], 'customization' => array() ); + modification on order_conf.html {$product['image']} it does not work http://i.imgur.com/p2bjLuF.jpg idea? (I'm on 1.6.0.9) bump Link to comment Share on other sites More sharing options...
riccardopannocchia Posted May 31, 2017 Share Posted May 31, 2017 Hi , Presta 1.6.1.13 Need remove 'product reference' from email order confirm to client on PaymentModule.php I have deleted this code 'reference' => $product['reference'], in line 463 : now my code is : $product_var_tpl = array( 'name' => $product['name'].(isset($product['attributes']) ? ' - '.$product['attributes'] : ''), 'unit_price' => Tools::displayPrice($product_price, $this->context->currency, false), 'price' => Tools::displayPrice($product_price * $product['quantity'], $this->context->currency, false), 'quantity' => $product['quantity'], 'customization' => array() ); Upload PaymentModule.php in this dir: \override\classes\ After delete this file: /cache/class_index.php But i have the same email ... I have Also edit \mails\it\order_conf.html..... Where i have mistake ? Thanks Link to comment Share on other sites More sharing options...
Kaper Posted August 17, 2017 Share Posted August 17, 2017 Hi, I got it worked so it shows product image in order email, but I need to show product combination image. For example if I choose to buy blue car in my order email it shows blue car, not the default product image (for example red car). Any ideas how to do it? I have the same request. Please is here anybody who can edit the code for showing combination IMAGE? Thanks, it would be awesome! Btw everything working in 1.6.1.0. !!! Thanks. Link to comment Share on other sites More sharing options...
Caracal Posted August 30, 2017 Share Posted August 30, 2017 $cover = Image::getCover((int)$product['id_product']); // array image if (sizeof($cover['id_image']) > 0) { $folder = Image::getImgFolderStatic($cover['id_image']); // folders inside /img/p/ $image = '<img src="http://mysite.com/img/p/'.$folder.$cover['id_image'].'-medium_default.jpg" alt="" width="125" height="125" />'; } else { $image = '<img src="http://mysite.com/img/p/ru-default-medium_default.jpg" alt="" width="125" height="125" class="imgm img-thumbnail" />'; } this great work for Mail alerts module in PrestaShop 1.6.1.12. I put this code in /modules/mailalerts/mailalerts.php before $items_table near 316 line and replace content in second column <strong><a href="'.$url.'">'.$product['product_name'].'</a>' .(isset($product['attributes_small']) ? ' '.$product['attributes_small'] : '') .(!empty($customization_text) ? '<br />'.$customization_text : '') .'</strong> to: <table border="0"> <tr> <td width="158">' . $image . '</td> <td> <strong><a href="'.$url.'">'.$product['product_name'].'</a>' .(isset($product['attributes_small']) ? ' '.$product['attributes_small'] : '') .(!empty($customization_text) ? '<br />'.$customization_text : '') .'</strong> </td> </tr> </table> Now I receive order messages with images of the products. This is convenient for me. Probably, it will be correct to replace mysite.com with a variable of the base URL or a constant. Sorry for my poor English. 1 1 Link to comment Share on other sites More sharing options...
vmthang Posted January 10, 2018 Share Posted January 10, 2018 On 11/10/2015 at 11:32 AM, Kerm said: Its work on 1.6.1.x Hello Kerm, I followed your instructions but unluckily that it is not working on 1.6.1.5. There is no images showing on email order as you can see in the screenshot attached. Could you please let me know why? Thank you! Link to comment Share on other sites More sharing options...
Rayyo Posted May 2, 2018 Share Posted May 2, 2018 On 2/9/2017 at 8:35 AM, imjacwu said: On 7/28/2015 at 6:11 PM, wiseprt said: 1 Hi, I have implemented that but it still not displaying image. and in email image tag showing unknow src Thanks Link to comment Share on other sites More sharing options...
Augen2203 Posted June 5, 2019 Share Posted June 5, 2019 $product_var_tpl_list = array(); foreach ($order->product_list as $product) { $price = Product::getPriceStatic((int)$product['id_product'], false, ($product['id_product_attribute'] ? (int)$product['id_product_attribute'] : null), 6, null, false, true, $product['cart_quantity'], false, (int)$order->id_customer, (int)$order->id_cart, (int)$order->{Configuration::get('PS_TAX_ADDRESS_TYPE')}); $price_wt = Product::getPriceStatic((int)$product['id_product'], true, ($product['id_product_attribute'] ? (int)$product['id_product_attribute'] : null), 2, null, false, true, $product['cart_quantity'], false, (int)$order->id_customer, (int)$order->id_cart, (int)$order->{Configuration::get('PS_TAX_ADDRESS_TYPE')}); $product_price = Product::getTaxCalculationMethod() == PS_TAX_EXC ? Tools::ps_round($price, 2) : $price_wt; $product_var_tpl = array( 'reference' $product_var_tpl_list = array(); foreach ($order->product_list as $product) { $price = Product::getPriceStatic((int)$product['id_product'], false, ($product['id_product_attribute'] ? (int)$product['id_product_attribute'] : null), 6, null, false, true, $product['cart_quantity'], false, (int)$order->id_customer, (int)$order->id_cart, (int)$order->{Configuration::get('PS_TAX_ADDRESS_TYPE')}); $price_wt = Product::getPriceStatic((int)$product['id_product'], true, ($product['id_product_attribute'] ? (int)$product['id_product_attribute'] : null), 2, null, false, true, $product['cart_quantity'], false, (int)$order->id_customer, (int)$order->id_cart, (int)$order->{Configuration::get('PS_TAX_ADDRESS_TYPE')}); $product_price = Product::getTaxCalculationMethod() == PS_TAX_EXC ? Tools::ps_round($price, 2) : $price_wt; $product_var_tpl = array( 'reference' => $product['reference'], 'name' => $product['name'].(isset($product['attributes']) ? ' - '.$product['attributes'] : ''), 'unit_price' => Tools::displayPrice($product_price, $this->context->currency, false), 'price' => Tools::displayPrice($product_price * $product['quantity'], $this->context->currency, false), 'quantity' => $product['quantity'], 'customization' => array() ); => $product['reference'], 'name' => $product['name'].(isset($product['attributes']) ? ' - '.$product['attributes'] : ''), 'unit_price' => Tools::displayPrice($product_price, $this->context->currency, false), 'price' => Tools::displayPrice($product_price * $product['quantity'], $this->context->currency, false), 'quantity' => $product['quantity'], 'customization' => array() ); Заменив участок кода, что выше, участком кода, что ниже. $product_var_tpl_list = array(); foreach ($order->product_list as $product) { $price = Product::getPriceStatic((int)$product['id_product'], false, ($product['id_product_attribute'] ? (int)$product['id_product_attribute'] : null), 6, null, false, true, $product['cart_quantity'], false, (int)$order->id_customer, (int)$order->id_cart, (int)$order->{Configuration::get('PS_TAX_ADDRESS_TYPE')}); $price_wt = Product::getPriceStatic((int)$product['id_product'], true, ($product['id_product_attribute'] ? (int)$product['id_product_attribute'] : null), 2, null, false, true, $product['cart_quantity'], false, (int)$order->id_customer, (int)$order->id_cart, (int)$order->{Configuration::get('PS_TAX_ADDRESS_TYPE')}); $product_price = Product::getTaxCalculationMethod() == PS_TAX_EXC ? Tools::ps_round($price, 2) : $price_wt; $cover = Image::getCover((int)$product['id_product']); // array image $id_shop = $this->context->shop; $force_ssl = (Configuration::get('PS_SSL_ENABLED') && Configuration::get('PS_SSL_ENABLED_EVERYWHERE')); $language_prefix = $this->context->language->iso_code; if (Configuration::get('PS_MULTISHOP_FEATURE_ACTIVE') && $id_shop !== null) { $shop = new Shop($id_shop); } else { $shop = Context::getContext()->shop; } if ($relative_protocol) { $base = '//'.($ssl && $this->ssl_enable ? $shop->domain_ssl : $shop->domain); } else { $base = (($ssl && $this->ssl_enable) ? 'https://'.$shop->domain_ssl : 'http://'.$shop->domain); } $base_url = $base.$shop->getBaseURI(); $domain = Configuration::get('PS_SHOP_DOMAIN'); if (sizeof($cover['id_image']) > 0) { $folder = Image::getImgFolderStatic($cover['id_image']); // folders inside /img/p/ $image = '<img src="'.$base_url.'img/p/'.$folder.$cover['id_image'].'-cart_default.jpg" alt="" width="160" height="213" class="imgm img-thumbnail" />'; } else { $image = '<img src="'.$base_url.'img/p/'.$language_prefix.'-default-cart_default.jpg" alt="" width="125" height="125" class="imgm img-thumbnail" />'; } $product_var_tpl = array( 'reference' => $product['reference'], 'image' => $image, 'name' => $product['name'].(isset($product['attributes']) ? ' - '.$product['attributes'] : ''), 'unit_price' => Tools::displayPrice($product_price, $this->context->currency, false), 'price' => Tools::displayPrice($product_price * $product['quantity'], $this->context->currency, false), 'quantity' => $product['quantity'], 'customization' => array() ); При этом выполнив инструкцию, цитируемого поста. Спасибо! PaymentModule.php Link to comment Share on other sites More sharing options...
Augen2203 Posted June 5, 2019 Share Posted June 5, 2019 On 17.11.2015 at 14:47, Kerm said: Я сделал файл переопределения для легкой настройки и приложил его к этому сообщению. Загрузить этот файл в этот каталог: \ переопределение \ Классы \ PaymentModule.php После удаления этого файла: /cache/class_index.php После того, как вам нужно отредактировать ваш шаблон электронной почты: \ почта \ EN \ order_conf_product_list.tpl Поместите этот код: Перед этим кодом: Также отредактируйте файл \ mails \ en \ order_conf.html: Поместите этот код: Перед этим кодом: Удачи! Мой шаблон электронной почты с этим дополнением: PaymentModule.php Спасибо за помощь, у меня вышло заменив определнный участко кода Link to comment Share on other sites More sharing options...
Ale_BB Posted June 25, 2020 Share Posted June 25, 2020 Hello, I'm reanimating this dead cold topic because I was trying to implement the same thing in my shop. I am using PrestaShop 1.7.5.1 but the proposed method was for 1.6 and it doesn't work on my version. Does anyone know how to make it work? Thanks! Link to comment Share on other sites More sharing options...
Pier100 Posted July 31, 2020 Share Posted July 31, 2020 En 25/6/2020 a las 3:52 AM, Ale_BB dijo: Hola, Estoy reanimando este tema frío porque estaba tratando de implementar lo mismo en mi tienda. Estoy usando PrestaShop 1.7.5.1 pero el método propuesto fue para 1.6 y no funciona en mi versión. ¿Alguien sabe cómo hacer que funcione? ¡Gracias! Hola Ale pudiste encontrar alguna solucion, me gustaria hacer lo mismo Link to comment Share on other sites More sharing options...
Ale_BB Posted August 3, 2020 Share Posted August 3, 2020 On 7/31/2020 at 3:38 PM, Pier100 said: Hola Ale pudiste encontrar alguna solucion, me gustaria hacer lo mismo Lo siento, nadie me respondió y lo dejé. No fue una cosa asì importante para mi. Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now