Richard Avenia Posted August 4, 2020 Share Posted August 4, 2020 I am wondering how i would be able to include product images in the order confirmation email sent to customers on completion of a purchase. (Prestashop 1.7.6.7) In the PDF attached to the confirmation email, product images are included in the order summary; however, in the email there doesn't seem to be that option. I have followed several tutorials attempting to add that functionality into PaymentModule.php and order_conf_product_list.tpl but to no success (this tutorial: https://catalogo-onlinersi.net/en/content/28-add-product-images-to-mail-order-confirmation)... I am attaching some pictures showing where I would like to insert the product images in the email and how they are displayed in the attached invoice PDF. I am also attaching the lines I tried adding to the respective mail files, however in the final result the <img> tag results with <img src=(unknown) /> ... Am I on the right track or is it completely off? Link to comment Share on other sites More sharing options...
Pier100 Posted October 27, 2022 Share Posted October 27, 2022 Hola, el codigo funciona, tambien me preguntaba si existe alguna manera de hacer que esto funcione para un producto con combinaciones. Link to comment Share on other sites More sharing options...
ps8modules Posted October 28, 2022 Share Posted October 28, 2022 Link to comment Share on other sites More sharing options...
Pier100 Posted March 30, 2023 Share Posted March 30, 2023 En 27/10/2022 a las 9:58 PM, ps8moduly.cz dijo: obtengo un error 500 creees que me podrias ayudar Link to comment Share on other sites More sharing options...
ps8modules Posted March 30, 2023 Share Posted March 30, 2023 (edited) Hello. Could you please be more specific? Where do you get the 500 error? When confirming the order? Edited March 30, 2023 by ps8moduly.cz (see edit history) Link to comment Share on other sites More sharing options...
Pier100 Posted March 30, 2023 Share Posted March 30, 2023 (edited) hace 13 horas, ps8moduly.cz dijo: Hello. Could you please be more specific? Where do you get the 500 error? When confirming the order? Hola y gracias por la ayuda. El error 500 lo obtengo al presionar el boton REALIZAR PEDIDO en el ultimo paso en el Checkout, al activar depuracion se puede ver el sgte error Para poner en contexto el error te comento que; Agregue el código que usted compartió //Agregamos imagen del producto con combinaciones en el email de confirmacion del pedido if ($product['id_product_attribute']) { $existsAttributeImage = Db::getValue('SELECT id_image FROM '._DB_PREFIX_.'product_attribute_image WHERE id_product_attribute = '.$product['id_product_attribute']); if ($existsAttributeImage) { $image = new Image((int)$existsAttributeImage); $image_url = _PS_BASE_URL_._THEME_PROD_DIR_.$image->getExistingImagePath().'-home_default.jpg'; } else { $image_url = 'undefined'; } } else { $id_image = Image::getCover($product['id_product']); $image = new Image((int)$id_image['id_image']); $image_url = _PS_BASE_URL_._THEME_PROD_DIR_.$image->getExistingImagePath().'-home_default.jpg'; } //Colocar esto debajo de reference en classes/PaymentModule.php 'image' => $image_url, quedando asi En la plantilla de correo agregue lo siguiente: <img src="{$product['image']}" /> quedando asi Adjunto archivo PaymentModule.php PaymentModule.rar Espero vuestra ayuda gracias de antemano un saludo. Edited March 30, 2023 by Pier100 (see edit history) 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