E-mail template - dynamic variable - currency delete

Hello,

I am generating pay by square img in e-mail template using dynamic variables but i need to delete EUR currency from variable {{{invoice_total}}} , otherwise it wont generate the image, could you please help me how to solve it?

Thanks

Maybe <?php echo ($invoice->invoice_balance) ?> will help you here.

Tried that, but that doesnt work :frowning:
I cant use PHP there probably…
I thought maybe creating new variable without currency but I dont know where…

There’s three problems:

  • You have a dynamic variable, invoice_total with a bunch of curly brackets
  • how do these variables get transferred to your template (and turned into the dynamic variables
  • replace EUR with nothing in that invoice_total dynamic variable

First figure out question 2, maybe there’s a class somewhere that does that for you.

Do you know where I can find invoice_total variable? I tried to find it but I couldnt, also Im not a PHP expert…
Thanks

I am trying to do this:

https://api.qrgenerator.sk/by-square/pay/qr.png?iban{{{user_iban}}}&amount={{{invoice_total}}}&currency=EUR&vs={{{invoice_number}}}&size=128&transparent=false

and I get error:

“errors”:{“amount”:[“The value ‘{{{invoice_total}}}’ is not valid.”]}}

because the value has EUR currency

EDIT:
<img src="https://api.QRGenerator.sk/by-square/pay/qr.png?iban=<?php echo ($invoice->user_iban) ?>&amount=<?php echo ($invoice->invoice_balance) ?>&currency=EUR&vs=<?php echo ($invoice->invoice_number) ?>&size=128&transparent=false" alt="QR kod" />

I did it like this in application\modules\mailer\views\invoice.php and it works :smiley:

This is a nice tweak you made, want to share all that needs to be done to enable this function? Thanks in advance! :grin:

1 Like

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.