Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Create duplicate categories


monte22

Recommended Posts

Ok, what I want to do is duplicate a main category (e.g. performance parts), so I can use the same subcategories for another main category (e.g. carbon fiber hoods).

 

I have about 20 subcategories (e.g. honda, acura) in each main category (e.g. performance parts), and each subcategory has about 10 categories (e.g. 92-95 Civic) under that so I am trying to save the hassle of creating all these categories over again.

 

If anyone has any insight I would GREATLY appreciate it.

Link to comment
Share on other sites

I haven't found a way to copy in admin (maybe because I am still using MS1)

 

I have heard of contrib called Move/Copy, or something like that...but have had no luck finding it in the contrib section. Anyone heard of this?

 

James

Link to comment
Share on other sites

  • 4 months later...

I'm using MS2 and you can't copy categories. The way the OSC database is setup it won't allow you to link categories. You can link products because the database has a table "products_to_categories" where you can just add 2 id's and it will be linked.

 

It is possible to copy categories, but you'll need to do some coding for that to work.

Link to comment
Share on other sites

The easiest thing will probably be to use phpmyadmin to export the structure for the categories table. Create all the top level Cats you want. Create a new table, categoriestwo, and use the structure SQL to make it just like the categories table. Then export the data from the categories table, edit out all the SQL except the sub category data you want copied, and put it in categoriestwo. Run an UPDATE command to set the parent_id to the new top level category id, Run another UPDATE command to reset the category id to an unused number (add a number high enough to set the lowest one to the next available id in categories, and you'll be fine). Export the data from categories two, and run it into categories. Run an UPDATE and export on categoriestwo for every top level cat you want the data in.

 

Jeremy

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...