Professional CodeIgniter

(singke) #1

Chapter 7: Improving the Dashboard


205


She thinks while you take notes. She ’ s pondering the second issue, what to do with products of an
inactive category.

“ In the second case, would it be possible to tell the administrator if there are any products that are about
to be orphaned, and then give them the opportunity to reassign those products? ”

“ Of course, ” you answer. “ I can set it up such that all products can be reassigned to a single category, or,
if you like, I can build a form that allows you to pick and choose where individual products go. ”

In the back of your mind, you start working out the solution for building a form to reassign individual
products to different categories. Instead of giving the user a single choice for category reassignment,
you ’ d provide a dropdown after each product, and key that dropdown to the product ID.

She thinks a little bit more and finally answers: “ Ninety - nine percent of the time, we ’ re going to be
happy with reassigning all products from one category to another category, so I ’ m not too worried about
picking and choosing. The user can always go back to the products home page and run a batch category
assignment on those products. ”

You nod, knowing that the simplest approach almost always solves the problem. “ That sounds
great, ” you say, writing down notes. “ Next on the agenda: What do we do with deleted products? Again,
we ’ re just deactivating them, but what happens if those products are in someone ’ s Shopping Cart? ”


“ I don ’ t think it would be smart at all to remove a product from somebody ’ s order, ” Claudia says. “ If it ’ s
in the order, let ’ s allow them to keep it and check out. ”

“ That ’ s easy enough, ” you answer, taking notes. “ If you change your mind later on, all I have to do is
run a small query at checkout to make sure that all the product IDs in the Shopping Cart are still active.
If we find anything amiss, we can warn the site visitor. ”

“ Sounds good, ” Claudia says. “ I really appreciate how easy you ’ re making all of this, by the way. ”

“ No problem. OK, the next question has to do with colors and sizes. I ’ m not sure what to do with these
fields. We put them in at the beginning, but so far we ’ re not storing data in them or using the data in any
way. ”

“ Well, it would be great if we could just assign colors and sizes to our products. Maybe with some
checkboxes? ”

“ And would you like the ability to maintain what colors and sizes are available? ”

Claudia nods. “ That would be great. We wouldn ’ t have to bug you for any updates then. ”

You laugh. “ Yes, that would be good. One last question: This is in regard to user privileges in the
dashboard. Are there certain users who might have access to just a few functions? ”

Claudia thinks for a few seconds and finally shakes her head. “ At this point, I trust my employees to do
just about anything in the retail store, so it would be silly to restrict them on the online portion of the
store. I ’ ll be on it just about every day, so if I see anything strange, I can fix it. ”

“ OK, ” you answer, “ Time for me to get back to work! ”
Free download pdf