djskunky Posted February 24, 2015 Share Posted February 24, 2015 On the Invoice email for a customer I need to customize the Tax Field. The customer receive something like this: Sub Total: $90.00 USD 8.20% Tax: $7.38 USD >> I Need to modify that line Credit: $0.00 USD Total: $97.38 USD I know , the invoice email template call {$invoice_html_contents} , but I don't know where to find that in order to customize that particular line. I will need your help Thanks in advance 0 Quote Link to comment Share on other sites More sharing options...
Kian Posted February 24, 2015 Share Posted February 24, 2015 You have to use EmailPreSend hook. 0 Quote Link to comment Share on other sites More sharing options...
djskunky Posted February 24, 2015 Author Share Posted February 24, 2015 Kian, thanks for your reply, but that does not work for me, I just want to rename this words on the Email is sent to the customer Rename "8.20% Tax" for "Service fee" Thant's it If you can tell me where on what file I can locate that value , I will really appreciate . Thanks 0 Quote Link to comment Share on other sites More sharing options...
Kian Posted February 25, 2015 Share Posted February 25, 2015 Something like this: <?php function InvoiceHTMLContentsFix($vars) { if($vars["messagename"]=="Order Confirmation") # Change this with your Email Template { $output = array(); $output['invoice_html_contents'] = "I'm so damned beautiful!"; $output['a_new_variable'] = "This email will self destruct in 5 seconds"; return $output; } } add_hook("EmailPreSend",1,"InvoiceHTMLContentsFix"); ?> Now {$invoice_html_contents} contains "I'm so damned beautiful!" and there's also a new variable available in the defined email template {$a_new_variable}. Just play with it to match your specific needs 0 Quote Link to comment Share on other sites More sharing options...
sentq Posted February 25, 2015 Share Posted February 25, 2015 in the email template you need to apply the changes to, replace {$invoice_html_contents} with the following {$invoice_html_contents|replace:'Tax:':'Service Fee:'} 0 Quote Link to comment Share on other sites More sharing options...
brian! Posted February 25, 2015 Share Posted February 25, 2015 for what its worth, i'd have suggested sentq's solution too - it would be the easiest for a new user to follow. 0 Quote Link to comment Share on other sites More sharing options...
Kian Posted February 25, 2015 Share Posted February 25, 2015 I can't remember if {$invoice_html_contents} has multi-language parts. If it's not multi-language you can use replace on the contrary you have to use the hook point or tens of multiple replaces. 0 Quote Link to comment Share on other sites More sharing options...
brian! Posted February 25, 2015 Share Posted February 25, 2015 hmm, I would imagine that "Sub Total", "Credit" etc are being pulled from the language files... but i'm unsure about "Tax" - perhaps it's being pulled from the tax db table - tweaking the db entry would probably show you one way or the other. anyway, a standard replace should change "Tax" - with perhaps an additional regex replace if he needs to replace the taxrate as well. 0 Quote Link to comment Share on other sites More sharing options...
sentq Posted February 25, 2015 Share Posted February 25, 2015 as far as i remember "Tax" was a fixed word inside invoice PHP files 0 Quote Link to comment Share on other sites More sharing options...
djskunky Posted February 25, 2015 Author Share Posted February 25, 2015 in the email template you need to apply the changes to, replace {$invoice_html_contents} with the following{$invoice_html_contents|replace:'Tax:':'Service Fee:'} Thank you all for your help emails, You guys rocks ! but I found sentq method much easier ! I finally accomplish what I need. Once again, thanks for your help! 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.