Matt Posted September 28, 2018 Share Posted September 28, 2018 Hi, I'd like to add the transaction id right after the payment method in the invoice. to retrieve the data, i think i have to do something like that: $sqltrans = 'SELECT `transaction_id` FROM `'._DB_PREFIX_.'ps_order_payment` WHERE `order_reference` = '.$order_reference; $transact = Db::getInstance()->executeS($sqltrans); where $order_reference contains, of course, the reference of the order. Now, the problems are: 1 - where and how can I have access to the order reference in the HTMLTemplateInvoice.php file? 2 - where and how can I create a smarty variable to store the $transact value so I can use it in the tpl file? thanx in advance, hope someone can help me Link to comment Share on other sites More sharing options...
tdsoft Posted September 28, 2018 Share Posted September 28, 2018 Hi 1 - you can override class the HTMLTemplateInvoice.php file read: https://devdocs.prestashop.com/1.7/modules/concepts/overrides/ 2- you can find all TPL file for invoice in dir: ROOT/pdf Link to comment Share on other sites More sharing options...
Matt Posted September 28, 2018 Author Share Posted September 28, 2018 thanx! But i still don't know how to retrieve the order reference... I use a module for the invoice so the tpl is not a problem, the problem is to create the variable thai is not already in the module variables list Link to comment Share on other sites More sharing options...
Knowband Plugins Posted September 28, 2018 Share Posted September 28, 2018 Do you have order ID on this page? If yes then we can find order reference using the order id. Link to comment Share on other sites More sharing options...
Matt Posted October 1, 2018 Author Share Posted October 1, 2018 (edited) the first problem i'd like to solve is to create the new variable. Even if i add the code $smarty->assign('transact','hello'); or $smarty->assign('transact',$transact'); where $transact is a string ('hello') the pdf doesn't show anything if i add {$transact} in the template... Edited October 1, 2018 by Matt (see edit history) Link to comment Share on other sites More sharing options...
zion Posted November 3, 2020 Share Posted November 3, 2020 The correct way to display module variables in an invoice, is to receive the variables in "HTMLTemplateInvoice.php" as smarty? some example? Thank you Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now