Unknownst Posted December 21, 2012 Share Posted December 21, 2012 (edited) Hello, I am working on a shop which requires a custom field to be displayed in the Categories. I want to be able to display the country of origin next to a category. So far I added a new column in the "ps_categories_lang" table. I then added the variable to my category.php: public $origin; Still in category.php I replicated this (approx Lines 113-119) : 'origin' => array('type' => self::TYPE_STRING, 'lang' => true, 'validate' => 'isString'), And it here (approx Line 525): $result = Db::getInstance(_PS_USE_SQL_SLAVE_)->executeS(' SELECT c.*, cl.id_lang, cl.name, cl.description, cl.link_rewrite, cl.meta_title, cl.meta_keywords, cl.meta_description, cl.origin Then, in my AdminCategoryController.php I replicated this (approx lines 57-80): 'origin' => array( 'title' => $this->l('Origin'), 'width' => 'auto' ), And also added the input field here (approx Lines 327- 400): array( 'type' => 'text', 'label' => $this->l('Origin:'), 'name' => 'origin', 'lang' => true, ), I also added the variable to my Front Office and it is showing as expected when I entered a value by hand in phpmyadmin. It is also showing in the correct field in the "edit category page, and in my category listings (I can also sort my categories according to this variable). See the attached images However, I cannot change the value through Prestashop. Any change I make in the field is not saved in the sql table. I'd be happy if somebody could point me in the right direction as I don't want to do this through phpmyadmin at all... Pierre Edited December 21, 2012 by Unknownst (see edit history) Link to comment Share on other sites More sharing options...
jwzumwalt Posted December 22, 2012 Share Posted December 22, 2012 I am not sure if this will help, but someone posted a very short but concise tutor on making a payment module. I bookmarked it and was planning on studying it at a later date. I suspect it will have a clear example of what you are trying to do. http://www.prestashop.com/forums/topic/16632-wiki-guide/ I am interested in accomplishing several things along the lines of what you are trying to do here. If you find the solution, I would appreciate it if you would post the answer here so that we all can learn. Link to comment Share on other sites More sharing options...
Unknownst Posted December 23, 2012 Author Share Posted December 23, 2012 Thanks, I'll take a closer look after Christmas. Will post an answer (positive or negative) Link to comment Share on other sites More sharing options...
Unknownst Posted December 29, 2012 Author Share Posted December 29, 2012 No, sorry, jzumwalt. The link did not contain the right info I was looking for. The way pretsahsop 1.5.2 is build seems quite different. If anyone else has idea on how to upload field info into my database, I'd be more than happy. Thanks Link to comment Share on other sites More sharing options...
jwzumwalt Posted December 30, 2012 Share Posted December 30, 2012 (edited) Thanks for the feedback. Ya, I tried installs of 1.5x 3 times and gave up. There are plenty of reports from developers that 1.5 is a mess. I have decided to stay with 1.4.9 for at least another two years until the mess is sorted out. I had held off doing anything major with 1.4x because PrestaShop advertised that 1.5 would have a good order edit feature. When I took a look at what they did, I was unimpressed and started writing my own routines for 1.4x. Edited December 30, 2012 by jwzumwalt (see edit history) 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