Author Topic: Order Confirmation Email Template  (Read 10767 times)

EIF

  • Jr. Member
  • **
  • Posts: 77
Re: Order Confirmation Email Template
« Reply #15 on: March 03, 2017, 09:06:38 am »
Ok, I will check that site.

I used to have an extension for the e-mails. I found in that code something about setting the date format.

Code: [Select]
    private function userFormattedDate($timestamp, $timezone) {
    $dateFormat = emp_helper::getGlobalParam('date_format');
   
    $date = new JDate();
   
    if(!function_exists('date_timestamp_set')){
    $tmpdate = getdate( ( int ) $timestamp );
    $date->setDate( $tmpdate['year'] , $tmpdate['mon'] , $tmpdate['mday'] );
    $date->setTime( $tmpdate['hours'] , $tmpdate['minutes'] , $tmpdate['seconds'] );
    }
    else{
    $date->setTimestamp($timestamp);
    }
    $date->setTimezone(new DateTimeZone($timezone));
   
    $ret = $date->format($dateFormat, true);
   
    return $ret;
    }
   
private function userFormattedDateLocale($timestamp, $timezone, $locale = null) {
if (!is_null($locale)){
$curLocale = setlocale(LC_CTYPE, 0);
setlocale(LC_CTYPE, $locale);
setlocale(LC_TIME, $locale);
}

$dateFormat = emp_helper::getGlobalParam('date_format_locale');

$defTZ = date_default_timezone_get();
date_default_timezone_set($timezone);
$date = strftime($dateFormat, $timestamp);
date_default_timezone_set($defTZ);

if ($date === false){
$dateFormat = "%b %d, %Y";
$date = strftime($dateFormat); //March 10, 2011
}

if(!is_null($locale)){
setlocale(LC_CTYPE, $curLocale);
setlocale(LC_TIME, $curLocale);
}

return $date;
}
}

Studio 42

  • Contributing Developer
  • Sr. Member
  • *
  • Posts: 3978
  • Joomla & Virtuemart developper
    • Studio 42 - Virtuemart & Joomla extentions
  • VirtueMart Version: 2.6 & 3
Re: Order Confirmation Email Template
« Reply #16 on: March 03, 2017, 12:19:57 pm »
If you use Joomla, the timezone is set by user(in your case too), but this is not the right timeZone when you send yourself the mail or if user is not connected.
So i think timezone should be manually set or it's better to use UTC time zone.
You can use
Code: [Select]
$format = JText::_('DATE_FORMAT_LC4'); // or DATE_FORMAT_LC3
$date = JFactory::getDate($mydate, 'UTC');
echo $date->toFormat($format);

mausci1969

  • Beginner
  • *
  • Posts: 23
  • Skype Name: mausci69
Re: Order Confirmation Email Template
« Reply #17 on: March 04, 2017, 11:19:21 am »
So no other ideas in about how to change my confirmation email columns?

AH

  • Global Moderator
  • Sr. Member
  • *
  • Posts: 2943
  • VirtueMart Version: 3.6.0
Re: Order Confirmation Email Template
« Reply #18 on: March 04, 2017, 11:40:57 am »
mausci1969

There are not really any "other ideas"  - you need to change the templates for the files that are used in email confirmation.

Studio42 has given you some input to this in the previous posts.

If you cannot see how to do this then you may need to engage a developer.
regards
A

Joomla 3.9.8
php 7.1

EIF

  • Jr. Member
  • **
  • Posts: 77
Re: Order Confirmation Email Template
« Reply #19 on: April 20, 2018, 16:37:53 pm »
Looks like in virtuemart 3.2.14 the layout of the e-mail has been changed.

I put back my own code in thes mail_html files. Also in invoice_items.php. But still the table of the items (sku, name, price, etc) is the standaard of virtuemart. Somehow my own code has not beed used.
Where is this new virtuemart code of the invoice items now, which I need to edit? The rest of the e-mail displays my own layout, except the table of the invoice items.


Edit: found it! Looks like mail_html_pricelist.php is used now, not only invoice_items.php.

bryanearl

  • Beginner
  • *
  • Posts: 44
  • Web Design and SEO / SMO
    • Bryan Earl Web Design
Re: Order Confirmation Email Template
« Reply #20 on: May 17, 2018, 20:56:46 pm »
I have used this method to show the product image on my invoices, and I have it working properly.

It took me forever searching for a way to specify the image size displayed on the invoice, so I wanted to share the trick because making a DIV around the image php code and specifying width and height there has no effect.

You need to add "$width=X,$height=X" to the php code displaying the image:

Code: [Select]
<?php if (!empty($item->images[0])) { echo $item->images[0]->displayMediaThumb ('',FALSE,""truefalsetrue,$width=50,$height=50); ?>

Robert_ITMan

  • Jr. Member
  • **
  • Posts: 117
    • websites developed and managed @ ourfingertips.com
  • VirtueMart Version: 3.2.12 and 3.2.15
[SOLVED] Re: Order Confirmation Email Template
« Reply #21 on: September 01, 2019, 14:03:30 pm »
Edit: found it! Looks like mail_html_pricelist.php is used now, not only invoice_items.php.
THANKS EIF!
I might never have figured this out without your note!
www.ourfingertips.com - websites developed and managed @ ourfingertips

Let me help you make the most of the technology at our fingertips

GJC Web Design

  • 3rd party VirtueMart Developer
  • Super Hero
  • *
  • Posts: 9037
  • Virtuemart, Joomla & php developer
    • GJC Web Design
  • VirtueMart Version: 3.4.2
Re: Order Confirmation Email Template
« Reply #22 on: September 01, 2019, 16:17:33 pm »
why are u people not using template over rides?
GJC Web Design
VirtueMart and Joomla Developers - php developers http://www.gjcwebdesign.com
VM3 AusPost Shipping Plugin - e-go Shipping Plugin - VM3 Postcode Shipping Plugin - Radius Shipping Plugin - VM3 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
http://extensions.joomla.org/profile/profile/details/67210
Contact for any VirtueMart or Joomla development & customisation

Robert_ITMan

  • Jr. Member
  • **
  • Posts: 117
    • websites developed and managed @ ourfingertips.com
  • VirtueMart Version: 3.2.12 and 3.2.15
Re: Order Confirmation Email Template
« Reply #23 on: September 01, 2019, 17:30:22 pm »
why are u people not using template over rides?
GJC,

We are using our template over rides - the issue here is that if you only have the one over ride file invoice_items.php it does not work for us you also need to add the file mail_html_pricelist.php (unedited) as having only the file invoice_items.php is not enough to get our own template file to be used -- a bug since 3.2.12?
www.ourfingertips.com - websites developed and managed @ ourfingertips

Let me help you make the most of the technology at our fingertips

StefanSTS

  • Global Moderator
  • Jr. Member
  • *
  • Posts: 417
  • VirtueMart Version: VM 4.2 on Joomla 4.5
Re: Order Confirmation Email Template
« Reply #24 on: September 02, 2019, 12:20:20 pm »
There is no bug,
earlier one file was called by the other, so both price list tables were the same.

For good reason, to have different tables for mail and invoice, this has been changed. So finally you can easily leave out columns or rows in your invoice that you show in your mail.
The status column is one of the examples. Many shop owners want to show the status of single products in the email, but the invoice is delivered without the status.

Regards
Stefan
--
Stefan Schumacher
www.jooglies.com - VirtueMart Invoice Layouts

Please use only stable versions with even numbers for your life shop! Use Alpha versions only if you know what risk you are taking.