bigbaboon Posted February 7, 2013 Share Posted February 7, 2013 Hi. My problem: I need to make an employee list in admin\themes\default\template\controllers\products\informations.tpl: So i pasted code in: \override\classes\Product.php <?php class Product extends ProductCore { public static function getEmployees() { return Db::getInstance()->executeS(' SELECT `id_employee`, `firstname`, `lastname` FROM `'._DB_PREFIX_.'employee` WHERE `active` = 1 ORDER BY `lastname` ASC '); } } ?> && admin\themes\default\template\controllers\products\informations.tpl : <select name="id_employee_forward" style="vertical-align: middle;"> <option value="-1">{l s='-- Choose --'}</option> {foreach $employees as $employee} <option value="{$employee.id_employee}"> {Tools::substr($employee.firstname, 0, 1)}. {$employee.lastname}</option> {/foreach} <option value="0">{l s='Someone else'}</option> </select> It is not working I presume that i need to induce this code somewhere. $employees = Product::getEmployees(); But hell will freeze before i figure it out by myself. So there it is. Quest 4 the best. Please help me ! Link to comment Share on other sites More sharing options...
bigbaboon Posted February 13, 2013 Author Share Posted February 13, 2013 /controllers/admin/AdminProductsController.php in renderForm() add this $this->context->smarty->assign("employees", Product::getEmployees()); Link to comment Share on other sites More sharing options...
Recommended Posts