Andrei Dinca Posted February 27, 2018 Share Posted February 27, 2018 Hi, I need to modify the "fields_value" from products edit page. How can I use: action<AdminControllerName>FormModifier on my custom module for doing this? I've tried to use the hook like: "actionAdminProductsFormModifier" or "actionProductControllerFormModifier" but with no luck. Any help? Thanks. Link to comment Share on other sites More sharing options...
Florian Posted February 27, 2018 Share Posted February 27, 2018 (edited) You have to check those hooks exists in the database first, because it's not always the case. Perosnnally I had to run this PHP code (just once): $db = Db::getInstance(); $sqls = [ 'insert into '.$db->getPrefix().'hook (name, title, position, description) values ("actionAdminProductsListingFieldsModifier", "actionAdminProductsListingFieldsModifier", 1, "")', // ajout hook category 'insert into '.$db->getPrefix().'hook (name, title, position, description) values ("actionAdminCustomersControllerSaveAfter", "actionAdminCustomersControllerSaveAfter", 1, "")', // ajout hook customers 'insert into '.$db->getPrefix().'hook (name, title, position, description) values ("actionAdminCategoriesFormModifier", "actionAdminCategoriesFormModifier", 1, "")', // ajout hook category BO 'insert into '.$db->getPrefix().'hook (name, title, position, description) values ("actionAdminCategoriesControllerSaveAfter", "actionAdminCategoriesControllerSaveAfter", 1, "")', // ajout hook category BO ]; foreach ($sqls as $sql) { $res = $db->execute($sql); if(!$res){ throw new \Exception("Error Processing SQL $sql", 1); } } Edited February 27, 2018 by Florian (see edit history) Link to comment Share on other sites More sharing options...
Absolem8 Posted May 1, 2020 Share Posted May 1, 2020 On 2/27/2018 at 5:24 PM, Florian said: You have to check those hooks exists in the database first, because it's not always the case. Perosnnally I had to run this PHP code (just once): $db = Db::getInstance(); $sqls = [ 'insert into '.$db->getPrefix().'hook (name, title, position, description) values ("actionAdminProductsListingFieldsModifier", "actionAdminProductsListingFieldsModifier", 1, "")', // ajout hook category 'insert into '.$db->getPrefix().'hook (name, title, position, description) values ("actionAdminCustomersControllerSaveAfter", "actionAdminCustomersControllerSaveAfter", 1, "")', // ajout hook customers 'insert into '.$db->getPrefix().'hook (name, title, position, description) values ("actionAdminCategoriesFormModifier", "actionAdminCategoriesFormModifier", 1, "")', // ajout hook category BO 'insert into '.$db->getPrefix().'hook (name, title, position, description) values ("actionAdminCategoriesControllerSaveAfter", "actionAdminCategoriesControllerSaveAfter", 1, "")', // ajout hook category BO ]; foreach ($sqls as $sql) { $res = $db->execute($sql); if(!$res){ throw new \Exception("Error Processing SQL $sql", 1); } } Thanks, I just found what I need in the database 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