Jump to content

modify email template variables


Sybille

Recommended Posts

Hi,

 

Is there a chance to manipulate the variables from the email templates for e. g. the variables {$invoice_html_contents} / {$order_details}.

 

I would like to change the part "total price" in the variable {$order_details}. The variable shows the products and their prices WITHOUT VAT and at the end the total price of all products WITH VAT.

 

If you calculate the product prices your surprised because it’s not congruent with the total price written in the email – it’s because of the different handling of the prices incl. / excl. VAT.

 

There for I would prefer a statement of the prices / a price summary like it is shown in the variable {$invoice_html_contents}, instead of only writing “total price $ xxx”

 

Extract from {$invoice_html_contents}

************************

Sub totalCHF 124.25

VAT 8.00%: CHF 9.94

Credit / deposit: CHF 0.00

Total: CHF 134.19

************************

 

Does someone know where or how I can change this part of the {$order_details} variable?

 

Many thanks for your ideas.

Sybille

Link to comment
Share on other sites

Hi Sybille,

 

the email templates use Smarty, therefore the variables can be manipulated using Smarty. :idea:

 

however, it sounds like you're trying/wanting to use a variable from one email template type (invoice) in a general email - that's unlikely to work.

you won't have the option of using {$invoice_html_contents} - and because it's not an invoice email, I doubt you'll even have access to the individual parts such as subtotals, vat, credit as separate variables etc.

 

if you really want to do this, then you'll need to use an action hook, EmailPreSend, to query the database and pass the variables to the template.

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