News:

Support the VirtueMart project and become a member

Main Menu

Change propduct thumbnail size in mails

Started by EIF, March 09, 2022, 21:29:59 PM

Previous topic - Next topic

EIF

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,""truefalsetrue);} ?>

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?

Jumbo!

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''truefalsetrue); ?>

EIF

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''truefalsetrue); ?>
</td>
<td align="left">
<?php echo $item->order_item_sku?>
</td>

diri

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

EIF

Tried the mso in the code, but with no luck.

Any ideas?

GJC Web Design

try

<?php if (!empty($item->images[0])) { echo $item->images[0]->displayMediaThumb ('',FALSE,"", true, false, true,150,150);} ?>
GJC Web Design
VirtueMart and Joomla Developers - php developers https://www.gjcwebdesign.com
VM4 AusPost Shipping Plugin - e-go Shipping Plugin - VM4 Postcode Shipping Plugin - Radius Shipping Plugin - VM4 NZ Post Shipping Plugin - AusPost Estimator
Samport Payment Plugin - EcomMerchant Payment Plugin - ccBill payment Plugin
VM2 Product Lock Extension - VM2 Preconfig Adresses Extension - TaxCloud USA Taxes Plugin - Virtuemart  Product Review Component
https://extensions.joomla.org/profile/profile/details/67210
Contact for any VirtueMart or Joomla development & customisation

pinochico

www.minijoomla.org  - new portal for Joomla!, Virtuemart and other extensions
XML Easy Feeder - feeds for FB, GMC,.. from products, categories, orders, users, articles, acymailing subscribers and database table
Virtuemart Email Manager - customs email templates
Import products for Virtuemart - from CSV and XML
Rich Snippets - Google Structured Data
VirtueMart Products Extended - Slider with products, show Others bought, Products by CF ID and others filtering products