chris_ryu Posted October 19, 2013 Share Posted October 19, 2013 (edited) Hi, I have my custom BackOffice module which imports product data from CSV files. Currently I manually enter the "Configuration Page" of the module and then it starts importing. But I want to make it automated with cron job. The problem is: How can I make a PHP file with my BackOffice module which can be accessed by crontab? Usually BO modules can be accessed only after login. Maybe I should do it another way... if so please tell me how Regards, Chris Edited October 20, 2013 by chris_ryu (see edit history) Link to comment Share on other sites More sharing options...
math_php Posted October 21, 2013 Share Posted October 21, 2013 Hi You can make a direct call with a cron to a php file, include at least : require('../../config/config.inc.php'); To get Prestashop classes available. Regards 2 Link to comment Share on other sites More sharing options...
chris_ryu Posted October 22, 2013 Author Share Posted October 22, 2013 Works like a charm! Thanks I considered this solution, but had no idea if it will include everything. Is it good to have set cron action in module via $_GET variable like: "?cron=1"? Only if it is set I include config and use module object Link to comment Share on other sites More sharing options...
math_php Posted October 22, 2013 Share Posted October 22, 2013 Nice If your folder is not browsable, with customized name for folder and file. It should be ok for no top security business. Tools::getValue(name) take both GET and POST, POST 'attacks' might need more work or skills. Best regards Link to comment Share on other sites More sharing options...
Publisher Posted October 30, 2013 Share Posted October 30, 2013 Hi You can make a direct call with a cron to a php file, include at least : require('../../config/config.inc.php'); To get Prestashop classes available. Regards Thanks this saved me. 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