Forums / General Questions / Duplicate all products from one Category to another

Duplicate all products from one Category to another

Views: 1,708

Results 1 to 9 of 9
21 Jan 2016, 4:17 AM
#1
shags38 avatar

shags38

Totally Zenned

Join Date:
Jan 2011
Location:
Adelaide, Australia
Posts:
1,684
Plugin Contributions:
0

Duplicate all products from one Category to another

Hi - found this thread which explains the process, second page near the bottom, however it raises questions also https://www.zen-cart.com/showthread.php?133632-Can-I-copy-all-products-under-one-category-to-another-in-bulk/page2

Using that process refers to 'Linking' products, not 'Duplicating' them, albeit I think it can also be used for Duplicating, just unsure - if I follow the process of creating a new category, then linking all products in one category to that new category (which I have actually done) then the next part of the process , below, raises a question;

Reset the Master Categories ID for All Products in Category:
Reset ALL Products in the selected Category to use the selected Category as the new Master Categories ID ...
Example: Resetting Category 22 would set ALL Products in Category 22 to use Category 22 as the Master Category ID

Question: does resetting the Master Categories ID for the linked products in the new category have any effect whatsoever on the status of the Master Categories ID of the products in the still active original category from which the products were linked? Does it change that Master Categories ID as well ? I need the same products to have 2 Master Categories ID, one in one category and one in another. My interpretation says this is what happens if I follow the above step but I need to be sure :)

cheers,
Mike

21 Jan 2016, 1:01 PM
#2
mc12345678 avatar

mc12345678

Totally Zenned

Join Date:
Jul 2012
Posts:
16,908
Plugin Contributions:
2

Re: Duplicate all products from one Category to another

Linked products are the same exact product displayed in 2 or more categories... A product has one master_categories_id therefore when "viewing" the linked product the master_categories_id applies to all showings of the linked product's master_categories_id...

Therefore if you link the product to the category(ies) then change the master_categories_id on any of the representations of that product it changes "everywhere"... But if you copy instead of link... Then the copy is it's own "animal" and modifications made to the copy stay with that copy and any linked product off of that copy.

ZC Installation/Maintenance Support <- Site
Contribution for contributions welcome...

21 Jan 2016, 1:16 PM
#3
shags38 avatar

shags38

Totally Zenned

Join Date:
Jan 2011
Location:
Adelaide, Australia
Posts:
1,684
Plugin Contributions:
0

Re: Duplicate all products from one Category to another

mc12345678:

Linked products are the same exact product displayed in 2 or more categories... A product has one master_categories_id therefore when "viewing" the linked product the master_categories_id applies to all showings of the linked product's master_categories_id...

Therefore if you link the product to the category(ies) then change the master_categories_id on any of the representations of that product it changes "everywhere"... But if you copy instead of link... Then the copy is it's own "animal" and modifications made to the copy stay with that copy and any linked product off of that copy.

Thanks MC - So having said that - what process do I use for 'copying' a category into a new category - the process described above does not allow for copying in bulk (only linking), so how can it be done (and please don't say one product at a time).

cheers, Mike

21 Jan 2016, 1:49 PM
#4
shags38 avatar

shags38

Totally Zenned

Join Date:
Jan 2011
Location:
Adelaide, Australia
Posts:
1,684
Plugin Contributions:
0

Re: Duplicate all products from one Category to another

shags38:

Thanks MC - So having said that - what process do I use for 'copying' a category into a new category - the process described above does not allow for copying in bulk (only linking), so how can it be done (and please don't say one product at a time).

cheers, Mike

reference Multiple Category Links Manager

when I created the new category (65), as mentioned in original post, it has activated ALL products (623) in the category and not just the 'active' products (about 185) - now I have two categories showing 400 odd more products in each category than should be active. When I make the new category 'inactive' it deactivates all products in the original category (category stays active but shows 0 products) - a right old mess.

I tried this;

Remove ALL Products in a Category that are LINKED Products to another Category ...
Example: Using 8 and 22 would Unlink ALL Products in Category 8 from Category 22
Select All Products in Category: 65 Remove from being Linked to Category: 14

65=newly created category to which I linked all products from category 14=original category

I get this warning " WARNING: MASTER CATEGORIES ID CONFLICT!! Conflicting From Category: 65 Conflicting To Category: 14
NOTE: Master Category is used for pricing purposes where the product category affects the pricing on linked products, example: Sales
To fix this problem, you have been redirected to the first product of conflict. Re-assign the Master Categories ID so that it is no longer the Products Master Category ID for the Category that you are trying to remove it from and try again. When all conflicts have been corrected, you will then be able to complete the removal that you requested." .... which has ALL 623 products listed as being in conflict

Looking for some help here please.

cheers,
Mike

21 Jan 2016, 2:20 PM
#5
shags38 avatar

shags38

Totally Zenned

Join Date:
Jan 2011
Location:
Adelaide, Australia
Posts:
1,684
Plugin Contributions:
0

Re: Duplicate all products from one Category to another

Update ...I have deleted the newly created category as a way of minimizing the damage (bot seeing duplicate products)

I still have the issue that for some reason or other, in the linking process it has resulted in out of stock items being reactivated in all previously linked products to all previously linked categories so my site is showing out of stock product as well as active - how can I fix this?

ORIGINAL QUERY
Explanation of what I am trying to achieve;

Making duplicate category then reworking the items meta data and product descriptions to create 2 sets of different products from the same stock items because the same items are searched for as their name implies (and website name), i.e. Harmony Ball but also as a 'generic gift idea' in a larger broader category (Pregnancy Gifts) that I want the products to rank well for also - trying to cover two sets of search meta tags with one lot of product doesn't work well so this approach may be better than building a new separate site.

So I need to duplicate the products into a new category BUT I need to switch off the new category whilst I alter all the meta data and modify product pages and even image names (same images renamed) to suit my purposes - when switched back on I will essentially have the same products being targeted to two separate search markets alleviating the need for a separate website .... (changes will be enough so that the bots will not see it as duplicate content)
So how can I achieve this please??

cheers,
Mike

21 Jan 2016, 3:07 PM
#6
mc12345678 avatar

mc12345678

Totally Zenned

Join Date:
Jul 2012
Posts:
16,908
Plugin Contributions:
2

Re: Duplicate all products from one Category to another

Based on the total desired "evolution" I would suggest something like EasyPopulate V4 to accomplsh your task... You can work offline, you can apply meta tags, you can create new product, the only thing you would need to do is upload/copy your existing image(s) to the new location/name...

EP4 is a database tool and does not transfer the actual image file but allows identification of the file path/name...

There is a version 4.0.31 that allows transfer by products_id so a model# is no longer required, but does still serve a purpose.

ZC Installation/Maintenance Support <- Site
Contribution for contributions welcome...

21 Jan 2016, 3:25 PM
#7
shags38 avatar

shags38

Totally Zenned

Join Date:
Jan 2011
Location:
Adelaide, Australia
Posts:
1,684
Plugin Contributions:
0

Re: Duplicate all products from one Category to another

mc12345678:

Based on the total desired "evolution" I would suggest something like EasyPopulate V4 to accomplsh your task... You can work offline, you can apply meta tags, you can create new product, the only thing you would need to do is upload/copy your existing image(s) to the new location/name...

EP4 is a database tool and does not transfer the actual image file but allows identification of the file path/name...

There is a version 4.0.31 that allows transfer by products_id so a model# is no longer required, but does still serve a purpose.

Thanks MC - what about the issue of out of stock items now showing in all categories which wasn't the case prior to doing the category linking? ... how do I correct this?

cheers,
Mike

21 Jan 2016, 4:10 PM
#8
mc12345678 avatar

mc12345678

Totally Zenned

Join Date:
Jul 2012
Posts:
16,908
Plugin Contributions:
2

Re: Duplicate all products from one Category to another

shags38:

Thanks MC - what about the issue of out of stock items now showing in all categories which wasn't the case prior to doing the category linking? ... how do I correct this?

cheers,
Mike

Two ways that I can see. Sql statement (probably fastest) or can do so with EP4, but have to understand how to use it first.

If all product that have a quantity of zero are to be disabled then in tools->install sql patches enter the following (backup database before doing):

update products set products_status = 0 where products_quantity = 0;

ZC Installation/Maintenance Support <- Site
Contribution for contributions welcome...

21 Jan 2016, 6:48 PM
#9
shags38 avatar

shags38

Totally Zenned

Join Date:
Jan 2011
Location:
Adelaide, Australia
Posts:
1,684
Plugin Contributions:
0

Re: Duplicate all products from one Category to another

Thanks MC - SQL code did the trick

cheers,
Mike