Fabrizio Carloni Posted July 17, 2021 Share Posted July 17, 2021 (edited) Hi, to update the products I use the internal Prestashop function "Import" with CSV file... I would like to run a php script just before the import starts and another php script when the import has finished successfully and finally rebuild search index. How can I do? The import file is AdminImportController.php but I don't know how to do this. Can you please help me? Thank you and greetings, Fabrizio. Edited July 17, 2021 by Fabrizio Carloni (see edit history) Link to comment Share on other sites More sharing options...
Nickz Posted July 17, 2021 Share Posted July 17, 2021 1 hour ago, Fabrizio Carloni said: to update the products I use the internal Prestashop function "Import" with CSV file... I would like to run a php script just before the import starts and another php script when the import has finished successfully and finally rebuild search index. What is your skill level? Link to comment Share on other sites More sharing options...
Fabrizio Carloni Posted July 17, 2021 Author Share Posted July 17, 2021 I think normal. Why? Best regards, Fabrizio. Link to comment Share on other sites More sharing options...
Nickz Posted July 17, 2021 Share Posted July 17, 2021 (edited) If you know php pretty well it could be done with a function I think. Edited July 17, 2021 by Nickz (see edit history) Link to comment Share on other sites More sharing options...
Fabrizio Carloni Posted July 17, 2021 Author Share Posted July 17, 2021 (edited) Okay, that's also why I'm here for help. :-) I was thinking of putting links to scripts in the AdminImportController.php file but maybe that's not the correct way to proceed. Can anyone please help me? Best regards, Fabrizio. Edited July 17, 2021 by Fabrizio Carloni (see edit history) Link to comment Share on other sites More sharing options...
Fabrizio Carloni Posted July 17, 2021 Author Share Posted July 17, 2021 If only I could perform the automatic rebuild search index after the import it would already be a good step. Best regards, Fabrizio Carloni. Link to comment Share on other sites More sharing options...
Nickz Posted July 17, 2021 Share Posted July 17, 2021 1 minute ago, Fabrizio Carloni said: Okay, that's also why I'm here for help. 🙂 I I don't think that you'll get a script written for you on the base of your information. No theme name, no php version, no domain name. Post the file you want to change with the changes you try to do. Try them before they might even work. Link to comment Share on other sites More sharing options...
Fabrizio Carloni Posted July 17, 2021 Author Share Posted July 17, 2021 I don't want a script but help on how to do. I use Prestashop 1.7.7.5 with PHP 7.4 as a theme I use AngarTheme and as mentioned for the update of the products I use the native import of Prestashop which I think should use the file /controllers/admin/AdminImportController.php (which I am attaching). What I would like to do is run my php file just before the import and another php file of mine after the import is complete and finally rebuild the search index. How can I do it? Thank you, Fabrizio. AdminImportController.php Link to comment Share on other sites More sharing options...
Fabrizio Carloni Posted July 18, 2021 Author Share Posted July 18, 2021 In the documentation of prestashop for dev I found this https://devdocs.prestashop.com/1.7/development/components/import/ but I don't know how to implement it. Can anyone help me? Best regards, Fabrizio. Link to comment Share on other sites More sharing options...
Fabrizio Carloni Posted July 21, 2021 Author Share Posted July 21, 2021 Can someone please help me? Best regards, Fabrizio Carloni. Link to comment Share on other sites More sharing options...
SmartDataSoft Posted July 21, 2021 Share Posted July 21, 2021 Hello, Please go to the code of generate re index , after your custom import done, can. Call That class function to reindex. Other wise their is no hook in PrestaShop. You need to Handel it manually. Thank you Link to comment Share on other sites More sharing options...
Fabrizio Carloni Posted July 21, 2021 Author Share Posted July 21, 2021 Sorry I didn't understand ... so there's no way to handle this process with just one click? What I want to do is automatically run my php script just before the import starts and another php script when the import is done successfully. How can I do? Best regards, Fabrizio Carloni. 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