Jump to content

Help with {$invoice_html_contents}


djskunky

Recommended Posts

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

Link to comment
Share on other sites

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

Link to comment
Share on other sites

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 :)

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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!

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use & Guidelines and understand your posts will initially be pre-moderated