News:

You may pay someone to create your store, or you visit our seminar and become a professional yourself with the silver certification

Main Menu

Order Confirmation Email Template

Started by mausci1969, February 26, 2017, 11:52:13 AM

Previous topic - Next topic

EIF

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.

    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

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
$format = JText::_('DATE_FORMAT_LC4'); // or DATE_FORMAT_LC3
$date = JFactory::getDate($mydate, 'UTC');
echo $date->toFormat($format);

mausci1969

So no other ideas in about how to change my confirmation email columns?

AH

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 4.4.5
php 8.1

EIF

#19
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

#20
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:

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

Robert_ITMan

Quote from: EIF on April 20, 2018, 16:37:53 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!
WEBSITES @ OURFINGERTIPS
manage > develop > market > repeat

Save a lot of time and money when focused on building a website that works with marketing efforts to get more leads and sales from visitors.

www.ourfingertips.com

GJC Web Design

why are u people not using template over rides?
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

Robert_ITMan

Quote from: GJC Web Design on September 01, 2019, 16:17:33 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?
WEBSITES @ OURFINGERTIPS
manage > develop > market > repeat

Save a lot of time and money when focused on building a website that works with marketing efforts to get more leads and sales from visitors.

www.ourfingertips.com

StefanSTS

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 live shop! Use Alpha versions only if you know what risk you are taking.