rassy Posted September 11, 2011 Share Posted September 11, 2011 Hi guys, I would like the extend the Category and Product classes by a new field. Let's say for example: I want to be able to a special "display-color" to each category within the admin-interface. I am sure that I will have to touch the Category class. BUT is there a trick to keep it simple? I would be really really thankful for some guidance! Kind regards Rassy Link to comment Share on other sites More sharing options...
salazar Posted March 22, 2012 Share Posted March 22, 2012 hi guys, I think I have the same problem ; just I would like to add color column to table category using backoffice Link to comment Share on other sites More sharing options...
BRIAN1986 Posted March 22, 2012 Share Posted March 22, 2012 I have same problem too Link to comment Share on other sites More sharing options...
salahmadih Posted March 22, 2012 Share Posted March 22, 2012 I have the same problem width add new field/attribute table category in fact I don't know what can I do to get understand 'prestashop' development if there is any help Link to comment Share on other sites More sharing options...
salazar Posted March 22, 2012 Share Posted March 22, 2012 hi guys, the solution for add new field in table category or more exactyle in table category_lang 1)- add new attribute in class category.php 2) a- in the same class add newField to (protected $fieldsRequired if that field is obligatoire) c- "" "" "" protected $fieldsRequiredLang d- "" "" "" protected $fieldsSizeLang e- "" "" "" protected $fieldsValidateLang f- "" "" "" function getTranslationsFieldsChild g- "" "" "" function getSubCategories h- "" "" "" function getTranslationsFieldsChild 3) in admin/tabs /AdminCategories.php <label>'.$this->l('newField').' </label> <div class="margin-form translatable">'; foreach ($this->_languages AS $language) echo ' <div class="lang_'.$language['id_lang'].'" style="display: '.($language['id_lang'] == $this->_defaultFormLanguage ? 'block' : 'none').'; float: left;"> <input type="text" name="newField_'.$language['id_lang'].'" id="newField_'.$language['id_lang'].'" value="'.htmlentities($this->getFieldValue($obj, 'newField', (int)($language['id_lang'])), ENT_COMPAT, 'UTF-8').'" /> <span class="hint" name="help_box">'.$this->l('Forbidden characters:').' <>;=#{}<span class="hint-pointer"> </span></span> </div>'; echo ' <p class="clear"></p> </div> 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