I am currently working on a project where I am looking at converting ExpressionEngine channel entries into individual .txt or .csv files. I can export all channel entries into one file, but I am struggling when it comes to separating each entry into individual files...
I am integrating the website with a clients stock inventory system for their retail stores. The software inputs .txt or .csv files into the system when an order is placed in store, this then updates their stock inventory.
The website is going to display their products with live stock inventory based on in store orders and online orders.
I am looking into pulling data from each order via an sql query and exporting this as a .txt file. Each order will create an individual text file and once an hour the .txt files will be exported to a folder within the server via a cron. This is the folder the clients stock inventory system uploads the .txt files from. so if an order is placed via the website, the file will be exported and uploaded to the stock system, reducing the stock inventory for that item buy the amount in the order.
Any suggestions or pointers would be appreciated.
If this is a complicated way of achieving this and anyone has a more simplified solution then please let me know.
Thanks in advance
What module are you using for your e-commerce setup? Chances are it has an extension hook you could use that fires after each order is completed. You could add your code in that hook to export the order as a text file directly into the aforementioned folder on the server.