Jump to content

Add an invoice variable that doesn't exist


Recommended Posts


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


$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

Share this post

Link to post
Share on other sites

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

Share this post

Link to post
Share on other sites

the first problem i'd like to solve is to create the new variable. Even if i add the code
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 by Matt (see edit history)

Share this post

Link to post
Share on other sites

  • 2 years later...

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 account

Sign in

Already have an account? Sign in here.

Sign In Now

  • Create New...

Important Information

Cookies ensure the smooth running of our services. Using these, you accept the use of cookies. Learn More