In the order confirmation mails the customer gets, I display the thumbnail of the product he/she has ordered.
I am using this code:
<?php if (!empty($item->images[0])) { echo $item->images[0]->displayMediaThumb ('',FALSE,"", true, false, true);} ?>
The thumbnail size I use in the shop is 400px x 400px. For the mail is that way to big.
How can change the thumnail size in the mails, for example 150 x 150? I was trying to set a td with or a fixed div with, but without success.
Anyone has the right code to do this?
You can try by using the following codes -
<?php if (!empty($item->images[0])) echo $item->images[0]->displayMediaThumb ('style="width: 150px; height: auto; max-height: 150px;"', false, '', true, false, true); ?>
Thank you for your reply.
I tried your code, but the image size is still the same big size in outlook (office365).
On my phone (Iphone) it does resize to a smaller version.
Any idea why the style does not work in Outlook?
<td align="left">
<?php if (!empty($item->images[0])) echo $item->images[0]->displayMediaThumb ('style="width: 150px; height: auto; max-height: 150px;"', false, '', true, false, true); ?>
</td>
<td align="left">
<?php echo $item->order_item_sku; ?>
</td>
Outlook is known to be a beast (not only) in this relation.
A starting point might be https://jasemiller.medium.com/a-fix-for-outlook-image-issues-in-html-email-campaigns-b8dd1c8f7d16, Google or you.com might be your friends as well.
hth, diri
Tried the mso in the code, but with no luck.
Any ideas?
try
<?php if (!empty($item->images[0])) { echo $item->images[0]->displayMediaThumb ('',FALSE,"", true, false, true,150,150);} ?>
to GJC:
Thanks, is the better solution :)