Showing A Extra Value In Invoice.tpl

I have made an addon that builds an extra field for product. I want to show this value in the invoice. I get the value from this column and add to order_info





order.pre.php

<br />
if ($mode == 'print_invoice') {<br />
<br />
$order_info = fn_get_order_info($_REQUEST['order_id']);<br />
<br />
$products = $order_info['products'];<br />
<br />
foreach ($products as $k => $v) {<br />
<br />
$fatura_basligi = db_get_field("SELECT ?:products.fatura_basligi FROM ?:products ".<br />
"LEFT JOIN ?:order_details ON ?:order_details.product_id = ?:products.product_id ".<br />
"WHERE ?:order_details.product_id = ?i AND ?:order_details.order_id = ?i", $v['product_id'], $v['order_id']);<br />
<br />
if (!empty($fatura_basligi)) {<br />
$products[$k]['fatura_basligi'] = $fatura_basligi;<br />
}<br />
Registry::get('view')->assign('products', $products);<br />
<br />
<br />
}<br />
<br />
}<br />
<br />

```<br />
<br />
invoice.tpl<br />
```php
<br />
{foreach from=$order_info.products item="oi"}<br />
			{$oi.fatura_basligi}<br />
			{/if}<br />

```<br />
<br />
$products[$k]['fatura_basligi']  is not empty. I can see it in orders.pre.php and get but can not pass the   value in invoice.tpl. Nothing appears. Where am I making mistake? <img src="upload://n4syhXZrRhsStKvmS4jT3Mp2S3k.png" class="bbc_emoticon" alt=":(">

You do not override the order_info variable. Try this code in the template:



{foreach from=$products item="oi"}
{$oi.fatura_basligi}
{/foreach}

Hello eCom. Thank you.

Please try:



if ($mode == 'bulk_print' ) {
$order_ids = $_REQUEST['order_ids'];
$products = array();
foreach ($order_ids as $order) {
$order_info = fn_get_order_info($order);
$_products = $order_info['products'];
foreach ($_products as $k => $v) {
$fatura_basligi = db_get_field("SELECT ?:products.fatura_basligi FROM ?:products ".
"LEFT JOIN ?:order_details ON ?:order_details.product_id = ?:products.product_id ".
"WHERE ?:order_details.product_id = ?i AND ?:order_details.order_id = ?i", $v['product_id'], $v['order_id']);

$products[$order][$k] = $v;
if (!empty($fatura_basligi)) {
$products[$order][$k]['fatura_basligi'] = $fatura_basligi;
}
}//foreach
}//foreach
Registry::get('view')->assign('products', $products);
}

how can i past similar data to html templates? html templates doesnt accept smarty ?

how can i past similar data to html templates? html templates doesnt accept smarty ?

What do you mean by html templates? Please clarify