Bespoke CMS – Part 2 – “Thinking Ahead”
When it comes to designing a content management system from scratch it is important to think ahead and try to anticipate the needs and changes of your client. If you build a system that is rigid yet inflexible you will suffer for it when your client demands changes. The trick is to create a system that is fluid and easily changeable – dynamic.
To put this into some perspective we’ll take our “Complete Computers” as an example.
Say for example the client initially wants to do this:
- Create a computer part
- Choose Image for part
- Write a description for part
- Write a title for part
- Set price for part
These are the bog-standard things that should be implemented for the computer parts.
However what if you have implemented this and in a couple of months the client comes back saying that he wants to also be able to apply a discount to all products? In this case let’s say he wants to implement a 15% discount on all products. With the way we originally created this, it would mean that the client would have to manually discount 15% from each and every product. This gets frustrating if the client has 100′s of products that he now has to spend ours on changing.
The easiest way to escape this conundrum is to set a modifier on the entire “price” column for every product when it is outputted. So in the front-end the discount is applied Perhaps with a piece of code such as:
<?php
$sql = “SELECT * FROM catalog_products WHERE productid = ’4′”;
$res = mysql_query($sql);
while ($row = mysql_fetch_array($res, MYSQL_ASSOC)){
$price = $row['price'];
$multiplier = 0.85; //discount of 15%
echo “£”.($price*$multiplier);
}
?>
This is easy enough to do but wouldn’t it have been better to anticipate this kind of functionality beforehand?
What you need to ensure is that you have the bases covered before you finish your CMS. Ideally you should always have the basics laid down that any store might require. That is build in the sort of functionality that is expected of a store. Discounts, VAT changes, Shipping costs. All manageable by the client in the admin section.
I find it easier to implement these sorts of much-needed bits of functionality before you move onto the bespoke side of things. This is only part of what I mean by thinking ahead – the rest I will cover in my next post “Building and Testing our database” where we will cover our sample stores database and also try to cover our bases so that we do not need to return to the client in a months time to implement obvious changes.

Thanks for the code, Robert, it helps me a lot in my homework