Emily_ Posted July 10, 2020 Share Posted July 10, 2020 Hello, The task sounds like this: If during purchase process we choose PLN - the invoice should be generated with PLN account number (this one which is already on every invoice); If during purchase process we choose EUR - the invoice should be generated with different account number. What's the best way to do this? Code looks like this: <div class="row"> <div class="invoice-col right"> <strong>{$LANG.invoicespayto}</strong> <address class="small-text"> {$payto} {if $taxCode}<br />{$taxIdLabel}: {$taxCode}{/if} </address> </div> I need to modify text contained in variable $payto, but couldn't find where is that generated. Or should I simply modify the invoice template files (viewinvoice.tpl and invoicepdf.tpl) and use conditional statements to show the data required? Thank you in advance. 0 Quote Link to comment Share on other sites More sharing options...
brian! Posted July 13, 2020 Share Posted July 13, 2020 On 10/07/2020 at 14:02, Emily_ said: I need to modify text contained in variable $payto, but couldn't find where is that generated. it's generated by WHMCS and pull from the database - it's the content of the Pay To box in general settings -> general, but you could manipulate the value with a ClientAreaPageViewInvoice hook that checks the client's currency and payment method, and if it's EUR and banktransfer (I assume), then the hook replaces the value of $payto with your modified content. but are you sure that you mean $payto and not $paymentbutton - which usually displays bank transfer account details to the user rather than $payto which is normally a postal address ? On 10/07/2020 at 14:02, Emily_ said: Or should I simply modify the invoice template files (viewinvoice.tpl and invoicepdf.tpl) and use conditional statements to show the data required? it would work in the viewinvoice template too if you're more familiar using Smarty in the template - as you suggest, it's just if statements and deciding the content based on their results. for invoicepdf.tpl, you can't use hooks, so if you needed to modify that template in a similar way, you would write your conditions in PHP rather than Smarty. 0 Quote Link to comment Share on other sites More sharing options...
Emily_ Posted July 14, 2020 Author Share Posted July 14, 2020 Thank you, I've just edited templates and it's working. But which template does this window use? It's shown on viewinvoice.php page and doesn't change when viewinvoice.tpl and invoicepdf.tpl are modified.... Thank you in advance. 0 Quote Link to comment Share on other sites More sharing options...
brian! Posted July 15, 2020 Share Posted July 15, 2020 13 hours ago, Emily_ said: But which template does this window use? oh you're using Lagom? that's a fake sidebar within the viewinvoice.tpl template (~ line 200). 1 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.