irdeto12 Posted June 8, 2011 Share Posted June 8, 2011 Hey Guys,I want to send an email to my customers after payment. Only problem is, I need to note the price in 'cents'So lets say Customer A has an order for 98 Euros.Normally you can use this in an email template: {total_paid} and it will say 98 euros.But now I have to descrive the amount as 9800 cents. Any Ideas on how to do it? Since you can't make calculations in HTML I don't think its possible to use something like {total_paid}*100So I think the solution is to make a new function that is posted when order is finished. After an order a new value will be stored, for example {total_paid_cent}.Any help on how to do this? Link to comment Share on other sites More sharing options...
shokinro Posted June 8, 2011 Share Posted June 8, 2011 I think you can add new variable in the email template, like total_in_cents.but you have to assign this variable the related PHP file that send the email.For example, for order confirmation email, you need to change /classes/PaymentModule.php, ValidateOrder() function.add new variable as followingAfter line '{total_paid}' => Tools::displayPrice($order->total_paid, $currency, false, false), add following line '{total_paid_in_cents}' => 100*Tools::displayPrice($order->total_paid, $currency, false, false), then, in your mail template, use the new variable{total_paid_in_cents} Link to comment Share on other sites More sharing options...
irdeto12 Posted June 9, 2011 Author Share Posted June 9, 2011 Thank you very much.I will try itUPDATE:I can't get it to work. The amount stays empty Link to comment Share on other sites More sharing options...
irdeto12 Posted June 13, 2011 Author Share Posted June 13, 2011 any ideas how to implement it? Link to comment Share on other sites More sharing options...
shokinro Posted June 13, 2011 Share Posted June 13, 2011 if you did it correctly, if should work,please make sure you have change the write mail templates.for standard mail templates, it locates in YourSiteRoot/mails/for mail templates for mail allert module it locates in its module folderYourSiteRoot/modules/mailalerts/mails/ Link to comment Share on other sites More sharing options...
Recommended Posts