Ok i let go of adding a column to the product controller and moved to the AdminOrdersControllers. Here there is a call back functionality on the list_fields and it works like a charm.
For anyone interested here is my code with a little explaination:
<?php
class AdminOrdersController extends AdminOrdersControllerCore
{
public function __construct(){
parent::__construct();
/* override the existing select query */
$this->_select = '
a.id_currency,
a.id_order AS id_pdf,
a.id_order AS id_test, /* Added to have the field name available */
CONCAT(LEFT(c.`firstname`, 1), \'. \', c.`lastname`) AS `customer`,
osl.`name` AS `osname`,
os.`color`,
IF((SELECT COUNT(so.id_order) FROM `'._DB_PREFIX_.'orders` so WHERE so.id_customer = a.id_customer) > 1, 0, 1) as new';
$this->fields_list['id_test'] = array(
'title' => $this->l('test'),
'width' => 35,
'align' => 'center',
'callback' => 'testCallback', /* define callback function to get a value for this field */
'orderby' => false,
'search' => false,
'remove_onclick' => true);
}
public function testCallback($id_test, $tr){
/* Get information from database that you want to be displayed */
$sql = "SELECT state FROM ". _DB_PREFIX_ ."test WHERE order_id = ". $id_test ."";
$row = Db::getInstance()->getRow($sql);
/* Assign some smarty variables */
$this->context->smarty->assign(array(
'test' => $row['variable']
));
/* Because youre overriding an AdminController youre in a rather wierd path so i hard coded my smarty template in a string */
$tpl = '<span style="width:20px; margin-right:5px;">
{if ($test== 1)}
<img src="../img/exact/1.png" alt="success" />
{elseif ($test= 0)}
<img src="../img/exact/2.png" alt="failed" />
{else}
<img src="../img/exact/3.png" alt="todo" />
{/if}
</span>';
/* Fetch the string with the resource prefix string: */
return $this->context->smarty->fetch('string:'. $tpl);
}
}
Good luck with the code if you can use it.