iartusi87 Posted April 17, 2015 Share Posted April 17, 2015 Hello, I'd like to use default import csv to import products, is possibile to use cron job to import product every day? Thank you a lot Link to comment Share on other sites More sharing options...
iartusi87 Posted April 18, 2015 Author Share Posted April 18, 2015 (edited) I try this (https://coderwall.com/p/2q5lcw/prestashop-background-cron-csv-products-import): <?php require_once ('class.PSRequest.php'); //see class source code below /* START Configuration */ $shopID = "1"; $adminUrl = 'http://127.0.0.1/prestashop/admin923dnt0oz/'; $adminLoginEmail = '[email protected]'; $adminLoginPass = 'testtest'; /* END Configuration */ $request = new PSRequest(); $request->setPost(array("email" => $adminLoginEmail,"passwd" => $adminLoginPass, "submitLogin" => "Connexion")); // you must be a super admin $request->call($adminUrl."index.php?controller=AdminLogin"); list(,$response) = explode(PHP_EOL.PHP_EOL, $request->_webpage, 2); preg_match("/AdminImport&token=([a-z0-9]+)/", $response, $matches); $token = $matches[1]; unset($request); $request = new PSRequest(); $request->setPost(array( "controller" => "AdminImport", "token" => $token, "skip" => 1, "csv" => "http://127.0.0.1/prestashop/admin923dnt0oz/import/products_import.csv", "convert" => '', "regenerate" => '', "entity" => 1, //1 is for products import "iso_lang" => "it", "truncate" => 1, "forceIDs" => 1, "match_ref" => 0, "separator" => ";", "multiple_value_separator" => ",", "import" => 1, "type_value" => array( 0 => 'Name') ) ); $request->call($adminUrl."index.php?controller=AdminImport&token=".$token); echo $request; Login OK -> Token OK -> Upload KO Nobody can help me? Edited April 18, 2015 by iartusi87 (see edit history) Link to comment Share on other sites More sharing options...
Guest Posted April 18, 2015 Share Posted April 18, 2015 I cant help with that, but I can tell you that we use Storemanager with the automated product import plugin. Works a treat https://www.prestashopmanager.com/ Link to comment Share on other sites More sharing options...
iartusi87 Posted April 18, 2015 Author Share Posted April 18, 2015 I cant help with that, but I can tell you that we use Storemanager with the automated product import plugin. Works a treat https://www.prestashopmanager.com/ Thank you for replay, this program must be always open to import product? (ex. every day in 23.59) Link to comment Share on other sites More sharing options...
Guest Posted April 18, 2015 Share Posted April 18, 2015 Not the program, but the computer does. We leave the computer on, the software does the after the end of the day. I then have an automated shutdown that closes the computer afterwards http://kshutdown.sourceforge.net/ Link to comment Share on other sites More sharing options...
wouababelouba Posted August 3, 2016 Share Posted August 3, 2016 Hello iartusi87, Did you find a way to use the default csv import like you want to do in #2 ? It is a good idea to use the core, instead of buying another module doing the same thing. Thanks. 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