[Skip to main content](#vessel-content)

#   Information mail: add image into message

##

- **[simtheo](/forum/user/45725-simtheo "View simtheo's Profile")**
- [![simtheo's Avatar](https://www.hikashop.com/media/kunena/core/svg/person.svg)](/forum/user/45725-simtheo "View simtheo's Profile") Topic Author
- [ Offline](/forum/user/45725-simtheo)

Less More

- Posts: 24
- Thank you received: 0
-
-

9 years 6 months ago -  9 years 6 months ago [\#267009](#267009) by [simtheo](/forum/user/45725-simtheo "View simtheo's Profile")  *[Information mail: add image into message](/forum/26-product-category-display/889744-information-mail-add-image-into-message#267009 "-- url of the page with the problem -- :   www.matabikeshop.com/  Hello. It's possible to add the product image inside the information mail? In the information mail there is only the product name (with link to the page) but I need also to see the image after the name. In the NEW ORDER email there is the product image, but I cannot manage the PHP source code for handle the image inside the information mail.  I found this source code for handle the image but isn't correct. I found it from the PRELOAD VERSIONE section of NEW ORDER confirmation mail:  Thanks for the support.  BR  MatteoS")* was created by *[simtheo](/forum/user/45725-simtheo "View simtheo's Profile")*

-- url of the page with the problem -- : [ www.matabikeshop.com/](http://www.matabikeshop.com/)

Hello.
It's possible to add the product image inside the information mail?
In the information mail there is only the product name (with link to the page) but I need also to see the image after the name.
In the NEW ORDER email there is the product image, but I cannot manage the PHP source code for handle the image inside the information mail.

I found this source code for handle the image but isn't correct. I found it from the PRELOAD VERSIONE section of NEW ORDER confirmation mail: Code:

if(!empty($item-&gt;images[0]-&gt;file_path) &amp;&amp; $config-&gt;get('thumbnail', 1) != 0) { //$img = $imageHelper-&gt;getThumbnail($item-&gt;images[0]-&gt;file_path, array(50, 50), array('forcesize' =&gt; true, 'scale' =&gt; 'outside')); $img = $imageHelper-&gt;getThumbnail($item-&gt;images[0]-&gt;file_path, array(150, 150), array('default' =&gt; true)); if($img-&gt;success) { if(substr($img-&gt;url, 0, 3) == '../') $image = str_replace('../', HIKASHOP_LIVE, $img-&gt;url); else $image = substr(HIKASHOP_LIVE, 0, strpos(HIKASHOP_LIVE, '/', 9)) . $img-&gt;url; $cartProduct['PRODUCT_IMG'] = '&lt;img src="'.$image.'" alt="" style="float:left;margin-top:3px;margin-bottom:3px;margin-right:6px;"/&gt;'; } }

Thanks for the support.

BR

MatteoS

Last edit: 9 years 6 months ago by [Jerome](/forum/user/80-jerome "View Jerome's Profile"). Reason: [code] is nice

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzI2LXByb2R1Y3QtY2F0ZWdvcnktZGlzcGxheS84ODk3NDQtaW5mb3JtYXRpb24tbWFpbC1hZGQtaW1hZ2UtaW50by1tZXNzYWdlP3RtcGw9bWFya2Rvd24=) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

- **[nicolas](/forum/user/63-nicolas "View nicolas's Profile")**
- [![nicolas's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/users/avatar63.png)](/forum/user/63-nicolas "View nicolas's Profile")
- [ Away](/forum/user/63-nicolas)

Less More

- Posts: 86289
- Thank you received: 14265
-
-

9 years 6 months ago [\#267048](#267048) by [nicolas](/forum/user/63-nicolas "View nicolas's Profile")  Replied by *[nicolas](/forum/user/63-nicolas "View nicolas's Profile")* on topic *[Information mail: add image into message](/forum/26-product-category-display/889744-information-mail-add-image-into-message#267048 "-- url of the page with the problem -- :   www.matabikeshop.com/  Hello. It's possible to add the product image inside the information mail? In the information mail there is only the product name (with link to the page) but I need also to see the image after the name. In the NEW ORDER email there is the product image, but I cannot manage the PHP source code for handle the image inside the information mail.  I found this source code for handle the image but isn't correct. I found it from the PRELOAD VERSIONE section of NEW ORDER confirmation mail:  Thanks for the support.  BR  MatteoS")*

Hi,

The image data is not loaded there. So you'll have to first load that with a MySQL query and then you can use a similar code to get the HTML for the thumbnail.
You can do something like that in the preload: Code:

$query = "SELECT * FROM #__hikashop_file WHERE file_ref_id = ".(int)$data-&gt;product-&gt;product_id." AND file_type='product'"; $db = JFactory::getDBO(); $image = $db-&gt;loadObject(); if(!empty($image-&gt;file_path)) { $img = $imageHelper-&gt;getThumbnail($image-&gt;file_path, array(50, 50), array('forcesize' =&gt; true, 'scale' =&gt; 'outside')); if($img-&gt;success) { if(substr($img-&gt;url, 0, 3) == '../') $image = str_replace('../', HIKASHOP_LIVE, $img-&gt;url); else $image = substr(HIKASHOP_LIVE, 0, strpos(HIKASHOP_LIVE, '/', 9)) . $img-&gt;url; $vars['PRODUCT_IMG'] = '&lt;img src="'.$image.'" alt="" style="float:left;margin-top:3px;margin-bottom:3px;margin-right:6px;"/&gt;'; } }

and then you can use the tag {VAR:PRODUCT_IMG} in the email.

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzI2LXByb2R1Y3QtY2F0ZWdvcnktZGlzcGxheS84ODk3NDQtaW5mb3JtYXRpb24tbWFpbC1hZGQtaW1hZ2UtaW50by1tZXNzYWdlP3RtcGw9bWFya2Rvd24=) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

- **[simtheo](/forum/user/45725-simtheo "View simtheo's Profile")**
- [![simtheo's Avatar](https://www.hikashop.com/media/kunena/core/svg/person.svg)](/forum/user/45725-simtheo "View simtheo's Profile") Topic Author
- [ Offline](/forum/user/45725-simtheo)

Less More

- Posts: 24
- Thank you received: 0
-
-

9 years 6 months ago [\#267141](#267141) by [simtheo](/forum/user/45725-simtheo "View simtheo's Profile")  Replied by *[simtheo](/forum/user/45725-simtheo "View simtheo's Profile")* on topic *[Information mail: add image into message](/forum/26-product-category-display/889744-information-mail-add-image-into-message#267141 "-- url of the page with the problem -- :   www.matabikeshop.com/  Hello. It's possible to add the product image inside the information mail? In the information mail there is only the product name (with link to the page) but I need also to see the image after the name. In the NEW ORDER email there is the product image, but I cannot manage the PHP source code for handle the image inside the information mail.  I found this source code for handle the image but isn't correct. I found it from the PRELOAD VERSIONE section of NEW ORDER confirmation mail:  Thanks for the support.  BR  MatteoS")*

Really thank you.
Unfortunately it doesn't work.
I add some instructions for control the program and I checked that the program doesn't enter not even in the first if.
Why?
The query performed is the seguent:

SELECT * FROM #__hikashop_file WHERE file_ref_id = 758 AND file_type='product'

If I try to perform this query directly on the database, it return the correct result.

Where's the problem?

BR

MatteoS

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzI2LXByb2R1Y3QtY2F0ZWdvcnktZGlzcGxheS84ODk3NDQtaW5mb3JtYXRpb24tbWFpbC1hZGQtaW1hZ2UtaW50by1tZXNzYWdlP3RtcGw9bWFya2Rvd24=) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

- **[simtheo](/forum/user/45725-simtheo "View simtheo's Profile")**
- [![simtheo's Avatar](https://www.hikashop.com/media/kunena/core/svg/person.svg)](/forum/user/45725-simtheo "View simtheo's Profile") Topic Author
- [ Offline](/forum/user/45725-simtheo)

Less More

- Posts: 24
- Thank you received: 0
-
-

9 years 6 months ago -  2 years 5 months ago [\#267147](#267147) by [simtheo](/forum/user/45725-simtheo "View simtheo's Profile")  Replied by *[simtheo](/forum/user/45725-simtheo "View simtheo's Profile")* on topic *[Information mail: add image into message](/forum/26-product-category-display/889744-information-mail-add-image-into-message#267147 "-- url of the page with the problem -- :   www.matabikeshop.com/  Hello. It's possible to add the product image inside the information mail? In the information mail there is only the product name (with link to the page) but I need also to see the image after the name. In the NEW ORDER email there is the product image, but I cannot manage the PHP source code for handle the image inside the information mail.  I found this source code for handle the image but isn't correct. I found it from the PRELOAD VERSIONE section of NEW ORDER confirmation mail:  Thanks for the support.  BR  MatteoS")*

I modified the program in this way: Code:

$query = "SELECT * FROM #__hikashop_file WHERE file_ref_id = ".(int)$data-&gt;product-&gt;product_id." AND file_type='product'"; $db = JFactory::getDBO(); // Reset the query using our newly populated query object. $query = $db-&gt;getQuery(true); $query-&gt;select('*'); $query-&gt;from('#__hikashop_file'); $query-&gt;where("file_ref_id = ".(int)$data-&gt;product-&gt;product_id." AND file_type='product'"); $vars['PRODUCT_IMG'] = "SELECT * FROM #__hikashop_file WHERE file_ref_id = ".(int)$data-&gt;product-&gt;product_id." AND file_type='product'"; $image = $db-&gt;loadObject(); if(!empty($image-&gt;file_path)) { $vars['PRODUCT_IMG'] = 'no img'; $img = $imageHelper-&gt;getThumbnail($image-&gt;file_path, array(150, 150), array('forcesize' =&gt; false, 'scale' =&gt; 'outside')); if($img-&gt;success) { $vars['PRODUCT_IMG'] = 'no path'; if(substr($img-&gt;url, 0, 3) == '../') $image = str_replace('../', HIKASHOP_LIVE, $img-&gt;url); else $image = substr(HIKASHOP_LIVE, 0, strpos(HIKASHOP_LIVE, '/', 9)) . $img-&gt;url; $vars['PRODUCT_IMG'] = '&lt;img src="'.$image.'" alt="" style="float:left;margin-top:3px;margin-bottom:3px;margin-right:6px;"/&gt;'; } }

Last edit: 2 years 5 months ago by [nicolas](/forum/user/63-nicolas "View nicolas's Profile").

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzI2LXByb2R1Y3QtY2F0ZWdvcnktZGlzcGxheS84ODk3NDQtaW5mb3JtYXRpb24tbWFpbC1hZGQtaW1hZ2UtaW50by1tZXNzYWdlP3RtcGw9bWFya2Rvd24=) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

- **[simtheo](/forum/user/45725-simtheo "View simtheo's Profile")**
- [![simtheo's Avatar](https://www.hikashop.com/media/kunena/core/svg/person.svg)](/forum/user/45725-simtheo "View simtheo's Profile") Topic Author
- [ Offline](/forum/user/45725-simtheo)

Less More

- Posts: 24
- Thank you received: 0
-
-

9 years 6 months ago -  2 years 5 months ago [\#267155](#267155) by [simtheo](/forum/user/45725-simtheo "View simtheo's Profile")  Replied by *[simtheo](/forum/user/45725-simtheo "View simtheo's Profile")* on topic *[Information mail: add image into message](/forum/26-product-category-display/889744-information-mail-add-image-into-message#267155 "-- url of the page with the problem -- :   www.matabikeshop.com/  Hello. It's possible to add the product image inside the information mail? In the information mail there is only the product name (with link to the page) but I need also to see the image after the name. In the NEW ORDER email there is the product image, but I cannot manage the PHP source code for handle the image inside the information mail.  I found this source code for handle the image but isn't correct. I found it from the PRELOAD VERSIONE section of NEW ORDER confirmation mail:  Thanks for the support.  BR  MatteoS")*

sorry ... this is correct ...

// Reset the query using our newly populated query object. Code:

$query = $db-&gt;getQuery(true); $query-&gt;select('*'); $query-&gt;from('#__hikashop_file'); $query-&gt;where("file_ref_id = ".(int)$data-&gt;product-&gt;product_id." AND file_type='product'"); $vars['PRODUCT_IMG'] = "SELECT * FROM #__hikashop_file WHERE file_ref_id = ".(int)$data-&gt;product-&gt;product_id." AND file_type='product'"; $image = $db-&gt;loadObject(); if(!empty($image-&gt;file_path)) { $vars['PRODUCT_IMG'] = 'no img'; $img = $imageHelper-&gt;getThumbnail($image-&gt;file_path, array(150, 150), array('forcesize' =&gt; false, 'scale' =&gt; 'outside')); if($img-&gt;success) { $vars['PRODUCT_IMG'] = 'no path'; if(substr($img-&gt;url, 0, 3) == '../') $image = str_replace('../', HIKASHOP_LIVE, $img-&gt;url); else $image = substr(HIKASHOP_LIVE, 0, strpos(HIKASHOP_LIVE, '/', 9)) . $img-&gt;url; $vars['PRODUCT_IMG'] = '&lt;img src="'.$image.'" alt="" style="float:left;margin-top:3px;margin-bottom:3px;margin-right:6px;"/&gt;'; } }

Last edit: 2 years 5 months ago by [nicolas](/forum/user/63-nicolas "View nicolas's Profile").

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzI2LXByb2R1Y3QtY2F0ZWdvcnktZGlzcGxheS84ODk3NDQtaW5mb3JtYXRpb24tbWFpbC1hZGQtaW1hZ2UtaW50by1tZXNzYWdlP3RtcGw9bWFya2Rvd24=) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

- **[nicolas](/forum/user/63-nicolas "View nicolas's Profile")**
- [![nicolas's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/users/avatar63.png)](/forum/user/63-nicolas "View nicolas's Profile")
- [ Away](/forum/user/63-nicolas)

Less More

- Posts: 86289
- Thank you received: 14265
-
-

9 years 6 months ago -  9 years 6 months ago [\#267142](#267142) by [nicolas](/forum/user/63-nicolas "View nicolas's Profile")  Replied by *[nicolas](/forum/user/63-nicolas "View nicolas's Profile")* on topic *[Information mail: add image into message](/forum/26-product-category-display/889744-information-mail-add-image-into-message#267142 "-- url of the page with the problem -- :   www.matabikeshop.com/  Hello. It's possible to add the product image inside the information mail? In the information mail there is only the product name (with link to the page) but I need also to see the image after the name. In the NEW ORDER email there is the product image, but I cannot manage the PHP source code for handle the image inside the information mail.  I found this source code for handle the image but isn't correct. I found it from the PRELOAD VERSIONE section of NEW ORDER confirmation mail:  Thanks for the support.  BR  MatteoS")*

Hi,

Ah yes, I forgot to add the line:
$db-&gt;setQuery($query);
before the line:
$image = $db-&gt;loadObject();

Do that and it should work much better with my version, but yours is good too ![:)](/media/kunena/emoticons/8.png ":)")

Last edit: 9 years 6 months ago by [nicolas](/forum/user/63-nicolas "View nicolas's Profile").

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzI2LXByb2R1Y3QtY2F0ZWdvcnktZGlzcGxheS84ODk3NDQtaW5mb3JtYXRpb24tbWFpbC1hZGQtaW1hZ2UtaW50by1tZXNzYWdlP3RtcGw9bWFya2Rvd24=) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

- **[simtheo](/forum/user/45725-simtheo "View simtheo's Profile")**
- [![simtheo's Avatar](https://www.hikashop.com/media/kunena/core/svg/person.svg)](/forum/user/45725-simtheo "View simtheo's Profile") Topic Author
- [ Offline](/forum/user/45725-simtheo)

Less More

- Posts: 24
- Thank you received: 0
-
-

9 years 6 months ago [\#267237](#267237) by [simtheo](/forum/user/45725-simtheo "View simtheo's Profile")  Replied by *[simtheo](/forum/user/45725-simtheo "View simtheo's Profile")* on topic *[Information mail: add image into message](/forum/26-product-category-display/889744-information-mail-add-image-into-message#267237 "-- url of the page with the problem -- :   www.matabikeshop.com/  Hello. It's possible to add the product image inside the information mail? In the information mail there is only the product name (with link to the page) but I need also to see the image after the name. In the NEW ORDER email there is the product image, but I cannot manage the PHP source code for handle the image inside the information mail.  I found this source code for handle the image but isn't correct. I found it from the PRELOAD VERSIONE section of NEW ORDER confirmation mail:  Thanks for the support.  BR  MatteoS")*

Of course ![;-)](/media/kunena/emoticons/14.png ";-)") your is better !!!
Really thank you for the support: it works perfectly.

BR

MatteoS

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzI2LXByb2R1Y3QtY2F0ZWdvcnktZGlzcGxheS84ODk3NDQtaW5mb3JtYXRpb24tbWFpbC1hZGQtaW1hZ2UtaW50by1tZXNzYWdlP3RtcGw9bWFya2Rvd24=) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

- **[Petike1007](/forum/user/12229-petike1007 "View Petike1007's Profile")**
- [![Petike1007's Avatar](https://www.hikashop.com/media/kunena/core/svg/person.svg)](/forum/user/12229-petike1007 "View Petike1007's Profile")
- [ Offline](/forum/user/12229-petike1007)

Less More

- Posts: 75
- Thank you received: 4
-
-

2 years 5 months ago -  2 years 5 months ago [\#360859](#360859) by [Petike1007](/forum/user/12229-petike1007 "View Petike1007's Profile")  Replied by *[Petike1007](/forum/user/12229-petike1007 "View Petike1007's Profile")* on topic *[Information mail: add image into message](/forum/26-product-category-display/889744-information-mail-add-image-into-message#360859 "-- url of the page with the problem -- :   www.matabikeshop.com/  Hello. It's possible to add the product image inside the information mail? In the information mail there is only the product name (with link to the page) but I need also to see the image after the name. In the NEW ORDER email there is the product image, but I cannot manage the PHP source code for handle the image inside the information mail.  I found this source code for handle the image but isn't correct. I found it from the PRELOAD VERSIONE section of NEW ORDER confirmation mail:  Thanks for the support.  BR  MatteoS")*

I have tried your version, but it's always come back with the same product image.
I can see in the query the file_ref_id is 0
Any idea why is that?

Last edit: 2 years 5 months ago by [Petike1007](/forum/user/12229-petike1007 "View Petike1007's Profile").

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzI2LXByb2R1Y3QtY2F0ZWdvcnktZGlzcGxheS84ODk3NDQtaW5mb3JtYXRpb24tbWFpbC1hZGQtaW1hZ2UtaW50by1tZXNzYWdlP3RtcGw9bWFya2Rvd24=) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

- **[nicolas](/forum/user/63-nicolas "View nicolas's Profile")**
- [![nicolas's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/users/avatar63.png)](/forum/user/63-nicolas "View nicolas's Profile")
- [ Away](/forum/user/63-nicolas)

Less More

- Posts: 86289
- Thank you received: 14265
-
-

2 years 5 months ago [\#360860](#360860) by [nicolas](/forum/user/63-nicolas "View nicolas's Profile")  Replied by *[nicolas](/forum/user/63-nicolas "View nicolas's Profile")* on topic *[Information mail: add image into message](/forum/26-product-category-display/889744-information-mail-add-image-into-message#360860 "-- url of the page with the problem -- :   www.matabikeshop.com/  Hello. It's possible to add the product image inside the information mail? In the information mail there is only the product name (with link to the page) but I need also to see the image after the name. In the NEW ORDER email there is the product image, but I cannot manage the PHP source code for handle the image inside the information mail.  I found this source code for handle the image but isn't correct. I found it from the PRELOAD VERSIONE section of NEW ORDER confirmation mail:  Thanks for the support.  BR  MatteoS")*

Hi,

It's been a while since the image of the products in the order is by default included in the order notification emails sent by HikaShop.
So you should not need to do anything to get them displayed and this thread is not relevant anymore.
What are you trying to do ?

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzI2LXByb2R1Y3QtY2F0ZWdvcnktZGlzcGxheS84ODk3NDQtaW5mb3JtYXRpb24tbWFpbC1hZGQtaW1hZ2UtaW50by1tZXNzYWdlP3RtcGw9bWFya2Rvd24=) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

Board Categories HikaShop- Install &amp; Update- Product &amp; Category Display- Content Creation- Sales and Orders- - Orders management- - Reports &amp; Statistics- Customers- Checkout- Payment Methods- Shipping Methods- Import &amp; Export (CSV, XLS…)- Specific Features- - Affilation- - Taxes- - Wishlist- - Vote- - Carousel &amp; Slider- - Mass Actions- - Filters &amp; Search- - Discount &amp; Coupon- - Feature Request- Integrations- Showcase- General Talk about HikaShop- Development- - HikaShop 3.0 Beta- Translation- Commercial Jobs HikaShop Components- HikaMarket- - Market: Feature requests- - Market: How to?- - Market: Bug Report- HikaSerial- - General talk about HikaSerial- - Serial: Bug Report- - Serial: How to?- - Support en Français de HikaSerial (French Support)- - HikaSubscription- HikaAuction- - Auction: Feature requests- - Auction: How to?- - Auction: Bug report Hikashop around the world- Support en Français (French Support)- Russian- - FAQ. Курс выживания с Hikashop. Частые вопросы и о- - Расширения Hikashop- - Наши сайты на Hikashop- 日本語版サポート(Japanese Support)- Thai- German Archives- Bug Report- How to?

[](/forum/topics/feed/mode-topics?format=feed&type=rss)

Time to create page: 0.275 seconds

[Powered by](/forum/credits) [Kunena Forum](https://www.kunena.org)

[](#top)
