Hi All,
I am looking to modify the due by date in email templates ($invoice_date_due). I want to subtract 1 day.
I have tried doing this with php, however it doesn't look like you can put php into the email templates. (I just get a white screen (Even if i just put {php}{/php}))
Bear in mind I don't want to update the due date of an invoice just chnage that date for use inside the email template.
This is the code I have tried:
{php}
$ccdate = DateTime::createFromFormat('d/m/Y', $this->_tpl_vars["invoice_date_due"]);
$ccdate->modify("plus 1 day");
$this->_tpl_vars["cc_date_due"] = $ccdate->format('d/m/Y');
{/php}
Does anyone have any ideas?
Thanks,
Adam
*More info: I need to be able to remove one day from the due date as we attempt to cature credit cards 1 day before due date. This is the line that would change:
Payment will be taken automatically on {$invoice_date_due} from your credit card on record with us.
So invoice due date might be 13/03/2015 and credit card charge date will be 12/03/2015