CSV import and post automatic creation
-
Hi,
As part of the redesign of a car garage website in WordPress, my client would like to display a list of vehicles contained in a csv file he receives each week. So every week, I must update the list presented on the site by adding new vehicles and removing sold vehicles.
I have good PHP / MySQL knowledge but I ‘ve never done custom code like this in WordPress. I wanted a few tracks or confirmation regarding the implementation of a solution.
That’s what I think to make:
– a PHP function to parse the CSV file in order to extract each entry (vehicle)
– a function (a plugin for example) which call the parser function. For each entry, it checks if it exists in the WordPress DB. If not, I insert the entry with a insert_custom_post. I keep all the id in order at the end to be able to do the reverse to remove the sold vehicles.
Where I don’t exactly know what to do, is what type of post to use. I want to be able to perform research on these posts (vehicles type) kie brand, year, kilometers or price.
I think I have to create a custom post type (maybe two ? one for the global list, one for the detailed vehicle ?).
Is anybody can tell me more about this king of development ?
Thanks a lot
Nice day,Bastien
- The topic ‘CSV import and post automatic creation’ is closed to new replies.