0

I'm currently stuck on my websites with a csv product import. I want the csv to sit on the server where i can simply update the csv and all the data will be transferred over to my products instantly without having to consistently upload the csv.

Does anyone know any way how to make this happen automatically ?

Thanks for your help!

1 Answers1

1

A simple way to this can be a function which will be executed on every page load. This function checks if there is a csv-file, and if so, starts the import. But there a weaknesses by doing it this way. The import process will stuck the page load. And if the functions checks whether there is a cs-file, it can be that this csv-file is not completely uploaded, because the ftp-transfer is still running in this moment. (see here)

A better way is to use a Webhook to invoke the import function. The Webhook ideally should triggered by the process which transfer the csv-file (after completion) to the server.

Andy Tschiersch
  • 3,716
  • 1
  • 17
  • 24