BWtwoK Posted December 6, 2002 Posted December 6, 2002 Im building an automotive osCommerce site and I have the car model as the Category and then the different sections of the car are the sub category.. But I would like to duplicated the subcategories for every category but there is no copy feature?? Do I have to do this via MySQL direct?? Woody
Christian Lescuyer Posted December 6, 2002 Posted December 6, 2002 Correct, you can copy products, but not categories. You could do it in MySQL. - Create all car models. - Create the sub-categories for one car model, then dump the database, duplicate the sub-categories and change the parent category. - Duplicate the categories descriptions. Something like this should do the trick: INSERT INTO categories VALUES ('1', 'category_ford.gif', '0', '1', now(), null); INSERT INTO categories VALUES ('2', 'category_honda.gif', '0', '2', now(), null); INSERT INTO categories VALUES ('101', 'subcategory_doors.gif', '1', '0', now(), null); INSERT INTO categories VALUES ('102', 'subcategory_tires.gif', '1', '0', now(), null); INSERT INTO categories VALUES ('103', 'subcategory_bumpers.gif', '1', '0', now(), null); INSERT INTO categories VALUES ('201', 'subcategory_doors.gif', '2', '0', now(), null); INSERT INTO categories VALUES ('202', 'subcategory_tires.gif', '2', '0', now(), null); INSERT INTO categories VALUES ('203', 'subcategory_bumpers.gif', '2', '0', now(), null); INSERT INTO categories_description VALUES ( '1', '1', 'Ford'); INSERT INTO categories_description VALUES ( '2', '1', 'Honda'); INSERT INTO categories_description VALUES ( '101', '1', 'Doors'); INSERT INTO categories_description VALUES ( '102', '1', 'Tires'); INSERT INTO categories_description VALUES ( '103', '1', 'Bumpers'); INSERT INTO categories_description VALUES ( '201', '1', 'Doors'); INSERT INTO categories_description VALUES ( '202', '1', 'Tires'); INSERT INTO categories_description VALUES ( '203', '1', 'Bumpers'); A decent numbering scheme should help. Christian Lescuyer
BWtwoK Posted December 9, 2002 Author Posted December 9, 2002 Thanx thats what I thought hehe.. Woody
TB Posted January 8, 2003 Posted January 8, 2003 Just wondering if anyone has thought of a contribution to enable the copying / linking of sub-categories. A linking method like the products would be GREAT as all linked categories (and products underneath) will be updated by editing and making changes at one point. Does anyone know if Linda has mentioned something about integrating this into her new attribute copier/sorter contribution? "The price of success is perseverance. The price of failure comes much cheaper."
Ajeh Posted January 8, 2003 Posted January 8, 2003 Can you be more specific on what your idea is behind a linked category? Do you mean just a method of duplicating a category onto another category or select a category and copy all the products from one category to another as linked products? I am not clearly seeing what you need in copying and linking subcategories.
TB Posted January 9, 2003 Posted January 9, 2003 Can you be more specific on what your idea is behind a linked category? Yep. ------------------ Categories Clothing - Ball Caps Gifts - Ball Caps ------------------ As per the example above, lets say I sell ball caps under both the clothing a the gifts categories. As osCommerce stands now, if I wanted to list the ball caps in both and have the ease of description changes, modifcations and price changes of linked items, I would need to manually create both 'Ball Cap' categories, and then copy each Ball Cap as a seperate linked item from one to the other. If it was just one category I was dealing with, I'd just create it manually; though I have many examples like this... I am not clearly seeing what you need in copying and linking subcategories. Hopefully this is a clearer description of what I mean... I guess in essence, a 'linked category' is what I'm after... so it would be dynamic to additions, deletions and modifications etc. for all those underneath. Copy category as link... "The price of success is perseverance. The price of failure comes much cheaper."
Ajeh Posted January 9, 2003 Posted January 9, 2003 Linked Categories is an interesting concept. I cannot think of an easy way to do this however. I can see how to do a Copy all products as linked products from one category to another. But, this could end up in a mess.
ukracer Posted January 15, 2003 Posted January 15, 2003 Linked Categories is an interesting concept. I cannot think of an easy way to do this however. I can see how to do a Copy all products as linked products from one category to another. But, this could end up in a mess. Hi linda can you see a way to easily copy an empty subcategory (It can be full/populated I dont mind but I am in need of a quck way of created multiple subcategories of the same name to sart with. I am rather reluctant to use my sql itself as I find OS commerce quite hard but myqsql is mind blowing :shock:
ukracer Posted January 15, 2003 Posted January 15, 2003 Can you be more specific on what your idea is behind a linked category? Yep. ------------------ Categories Clothing - Ball Caps Gifts - Ball Caps ------------------ As per the example above, lets say I sell ball caps under both the clothing a the gifts categories. As osCommerce stands now, if I wanted to list the ball caps in both and have the ease of description changes, modifcations and price changes of linked items, I would need to manually create both 'Ball Cap' categories, and then copy each Ball Cap as a seperate linked item from one to the other. If it was just one category I was dealing with, I'd just create it manually; though I have many examples like this... I am not clearly seeing what you need in copying and linking subcategories. Hopefully this is a clearer description of what I mean... I guess in essence, a 'linked category' is what I'm after... so it would be dynamic to additions, deletions and modifications etc. for all those underneath. Copy category as link... I am with you on this one dude. At present we might have associated, losi and schumacher in subcategories and I have to create each new sub category manually each time and it would be nice to list under individual products and also under manufacturer but only inputting the details for their products just the one time. Any contribs come close that any one knows of?? Thanks in advance
charles Posted January 16, 2003 Posted January 16, 2003 Could the existing code be modified to allow inclusion of some appropriate delimiter such as a period (.), slash (/), or colon (:) when entering values in the parent field. a subroutine could parse the entry and make the multiple entries under the different categories specified. for ex. if 'Clothing' ID is 1, 'Gifts' ID is 3, and 'ball caps' ID is 15 INSERT INTO categories VALUES (15, 'subcategory_ball caps.gif', 1:3, 0, '2002-09-09 02:33:13', NULL); The '1:3' in the parent field would be parsed and ball caps would be entered under both category '1' and category '3'. Every item would be available for marketing at every level such as the clothing store which offers Ball Caps Shirts Pants Shoes Accessories Ball Caps where ball caps are a primary offering as well as listed under accessories. Theoretically, following this scheme you could possibly eliminate the 'sort order' field since the parent field would become recursive, even allowing for a category to be listed under itself indefinitly (although I don't know why you would want to I'm sure someone would find a use *snicker*), depending on the number of delimiters in the argument. 15:15:15:15 ball caps ball caps ball caps ball caps But seriously, this could also possibly be used to simplify the multiple language entries? You could eliminate 'categories_description' and include the 'language_id' in the 'categories' table. Charles We stand in ignorance only for questions not asked. Plug up the leaks in your knowledge base and open up a flood of understanding.
sabio Posted July 20, 2006 Posted July 20, 2006 I'm probably re-inventing the wheel here, but I have not found a contribution that allows for a category to have multiple parent_id. So, what I'm 'toying' with is the following: delete category_id as primary key of categories and set it to just an index; this way it is possible to set a category_id to multiple parent_id. It seems to work fine so far .... Category A -> C Category B -> C if we add products to C it shows them fine ... FWIW HTH Cheers Sabio
Guest Posted July 20, 2006 Posted July 20, 2006 maybe if you use a separate sql table like categories to parent categories you will be able to achieve this.
Recommended Posts
Archived
This topic is now archived and is closed to further replies.