Skip to Content

New J2Commerce 6.6.5 is out. Here is everything in the release.

See What’s New
Account
Enter the email address on your account.
Forgot your username?
Enter your password.
Forgot your password?

Or continue with

Closed Public Category: Technical Support / Bugs Ticket #694

Product thumbnails missing in order emails

This is a public ticket

Everybody will be able to see its contents. Do not include usernames, passwords or any other sensitive information.

Conversation

ulric gress

Regarding: #556: Updated thumbnails not showing in order email

Hi J2C team,

I have updated J2Commerce to version 4.0.20, but I am still experiencing an issue with the order emails.

When an order is completed, the customer and admin emails include the product thumbnails only for older product images (from before the upgrade from Joomla 3 to Joomla 4).

However, thumbnails for newly added product images are not included in the emails.

I have tried using the common web image formats (JPEG, PNG, GIF), but the issue remains the same.

Do you have any idea what might be causing this?

Best regards
Ulric

Olivier Buisard Staff

Hi Ulric,

do you use template overrides?

Because picture issues should no longer occur in the core, but some overrides may not have been updated to reflect the changes made.

Olivier.

ulric gress

Hi Olivier,

Yes, I do use template overrides.

Earlier I asked whether changes were needed in the overrides, and at that time it did not seem so, but from your reply it sounds like the image handling has changed and that my override may no longer reflect the current core logic.

The issue is this:

* old product thumbnails (from before the J3 to J4 migration) are shown correctly in client/admin order emails
* newly added thumbnails are not included in the emails

So it seems likely that the mail override is using outdated image logic.

Could you please tell me exactly which file or layout is now responsible for rendering product thumbnails in the client and admin order emails?

If possible, could you also provide:

* the exact core file path I should compare with my override
* the code change needed in the override
* or even better, a small patch / diff showing what should be updated

I would also like to understand whether this is related to a different Joomla image handling method in J4+.

That would help me update the override correctly.

Best regards,
Ulric

Olivier Buisard Staff

Yes Ulric,

the issue comes from the fact that now Joomla 4 adds information in the image path so you not only get the source, but images width, height and other parameters. You should see it when loading an image in a media field anywhere in Joomla. 

Please edit this ticket and add private credentials so I can point you to the files that need changes.

Thank you!

Olivier.

ulric gress

Hi Olivier,

Thank you for your help.

The only J2Commerce override I currently have is: orderitems.php

Please feel free to check and adjust what is needed, but could you please also document exactly:

• which file(s) you modify
• which lines are changed
• and the reason for the change (Joomla 4 image field handling)

That way I can keep the override aligned with future updates.

Thank you again for your help Olivier.

Best regards
Ulric

The ticket information has been edited by ulric gress (design@gress.dk).
Olivier Buisard Staff

Ulric,

I have fixed the override.

There was no issue with it but our code is incorrect.

The image was not showing because the thumb_image path was checked to see if the file existed. However, it does not when we pass the whole image path (which now contains other attributes).

I have added, after:

$thumb_image = $item->params->get('thumb_image', '');

The code:

$thumb_object = JHtml::cleanImageURL($thumb_image);

Then I replaced all instances of $thumb_image with $thumb_object->url which only contains the image source.

I will make the proper changes in our code.

Olivier.

ulric gress

Hi Olivier,

Thank you very much for fixing this and for the clear explanation.

I appreciate your help and I’m also looking forward to the brand new J2Commerce 6.

Best regards
Ulric