0
我的问题: 我需要在员工informations.tpl的Prestashop
管理\主题雇员名单\ DEFAULT \模板\控制器\产品\ informations.tpl:
http://darkplace.pl/wp-content/uploads/2013/02/1111111111.png
所以我在粘贴代码:
\覆盖\类\ P roduct.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
');
}
}
?>
& &
管理\主题\默认\模板\控制器\产品\ 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>
它不工作 我认为我需要在某处引入此代码。
$employees = Product::getEmployees();
但是在我自己弄明白之前,地狱会冻结。所以它就是这样。任务4最好。 请帮帮我!
谢谢各位高手programator。它像一个魅力。你很棒哦! – user2049994