Categories and Sub-Categories

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
simonmlewis
DevNet Master
Posts: 4435
Joined: Wed Oct 08, 2008 3:39 pm
Location: United Kingdom
Contact:

Categories and Sub-Categories

Post by simonmlewis »

Hi all

I'm looking for a bit of advice on how to do something that appears to be simple, but I haven't e clue how to start... or where to look.

It's basically how to have a sub-category assigned to a category. ie, on a shop you select DVDs from a dropdown list (or a hover-over), and then "Action, Adventure, Comedy"... etc are shown.

I'd need this to be shown on a menu, plus on a "Add product" listing for registered traders.

Can anyone please point me in the right direction?
Love PHP. Love CSS. Love learning new tricks too.
All the best from the United Kingdom.
User avatar
JNettles
Forum Contributor
Posts: 228
Joined: Mon Oct 05, 2009 4:09 pm

Re: Categories and Sub-Categories

Post by JNettles »

I'm sorry but what are you talking about? You're really going to need to provide more information than this.
simonmlewis
DevNet Master
Posts: 4435
Joined: Wed Oct 08, 2008 3:39 pm
Location: United Kingdom
Contact:

Re: Categories and Sub-Categories

Post by simonmlewis »

Visit http://www.boots.com.
you select a category you wish to look at, and then the subcategories within that appear.

For example: you select FRAGRANCES, and then you are given "For Men", "For Women", "Unisex".

So when a customer creates a product, it would be good to give the customer the option to add their category or sub category and this would have to go into a DB.

But just for now, how do I allow it so when someone selects a category from a dropdown (which is from the DB), then then shows that designated sub category from another category.
Love PHP. Love CSS. Love learning new tricks too.
All the best from the United Kingdom.
Post Reply