Jump to content

Add an invoice variable that doesn't exist


Matt

Recommended Posts

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

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 by Matt (see edit history)
Link to comment
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...