kiyoshi Posted April 6, 2004 Posted April 6, 2004 Hello all a newbie here. Looking to add multiple layers in each category as needed on my site. www.kiyoshis.com/catalog I am looking how to add multiple subcategories so that customers may choose the make of their car, the model of their car, the year of their car and any other attributes like 2 door or for door. so in essence they can choose: A Make, from the main list of categories I have listed, then under each make, the model, then under each model the year, and then possible attributes such as 6cyl or 4cyl, and 2 door or 4 door. Can anyone help me find out how I can get this installed, as I am new to this, but have seen plenty of sites offer this style. Thanks!
peterr Posted April 6, 2004 Posted April 6, 2004 Hi, Nice looking site. :D I'm doing a site that sells headlights, so hopefully I understand what you want. For the example below, I will forget about the category numbers you have setup at present, okay. Looking at the levels you have: Make Model Year 6 cylinder You mentioned setting up the 6 or 4 cylinder, 2 or 4 door as attributes. I don't think that would "fit" would it, because a 2 door would surely have a different model number to it that a 4 door, both in the same year ?? Also, when you think of Model and Year, they are usually only one entity, however I can see a model may "run" more than 1 year, hhmmmm, but then they wouldn't call it another model number would they, only: Model "XY" (1998-1999) Anyway, I'm gettng off track, sorry. :) Setup a category for (example) "Ford", it has category ID of 1 Let's say there are 4 Ford Models: "AC" "VN" "Escort" "Fairlane" .. these 4 Ford models are sub categories, their 'parent' category is "Ford"..Therefore, in this example, the ID's of the 4 models may be 2, 3, 4 and 5, and they would all have a "parent_id" of value = 1. That's simply how osC uses categories and sub categories, you just specify the 'parent', in this example, it is "Ford", of value "1". You can keep on adding sub categories as you please. If you had lots of "Ford/VN" s , then you may want to define a number of categories, and therefore simply link them to the "VN" id number (value = "3"). But if you have now reached "products", simply define your product, and link the product to the _lowest_ category level (sub category). You can understand this more by looking at the file "oscommerce.sql", or simply use the 'admin' function to add the sub categories. Hope that helps, :) Peter
kiyoshi Posted April 6, 2004 Author Posted April 6, 2004 it helps a TON thanks. But still a little clarity, Where do I change the values as you stated, and lets just say I want 1 parent with 5 sub categoris, and each of those sub categories might have 4-5 or even more sub categories for example: FORD: (then you model) Ford--->Focus : Escort : Taurus : F150 : F250 F350 : Ranger (then you pick year depending on model) Ford--->Focus-->1999 : 2000-2003 : 2004 (then you pick trim) Ford--->Focus-->2004-> ZTS : ZX5 (until you have) Ford--->Focus-->2004->ZX5 and all the listings under that like brakes, suspension etc. very similar to this site: http://www.vividracing.com/catalog/
kiyoshi Posted April 6, 2004 Author Posted April 6, 2004 I am in need of serious help if you know how, I can pay you...
peterr Posted April 7, 2004 Posted April 7, 2004 Hi, What are you 'comfortable' with ... ? 1. Using phpMyAdmin or similar 2. The 'admin' function in osCommerce Peter
kiyoshi Posted April 7, 2004 Author Posted April 7, 2004 admin function in oscommerce.. I also can barely use BBedit, but with good directions, no problem.
peterr Posted April 7, 2004 Posted April 7, 2004 Hi, I will use your example, and we will assume you have no categories or products, just for the purpose of this example/exercise. FORD: (then you model)Ford--->Focus : Escort : Taurus : F150 : F250 F350 : Ranger (then you pick year depending on model) Ford--->Focus-->1999 : 2000-2003 : 2004 (then you pick trim) Ford--->Focus-->2004-> ZTS : ZX5 (until you have) Ford--->Focus-->2004->ZX5 and all the listings under that like brakes, suspension etc. Categories Ford - category_id = 1, parent_id = 0 Focus - category_id = 2, parent_id = 1 Escort - category_id = 3, parent_id = 1 Taurus - category_id = 4, parent_id = 1 F150 - category_id = 5, parent_id = 1 F250 - category_id = 6, parent_id = 1 F350 - category_id = 7, parent_id = 1 Ranger - category_id = 8, parent_id = 1 1999 - category_id = 9, parent_id = 2 2000 - category_id = 10, parent_id = 2 2001 - category_id = 11, parent_id = 2 2002 - category_id = 12, parent_id = 2 2003 - category_id = 13, parent_id = 2 2004 - category_id = 14, parent_id = 2 ZTS - category_id = 15, parent_id = 14 ZX5 - category_id = 16, parent_id = 14 Brakes - category_id = 17, parent_id = 16 Suspension - category_id = 18, parent_id = 16 Setting it up like above, you would then have a category hierarchy that would enable the following: Ford--->Focus-->2004->ZX5-->Brakes Ford--->Focus-->2004->ZX5-->Suspension Now you are at your lowest level of categories (I assume), so we add some products. Products Disk Brakes - products_id=1, categories_id=17 Drum Brakes - products_id=2, categories_id=17 Coil Suspension - products_id=3, categories_id=18 Leaf/Spring suspension - products_id=4, categories_id=18 Hope that is what you were looking for. I found I got a much better understanding of the database and how osC works by adding the data manually, but you may feel more comfortable with using the admin function. Doing it manually means making sure the RI (referential integrity) of the db works. I had an Access db from another ''ecommerce' system to convert the data, and dropped all the data in Excel, and then setup 'lookups' within excel, to make sure all the products fitted nicely under the correct categories, and all the categories had the right structure we needed. There is a contribution, called "Easy Populate", which may help you load, but it is for products only I think, whereas my understanding is that your questions are all about setting up categories. Peter
kiyoshi Posted April 7, 2004 Author Posted April 7, 2004 You are a lifesaver, thank you, one question, In which place would i find the coding in my catalog/includes/templates or catalog/includes/english or somewhere else?
peterr Posted April 7, 2004 Posted April 7, 2004 Hi, In which place would i find the coding in my catalog/includes/templatesor catalog/includes/english or somewhere else? I tried looking at your site, but you have cookies blocked, some strange message. Anyway, from memory, you did what I did initially, load all the (default) osC data. Therefore, it doesn't matter if you overwrite what there is. Some questions ......... 1. Do you have access to a Control Panel ,like CPanel, to use myPhpAdmin ?? 2. You mentioned coding, there is actually no code to change, only data to load, you would either: (i) Use the admin function (ii) create the data in an .SQL file, then use phpMyAdmin to import the data that way. Just let me know a bit more about what you can and can't do, and what you are comfortable with ? I'll be out for an hr or so. Peter
kiyoshi Posted April 7, 2004 Author Posted April 7, 2004 peter thank you, yes my redirects went beserk this afternoon... I have an admin through it our I can directly edit files through phpmyadmin thats probably better, just tell me which files and where and I will go for it :) PS the pages is back up again, thanks :)
peterr Posted April 7, 2004 Posted April 7, 2004 Hi, I have an admin through it our I can directly edit files through phpmyadmin thats probably better, just tell me which files and where and I will go for it :) I notice the categories you are already using are 1, 2, 3 and 21 to 25 To use our "Ford" example, it would be easier for me to guide you through this if you can (using phpMyAdmin), to do the following: Insert Categories 26 - Engine / Performance 27 - Body Kits 28 - Rims & Tires Update Categories Ford - category_id = 1, parent_id = 0 Focus - category_id = 2, parent_id = 1 Escort - category_id = 3, parent_id = 1 Insert Categories Taurus - category_id = 4, parent_id = 1 F150 - category_id = 5, parent_id = 1 F250 - category_id = 6, parent_id = 1 F350 - category_id = 7, parent_id = 1 Ranger - category_id = 8, parent_id = 1 1999 - category_id = 9, parent_id = 2 2000 - category_id = 10, parent_id = 2 2001 - category_id = 11, parent_id = 2 2002 - category_id = 12, parent_id = 2 2003 - category_id = 13, parent_id = 2 2004 - category_id = 14, parent_id = 2 ZTS - category_id = 15, parent_id = 14 ZX5 - category_id = 16, parent_id = 14 Update Categories Brakes - category_id = 24, parent_id = 16 Suspension - category_id = 22, parent_id = 16 Hope that is how you want the structure, although, I have a feeling', rather than like this Ford--->Focus-->2004->ZX5-->Suspension ... you may want it like this ? Suspension --> Ford--->Focus-->2004->ZX5
kiyoshi Posted April 7, 2004 Author Posted April 7, 2004 Hope that is how you want the structure, although, I have a feeling', rather than like this Ford--->Focus-->2004->ZX5-->Suspension ... you may want it like this ? Suspension --> Ford--->Focus-->2004->ZX5 I want it just how you said first! "Ford--->Focus-->2004->ZX5-->Suspension" Thank you!
peterr Posted April 7, 2004 Posted April 7, 2004 Hi, Okay, then if you 'insert' and 'update' categories, as I have outlined above, you will have: Ford--->Focus-->2004->ZX5-->Suspension Peter
kiyoshi Posted April 7, 2004 Author Posted April 7, 2004 ok so a little more info here: in phpmyadmin I go to: Database kiyoshi_catalog - table categories_description running on 38.118.142.112 Browse ]??? [ Select ]??? [ Insert ]??? [ Empty ]?????? [ Drop ] what do i do after this? click insert in the ?categories_id?field, and add from there?
kiyoshi Posted April 7, 2004 Author Posted April 7, 2004 When I go into Database kiyoshi_catalog - table categories running on 38.118.142.112 and hit Insert I get: Type Function Null Value function has a drop down box with ASCII CHAR SOUNDX ETC what do I choose?
peterr Posted April 7, 2004 Posted April 7, 2004 Hi, in phpmyadmin I go to: click insert in the categories_id field, and add from there? Yes, use the left hand frame to navigate to the correct table, then use the TAB, either INSERT to add, and BROWSE/EDIT to update. There are 2 tables to change: * categories * categories_description .. do the changes to table 'categories' first, then the 'categories_description' table. Peter
peterr Posted April 7, 2004 Posted April 7, 2004 Hi, Looking at the schema for table categories: DROP TABLE IF EXISTS categories;CREATE TABLE categories ( categories_id int NOT NULL auto_increment, categories_image varchar(64), parent_id int DEFAULT '0' NOT NULL, sort_order int(3), date_added datetime, last_modified datetime, PRIMARY KEY (categories_id), KEY idx_categories_parent_id (parent_id) ); 'categories_id' or 'parent_id' can't be NULL, so it must have been one of those columns where the error came up. If you don't like doing it manually, sometimes it is easier to create an .SQL file. For the first 3 categories to be inserted, the file would be: INSERT INTO categories VALUES ('26', '', '0', '1', now(), null); INSERT INTO categories VALUES ('27', '', '0', '1', now(), null); INSERT INTO categories VALUES ('28', '', '0', '1', now(), null); INSERT INTO categories_description VALUES ( '26', '1', 'Engine / Performance'); INSERT INTO categories_description VALUES ( '27', '1', 'Body Kits'); INSERT INTO categories_description VALUES ( '28', '1', 'Rims & Tires'); save it as kiyoshi1.sql , then in phpMyAdmin, click on the SQL tab, and just down a bit, there is a button to browse for a file. Click that and find your 'kiyoshi1.sql' file, then press GO. This is all from memory, sorry. :D Peter
kiyoshi Posted April 7, 2004 Author Posted April 7, 2004 ok peter, thanks a ton, take a look at the site now. I need your help again. I tried looking at the contributes and made changes but then all went to hell, so maybe you can steer me again. My Main Tabs: Home : What's New :Specials : Reviews : Login : Catalog I would like to change what's new to: Who We Are Reviews to :Contact Us And then change the order to: Home: Specials : Login : Catalog : Who We Are : Contact Any ideas?
peterr Posted April 7, 2004 Posted April 7, 2004 Hi, You must be using a contribution for your template, or some other template and stylesheet changes, so I can't help you much because I don't use the same source code. However, all things being equal, the file you need to modify _should_ be /includes/header.php , and then work out where it produces your code like the following: <tr><td> <table border="0" cellspacing="0" cellpadding="0" align="center" class="HeaderBackground"> <tr height="28"> <td width="12" class="HeaderPageLinksLeft" align="left" valign="middle"> </td><td class="HeaderPageLinks" align="center" valign="middle" width="107"><a class="HeaderPageLinks" href="http://kiyoshis.com/catalog/index.php">HOME</a></td><td width="14" class="HeaderPageLinksRight" align="right" valign="middle"> </td> <td width="12" class="HeaderPageLinksLeft" align="left" valign="middle"> </td><td class="HeaderPageLinks" align="center" valign="middle" width="107"><a class="HeaderPageLinks" href="http://kiyoshis.com/catalog/products_new.php">WHAT'S NEW?</a></td><td width="14" class="HeaderPageLinksRight" align="right" valign="middle"> </td> <td width="12" class="HeaderPageLinksLeft" align="left" valign="middle"> </td><td class="HeaderPageLinks" align="center" valign="middle" width="107"><a class="HeaderPageLinks" href="http://kiyoshis.com/catalog/specials.php">SPECIALS</a></td><td width="14" class="HeaderPageLinksRight" align="right" valign="middle"> </td> <td width="12" class="HeaderPageLinksLeft" align="left" valign="middle"> </td><td class="HeaderPageLinks" align="center" valign="middle" width="107"><a class="HeaderPageLinks" href="http://kiyoshis.com/catalog/reviews.php">REVIEWS</a></td><td width="14" class="HeaderPageLinksRight" align="right" valign="middle"> </td> <td width="12" class="HeaderPageLinksLeft" align="left" valign="middle"> </td><td class="HeaderPageLinks" align="center" valign="middle" width="107"><a class="HeaderPageLinks" href="http://kiyoshis.com/catalog/login.php">LOGIN</a></td><td width="14" class="HeaderPageLinksRight" align="right" valign="middle"></td> <td width="12" class="HeaderPageLinksLeft" align="left" valign="middle"> </td><td class="HeaderPageLinks" align="center" valign="middle" width="107"><a class="HeaderPageLinks" href="http://kiyoshis.com/catalog/allprods.php">CATALOG</a></td><td width="14" class="HeaderPageLinksRight" align="right" valign="middle" width="107"></td> </tr> Hope that helps a bit, Peter
kiyoshi Posted April 7, 2004 Author Posted April 7, 2004 :) thank you peter. Can I offer you some type of payment for your help?
peterr Posted April 8, 2004 Posted April 8, 2004 Hi, Can I offer you some type of payment for your help? I have sent you a PM. Peter
Recommended Posts
Archived
This topic is now archived and is closed to further replies.