Professional CodeIgniter

(singke) #1

Chapter 4: Creating the Main Web Site


98


Displaying Product Details


In just a very short amount of time (less than a few hours, really), you ’ ve made a great deal of progress.
The home page and both category views are now roughed in. It is time to create the product view. Before
creating that view, it ’ s a good idea to revisit the diagram for that page, so it ’ s shown in Figure 4 - 10.

Figure 4 - 10

In many ways, this is a very similar interface to the home page, except that the sidebar items are in the
same grouping as the product with central billing. So far, the discussion around the “ grouping ” concept
has been a bit general, but it makes sense conceptually. The idea is to show not just a pair of jeans, but
also the shirt and shoes that go with those jeans. In other words, the grouping is an easy way to display
related items regardless of their home categories.

Therefore, before you can start coding, take a moment to group together different product records in
your database. You need to do this in order to test out the algorithm you ’ re going to write. It doesn ’ t
really matter if Pants A actually goes with Shirt B or Shoes D, all you need is a set of matching items to
run the algorithm against.

A good idea might be to group different clothing items, with just enough affinity to keep your coding
fast and iterative at this stage. Remember the Agile way — it ’ s very likely that Claudia will make all
manner of changes once she sees your work, so do just enough to make it work, and worry about all the
details later. The same can be done with toys and games. Don ’ t worry at the moment what the groups
should be named, as at this point any arbitrary string (like “ abc ” or even “ toyset 1 ” ) will do.
Free download pdf