DiegoM Posted January 25, 2017 Share Posted January 25, 2017 (edited) Hey guys! I'd like to change my invoice text in {$invoice_html_contents}, where "(10/01/2017 - 09/02/2017)" to "january" or "jan/2017". To be more specific, I want that in portuguese. January = Janeiro February = Fevereiro March = Março April = Abril May = Maio June = Junho July = Julho August = Agosto October = Outubro November = Novembro December = Dezembro Maybe can use invoice_date_due to calculate and obtain the month name too. But I don't know how to do it in WHMCS. Can anyone give me some tips how to do it? Thanks in advance! Edited January 25, 2017 by DiegoM 0 Quote Link to comment Share on other sites More sharing options...
DiegoM Posted January 25, 2017 Author Share Posted January 25, 2017 Maybe can use invoice_date_due to calculate and obtain the month name too. But I don't know how to do it in WHMCS. 0 Quote Link to comment Share on other sites More sharing options...
brian! Posted January 25, 2017 Share Posted January 25, 2017 off the top of my head, I can think of two ways to do this... 1. if you were wanting to do this purely in the email template, then as they use Smarty, you'd need to replace the dates with your Portuguese month name... that may be using regex and/or PHP functions to strip/replace the unwanted text... though the added complication of trying to do that in an email template in v7 is that you'd have to tweak your Smarty Security Policy settings to allow you to use any required PHP function. if going down this road, it would probably easier to use/edit the output of the {$invoice_items} looped array rather than {$invoice_html_contents}. 2. the other way would be to use an action hook to alter the invoice line description - this would have the knock-on effect on changing it on the html and PDF invoices too (you may or may not want that). either method would require a lengthy explanation of how to do, so you should probably post in Service Offers & Requests and pay a developer to write a custom solution for you. 0 Quote Link to comment Share on other sites More sharing options...
DiegoM Posted January 25, 2017 Author Share Posted January 25, 2017 Hey Brian! Thanks for your answer! I think it's easier to remove this period of date from my {$invoice_html_contents} in invoice template. Today my template is showing: SERVICE (10/01/2017 - 09/02/2017) R$23,23 ------------------------------------------------------ Sub Total: R$23,23 Credit: R$0,00 Total: R$23,23 ------------------------------------------------------ How can I remove the underlined text? If I remove it and someone has more than one service, will it show everything together? 0 Quote Link to comment Share on other sites More sharing options...
brian! Posted January 26, 2017 Share Posted January 26, 2017 if you just want to remove those dates from the invoice (much simpler!), you should just be able to use the following in the email template... {$invoice_html_contents|regex_replace:'%[\t ()/0-9-]{26}%':''} if you're using v7+, you'll need to add 'regex_replace' to your Smarty Security Policy to make this work - if using v6, you won't have to. 0 Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.