Yegor Posted January 20, 2018 Share Posted January 20, 2018 Hi dear. I am processing create an own prestashop 1.7 module. I want to add one new custom field at Add New Attribute page with module. Without changes at core files. Can you help me please. I can't find needed hook for adding my field. Screenshot with add attribute page and field that I want to add http://prntscr.com/i39x3r. Thank you. Link to comment Share on other sites More sharing options...
Yegor Posted January 21, 2018 Author Share Posted January 21, 2018 (edited) Hi friends. I was successfully added needed field to database with my module. //If column 'attribute_group.attribute_description' does not exist, create it Db::getInstance(_PS_USE_SQL_SLAVE_)->query('SHOW COLUMNS FROM `'._DB_PREFIX_.'attribute_group` LIKE "attribute_description"'); if (Db::getInstance()->NumRows() == 0) { Db::getInstance()->execute('ALTER TABLE `'._DB_PREFIX_.'attribute_group` ADD `attribute_description` TEXT NOT NULL DEFAULT ""'); } Can you help me to show my field with 'displayAttributeGroupForm' hook at my module? Or maybe I need to use override AdminAttributesGroupsController.php way? Thank you. Yegor. Edited January 21, 2018 by Yegor (see edit history) Link to comment Share on other sites More sharing options...
Yegor Posted January 21, 2018 Author Share Posted January 21, 2018 Looks like I can print needed field with this method but I am not sure yet that it is the best way public function hookDisplayAttributeGroupForm($params) { //code } Link to comment Share on other sites More sharing options...
Yegor Posted January 22, 2018 Author Share Posted January 22, 2018 Or best way it is override controller? Link to comment Share on other sites More sharing options...
Yegor Posted January 25, 2018 Author Share Posted January 25, 2018 Was created needed module with override admin controller and attribute class. 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