I think this is probably the largest web project I've done simply due to how much information has to be taken in to account. Just to handle each item in the shop there is around 80 different pieces of information held in the database.
Everything in the shop is defined from a database. Nothing is hardcoded in to the page. This is a completely separate approach to the current shop where everything is hard coded in to the page making it very difficult to add new features. The way discounts were added to the current shop for example was a very dirty hack and one I will not be repeating with the new shop.
To put it simply, the new shop is highly extensible, this means new features can be added very quickly. To give you an example the new shop won't support the buying of items from players but if it were to support that it would take at most 15 minutes to implement that feature. If I were to add that to our current shop it would take days.
So lets take a look at the interface! (View the interface fullscreen here: http://i.imgur.com/OMSJuoU.png)
As you can see everything of importance is held within this pop up interface. So the main page UI can be completely uncluttered. Every item will be listed on the page within a small box, 6 boxes per row with many columns. Very similar to the current shop. But different is each item will have its name written above its icon (a much requested feature) and instead of having a buy button below the icon you'll instead get the current price for a single unit of that item.
In the example case Cobble is selling for R0.27 per unit. Now once you click the icon you'll get the pop up which offers you a slider to select a specific amount of items to buy. On the right there is a button which in real time as you use the slider calculates both the price you'll pay and the quantity you've selected. Simply clicking that button buys it instantly, without reloading the page so you can click the button multiple times.
In the Cobble example I have specified the slider to range from 1 unit to 512 units but each item can have the slider specify its own amount to purchase, it's not hard coded.
There are also some convenient quick buy buttons for popular quantities. These are also defined within the database entry for this item and can also be changed on a per item basis.
Below that you have recent sales, it lists five of the most recent sales of this item including quantity purchased, what that user paid per unit and the total cost.
Then finally you have overall statistics for this item including total sold since shop v2 launched, sales this month, this week and today. It is my hope these statistics will become a valuable piece of research for players who want to compete with the admin shop.
The variable pricing will mean the most popular items in the Admin Shop will increase in price opening up the market for players to undercut. More ways for you to sell your items to other players will be coming and changes to the auction system will make it easier and quicker to list items making it even more worthwhile to sell your goods.
Thanks for reading the first topic on our new admin shop. I'm really interested in hearing your thoughts, I know it's a long post for something I'm sure many of you will find boring but the fact is the shop is one of the most used features of the server and it's now a year old and definitely needs a new foundation on top of which the server can innovate new features.
You may remember recently I added an in-game command called /setshop which when used added a little teleport button to all your auction listings so other players could teleport straight to your shop in-game from your listings. The new shop I'm writing will leverage the same extensible ideas that made that feature possible for auctions, a feature I wrote in less than an hour and that many of you have made use of.
I don't even know what the future of the admin shop entails, online crafting? card buying/trading? player selling? - But I do know the new shops foundation will get us there