Jump to content

Script To Run As A Cron Job To Update My Products.


Recommended Posts

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

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

  • 2 weeks later...

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...