Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

WordPress

nicholas maddren
nicholas maddren
12,793 Points

How Can I Display CSV Content?

A client has came to me asking if I can build them a website. The client is a car dealer and wants to display their vehicles on their site. I have looked into the whole system that they currently use and they are receiving all data via a CSV file so all I really need to do is find a way to display this data on the site. You see I have looked at WooCommerce but it seems limited on it's customisations for example I don't need a checkout and I don't need a cart. All I need is a professional way to display these vehicles. Any tips on this? Thanks :)

3 Answers

Adam Moore
Adam Moore
15,825 Points

If you're using WordPress you can utilize PHP to read the file and loop over each row to display necessary data. It's actually quite easy but... be careful. This is a sticky mess to get into. My day job is with DealerTrack Technologies and that's one big thing we do is manage inventory for car dealerships... It can become a nightmare. Lots to consider. Just be up front with them about what they can and can't expect from you displaying their CSV to the web.

nicholas maddren
nicholas maddren
12,793 Points

Thanks for the reply :) sounds like I'm talking to the right person ha, can I just ask... when you say it can be a nightmare and a sticky mess what do you mean by this? What problems do you encounter?

Adam Moore
Adam Moore
15,825 Points

It can be a lot of things. Depending on the State you have different rules about how the price can be displayed. In Texas, you can't have a special deal for Internet price or cash price and have a different price for everyone else. Also if they sell the car but don't update their CSV file right away and that inventory is still showing on their site... that can become a problem and even if you've explained to them that it can't auto update, the dealer never likes to take the blame. Also you have to think about caching, and people seeing old inventory. It can be a lot more than just spitting out information that they give you. Just worth considering.