Hi People,
This is an alternative for replace textarea for HTML editor,
NOTE: in prestashop 1.6 I have to add the column desc to the ps_attribute_lang table
CREATE TABLE `ps_attribute_lang` (
`id_attribute` int(10) unsigned NOT NULL,
`id_lang` int(10) unsigned NOT NULL,
`name` varchar(128) NOT NULL,
`desc` longtext NOT NULL,
PRIMARY KEY (`id_attribute`,`id_lang`),
KEY `id_lang` (`id_lang`,`name`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
Forn declaration:
this:
array(
'type' => 'text',
'label' => 'extra description',
'name' => 'desc',
'lang' => true,
'size' => 128,
'desc' => 'show me!!!',
'hint' => $this->l('Invalid characters:').' <>;=#{}'
)
to:
array(
'type' => 'textarea',
'label' => $this->l('Description:'),
'name' => 'desc',
'lang' => true,
'cols' => 60,
'rows' => 20,
'class' => 'rte',
'autoload_rte' => true,
'hint' => $this->l('Invalid characters:').' <>;=#{}',
),
In file Atribute.php rewrite, self::TYPE_HTML is very important
this:
'desc' => array('type' => self::TYPE_STRING, 'lang' => true, 'validate' => 'isGenericName', 'required' => true, 'size' => 256),
to:
'desc' => array('type' => self::TYPE_HTML, 'lang' => true, 'validate' => 'isCleanHtml', 'size' => 4000),
Happy Coding!!!!