JOEFTE Posted January 10, 2016 Share Posted January 10, 2016 I need help writing a php script to run as a cron job once a day to update my products. My supplier has a datafeed in csv format that has stock information. I need a script to read that file and update the products in my database so that they can be enabled if in stock or not active if out of stock. Link to comment Share on other sites More sharing options...
Knowband Plugins Posted January 12, 2016 Share Posted January 12, 2016 Don't you need to update quantity or just want to change product status? Link to comment Share on other sites More sharing options...
JOEFTE Posted January 13, 2016 Author Share Posted January 13, 2016 Just need to set available for order or turn it off. I am using a drop shipping wholesale. Their data feed has a list of orders that are in stock and another list of items not in stock. Link to comment Share on other sites More sharing options...
im_presto Posted January 13, 2016 Share Posted January 13, 2016 Hi, I have developed a few modules of cron job for product's add/update and inventory synchronize based on different drop shipping data feed (XML, JSON & CSV). I can help you out in your cron script. Link to comment Share on other sites More sharing options...
Knowband Plugins Posted January 13, 2016 Share Posted January 13, 2016 You can write PHP script to read CSV sheet from supplier server once per day. Script can be write in such a way to automatically make changes in order status as per stock availability information in the sheet. To read CSV sheet use below code: $file = fopen("./sample.csv","r"); while(! feof($file)) { $line[]=fgetcsv($file); } echo '<pre>';print_r($line[0]);echo '</pre>'; fclose($file); If you are interested we can write this script for you. Contact us to get quote. Link to comment Share on other sites More sharing options...
NeedZoom Posted January 25, 2016 Share Posted January 25, 2016 Hi, after i write this csript php where i put this for calling in cron jobs of prestashop? if any tuto for this? thanks Link to comment Share on other sites More sharing options...
Knowband Plugins Posted January 25, 2016 Share Posted January 25, 2016 If you are writing it as plain php file, you can place it in root directory of your store. 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