Olivier CLEMENCE Posted September 4, 2014 Share Posted September 4, 2014 Un petit tuto qui peut intéresser tous ceux qui sont encore en version 1.4: http://blog.manit4c.com/2014/09/04/ajouter-un-champ-texte-supplementaire-dans-vos-categories-sous-prestashop-1-4/ Link to comment Share on other sites More sharing options...
zombie process Posted September 6, 2014 Share Posted September 6, 2014 (edited) Un petit tuto qui peut intéresser tous ceux qui sont encore en version 1.4: http://blog.manit4c.com/2014/09/04/ajouter-un-champ-texte-supplementaire-dans-vos-categories-sous-prestashop-1-4/ Il faut simplement changer ses propriétés c'est-à-dire $fieldsSizeLang et $fieldsValidateLang, et d'y ajouter la nouvelle propriété et surcharger les méthodes getFields et getTranslationsFieldsChild. class Category extends CategoryCore { public $my_new_field; protected $fieldsSizeLang = array( 'name' => 64, 'link_rewrite' => 64, 'meta_title' => 128, 'meta_description' => 255, 'meta_keywords' => 255, 'my_new_field' => 255 ); protected $fieldsValidateLang = array( 'name' => 'isCatalogName', 'link_rewrite' => 'isLinkRewrite', 'description' => 'isCleanHtml', 'meta_title' => 'isGenericName', 'meta_description' => 'isGenericName', 'meta_keywords' => 'isGenericName', 'my_new_field' => 'isString' ); public function getFields() { $fields = parent::getFields(); $fields['my_new_field'] = pSQL($this->my_new_field); return $fields; } public function getTranslationsFieldsChild() { parent::validateFieldsLang(); return ObjectModel::getTranslationsFields(array('name', 'description', 'link_rewrite', 'meta_title', 'meta_keywords', 'meta_description', 'my_new_field')); } } Edited September 7, 2014 by zombie process (see edit history) Link to comment Share on other sites More sharing options...
Olivier CLEMENCE Posted September 8, 2014 Author Share Posted September 8, 2014 Bonjour Zombie, merci pour ton code j'ai pas préocédé ainsi mais j'essaierai t'a méthode qui semble un peu plus rapide que la mienne. Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now