Change the date format in message from gift cards module in PrestaShop

im user of your briliant module to send gift cards.

I try to change the date format in Gift Certificate emails from: 2017-07-12 12:34:02 to 12-07-2017 12:34:02.
So, in main module file: giftcertificate.php line 1313 I changed: 
$templateVars['{voucher_date_from}'] = $cartRule->date_from; 
$templateVars['{voucher_date_from}'] = date('d-m-Y H:i:s', strtotime($cartRule->date_from)) 
But nothing happen on the email template, the date is in the same format.
Thank you

Modification of date format - where to change?

there are two types of messages that module sends.
First - for customer that bought the gift card. In this case modification you apply to the file you modified. Your code works well, the date format will be like on example below (underlined)
Voucher will be available from: 12-07-2017 01:43:37
Voucher expiry date: 2017-07-17 01:43:37

Second email is send "to friend" and file that handles the process is located here: /modules/giftcertificate/controllers/front/gifts.php
there is a code:
$templateVars['{voucher_date_from}'] = $cartRule->date_from;

change it to code you applied also to main module file.
$templateVars['{voucher_date_from}'] = date('d-m-Y H:i:s', strtotime($cartRule->date_from));
Share on Google Plus


This is a short description in the author block about the author. You edit it by entering text in the "Biographical Info" field in the user admin panel.
    Blogger Comment


Post a Comment