Welcome to the Treehouse Community
Looking to learn something new?
Tata Cheng8,787 Points
What language can be used for this type of website?
I'm currently working on the PHP learning adventure, and a question came to mind. What if I want to add a function where customers of an e-commerce website can sign-up and view their order details, history, etc? Can that be done by PHP? Wordpress? I'm a bit confused about that, it seems pretty complex at this point.
Will Treehouse be looking into this down the track?
Christopher Warren17,640 Points
Yes you can do that. Wordpress is a content management system, where PHP is a server side language.
Kevin Korte28,109 Points
Absolutely can be done in PHP. It could even be done in Wordpress. I'm not sure you'll find a plugin that will do exactly what you want, so you may have to write your own plug in to do it.
But can it be done in PHP, and even Wordpress? Absolutely.
Will is be pretty advance to code this up yourself? Absolutely.
In essence though, you're going to have to in some fashion build onto wordpress's database, so when a user signs up, their info and some identifier about them is stored into the database. When they make a purchase, that purchase and all of it's details will have to be logged into a database, and a relationship between that order, and that user will need to be made. To show the user their order details, history, etc, your PHP code will need to query the database for any orders that user has logged in the database. That information will be return to PHP, and than it'll have to pass that info to the client to show.
You'll need to know a lot about PHP, and a database like MySQL and how to create relationships, query it, and how to make PHP interact with a database. And than sprinkle in some security concerns to prevent people from highjacking your database and customer information through the PHP code that interacts with it.