Jump to content

Clone/duplicate categories


Recommended Posts

I´m sorry my english is very bad.

 

Is there a way to duplicate a category with all your items inside, in the same way which products? I need a module free or not or a SQL sentence, the way for that is not important. Is very very urgent. Thanks

Link to comment
Share on other sites

  • 2 months later...

there is a way.

 

I'm not a good programator but i'm good in logic.

 

So , my idea is like this:

 

Suppose category B is a copy of category A.

You don't have to copy all data in database from cat A to cat B, instead...when the shop has to display category B, it will display category A(images, links,...).

 

1. make a field in ps_category , name it id_copy

2. fill in category B 's field "id_copy".....the "id-category" of category A

example:

if category A has ID = 12 , then the field "id_copy" of category B, has to be = 12

3. modify the CategoryController

- create a variable AllCategories to access all categories in db

- the controller creates a variable subCategories which contains all the informations about subcategories of the current category

- we will check if the subcategory has completed the field "id_copy". If so, we will colect all informations (id,name, image, meta...) from the category with this id ("id_copy") using the variable which we've created (allCategories)

- now we will ovewrite the infos collected over the subcategory infos.

 

4. when the shop will find subcategories of a category, instead of showing the informations of category B, it will display informations from the id_category=is-copy of category B, which is Cateory A, so the link, images...dispolayed on the page will be from category A, instead of category B.

Edited by arique (see edit history)
Link to comment
Share on other sites

  • 1 month later...

Hi, I need something similar.

I have 3 groups of clients, and need certain attributes of my products to be visible only for one group and other for the remaining groups of clients. So I figured that by duplicating the categories and approving them for each customer group separately, then I could work on the attributes independently...

Any ideas?

Thanks and regards,

H.

Link to comment
Share on other sites

  • 3 months later...
×
×
  • Create New...