Randy Lane
|
| Posted: 10/19/2002, 8:35 AM |
|
I am creating a web cart for a client that sells products that can belong to multiple categories. I am using the Bookstore example in CodeCharge, outputing to ASP. I have created a category view table relating items to categories. Would anyone have an example or tutorial that would show how this could be done?
|
|
|
 |
Nicole
|
| Posted: 10/21/2002, 2:42 AM |
|
Randy,
Sorry, I didn’t catch what the problem is. Is it related to categories handling when item is added/updated?
|
|
|
 |
Randy Lane
|
| Posted: 10/21/2002, 7:38 AM |
|
I'm sorry, I should have indicated more details.
My client sells collectible die-cast cars that are of many different makes. Chevrolet, Chrysler, Ford, Pontiac, Accessoires, etc. Most of these belong to one category depending on the car. Some can belong to several different categories. Using the Bookstore example as a template, I easily created and modified to my liking a cart for my client. The problem is that many of these items especially the accessories, I need to show up in many different categories so that when a potential customer is shopping for any brand of car the accessories also show up in that category to promote extra sales.
I have created a item_category_view table that is related to the items table by the itemID field and related to the categories table by the category_id field. They are both the primary key in this table.
My difficulty is trying to set up CodeCharge to utilize the category_id from the item_category_view table instead of the category_id field in the items table.
Unless you may have a better idea or solution.
You can see the functionality of what I am talking about by checking out my clients current web site cart at the following url.
Main site - http://www.supercar1.com
Web cart - http://stores.implex.net/supercar/default.cfm
This web cart is what I am trying to emulate to some degree.
My client is very dissatisfied with this ISP because they won’t work with him in making slight modifications to this web cart. So he wants to drop them and have me create one of his own.
|
|
|
 |
dsffsf
|
| Posted: 10/22/2002, 10:25 AM |
|
dfdfsdsdsdfsdfsssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssfdddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
|
|
|
 |
dasadsasd
|
| Posted: 10/22/2002, 10:29 AM |
|
ssdasaddddddddddddddddddddddddddddddddddddddddddddddddddddd
asddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddd
asddddddddddddddddddddddddddddddddddddddddddddddddddddddd
sadsdaaaaaaaaaaaaaaaaaaaaaaaa
asddsaasd
sdaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
saddddddddddddddddddddddddddddddddddd
asddddddddddddddddddddddddddddd
asddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddd
sdaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaasdaaaaaaaaaaa
|
|
|
 |
Mark Huber
|
| Posted: 10/23/2002, 10:00 AM |
|
The mani issue I can see from this is that the DB you have designed is not normalised enough for your needs. There is a many to many relationship between items and categories. There is now way to phyically implement this as the many to many is only a logical structure. So you have to put a resolution entity(table) in between to handle multiple categories of items. This approch will aloow you to have an infinit numer of items categorised how ever you want them.
Or you can simply add 1 ... to how ever many categories have fields on the end of your items table which will allow you to search in each of these fields. I think the search query you will have to build will need to include mutiple iterations of the items table so you can 'OR' search through the category fields. This is a bad approch because if you add another category you may have to add other fileds and modify this ugly query.
I throw out both the quick and dirty and the proper way it is up to you which you have time to build.
|
|
|
 |