Estoy copiando un codigo que añadia un icono distinto si el cliente era masculino o femenino, aporto la comparación entre ambos códigos a ver si alguien sabe decirme en que voy fallando (la variable "note" es la mia y la de "gender" es de la que voy copiando) :
Código:
$this->_select = '
c.id_gender,
c.`note` AS `note`,
Código del que copio:
Código:
$genders = array();
$genders_icon = array();
$genders_icon[] = array('src' => '../genders/Unknown.jpg', 'alt' => '');
foreach (Gender::getGenders() as $gender)
{
$gender_file = 'genders/'.$gender->id.'.jpg';
if (file_exists(_PS_IMG_DIR_.$gender_file))
$genders_icon[$gender->id] = array('src' => '../'.$gender_file, 'alt' => $gender->name);
else
$genders_icon[$gender->id] = array('src' => '../genders/Unknown.jpg', 'alt' => $gender->name);
$genders[$gender->id] = $gender->name;
}
Código que intento adaptar para añadir mi icono:
Código HTML:
$note_icon[] = array('src' => '../genders/Unknown.jpg', 'title' => 'c.`note`');
$notes[$customer->note] = $customer->note;
Ahora las columnas de las que copio:
Código:
'id_gender' => array(
'title' => $this->l('Title'),
'width' => 70,
'align' => 'center',
'icon' => $genders_icon,
'orderby' => false,
'type' => 'select',
'list' => $genders,
'filter_key' => 'c!id_gender',
),
Y ahora mis columnas adaptadas:
Código:
'note' => array(
'title' => $this->l('Note'),
'icon' => $note_icon,
'width' => 50
),
Por el momento no consigo mostrar el icono en mi variable "note"(c.`note`)
Algun aporte por ahí?
gracias