Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Duplicate products to use in multiple categories? Is there a way?


awarner20

Recommended Posts

Hello all,

 

I'm wondering if there is a way to duplicate the products I have in one category into another category. For example, if I have 10 products in Catalog-->DVDs-->Comedy, can I duplicate those 10 products in Catalog-->Movies-->Humor? I would like to be able to duplicate the description and images as well.

 

Can anyone offer any advice on how I might accomplish this easily?

 

Thank you for any help you can provide:)

 

Adam

We see our customers as invited guests to a party, and we are the hosts. It's our job every day to make every important aspect of the customer experience a little bit better. - Jeff Bezos

Link to comment
Share on other sites

Once you have created a product in one category you can duplicate in another category by clicking on the product in admin then hitting the copy to button.

Link to comment
Share on other sites

Once you have created a product in one category you can duplicate in another category by clicking on the product in admin then hitting the copy to button.

 

Thanks so much! Worked like a charm:)

We see our customers as invited guests to a party, and we are the hosts. It's our job every day to make every important aspect of the customer experience a little bit better. - Jeff Bezos

Link to comment
Share on other sites

Once you have created a product in one category you can duplicate in another category by clicking on the product in admin then hitting the copy to button.

 

I have a follw-up question to this post. Is it possible to duplicate a subcategory? I would like to have the same subcategory under different main categories. Is this possible? I have looked and it seems I can move subcategories, but not dulicate them.

 

Thanks gain for any help.

We see our customers as invited guests to a party, and we are the hosts. It's our job every day to make every important aspect of the customer experience a little bit better. - Jeff Bezos

Link to comment
Share on other sites

Hi guys this is exactly what i want, to be able to copy or duplicate subcatergories to another catergory. i have searched the forums like a hound dog...but to no avail. is it not possible to make some sort of SQL query to duplicate the subcatergories?

 

thanks guys

Link to comment
Share on other sites

Hi guys this is exactly what i want, to be able to copy or duplicate subcatergories to another catergory. i have searched the forums like a hound dog...but to no avail. is it not possible to make some sort of SQL query to duplicate the subcatergories?

 

thanks guys

 

I'm still hoping for a solution to this too. Hopefully someone will have some advice on this?????

We see our customers as invited guests to a party, and we are the hosts. It's our job every day to make every important aspect of the customer experience a little bit better. - Jeff Bezos

Link to comment
Share on other sites

nope, you cannot easily coppy a subcategory, you can write a script that links all current products from a category to another without to much trouble (see code below).

 

problem comes when new products are added to either category... they will then not automaticaly be duplicated. Writing a contribution for that (and all axceptions) for you is a bit to much time consuming for me right now. (Linking products and descriptions is done in the code below)

 

do you want to link them to several categories, or to actually copy them (new produts_id for every product).

When linking it is posible to create a system to catch the exceptions, when copy-ing....

it will be a lot harder (more time consuming to build) since you would also need to create a next field in the database that would store the original products_id from where it was copied... then all exceptions on that...

 

file for "simple" link to category...

<?php
$categorycopy = YOUR_CATEGORY_ID_TO_BE_COPIED_HERE;
$categorycopyto[0] = YOUR_CATEGORY_ID_TO_BE_COPIED_TO_HERE; /* copy this line as many times as you want while changing the "category to be copied to" and the [0] upward */

require('includes/application_top.php';

$number = 0;
$selectquery = tep_db_query("SELECT products_id from "' . TABLE_PRODUCTS_TO_CATEGORIES . '" where categories_id = $categorycopy");
while($products_id_fetch = tep_db_fetch_array($selectquery)) {
$products_to_copy[] = $products_id_fetch['products_id'];
}

for($a = 0, $b = sizeof($products_to_copy); $a<$b; $a++) {
for($c = 0, $d = sizeof($$categorycopyto); $c<$d; $c++) {
 $check_if_copied = tep_db_fetch_array(tep_db_query("SELECT products_id from "' . TABLE_PRODUCTS_TO_CATEGORIES . '" where categories_id = $categorycopyto[$c] and products_id = $products_to_copy[$a]"));
  if($check_if_copied <> $products_to_copy[$a]){
tep_db_query("INSERT INTO "' . TABLE_PRODUCTS_TO_CATEGORIES . '" (products_id, categories_id) VALUES ("$products_to_copy[$a], $categorycopyto[$c]")");
$number++;
 }
}
}
echo 'There have been '. $number . ' product(s) linked to more categories';
require('includes/aplication_bottom.php');
?>

 

you would need to save the above code in a new php file, and upload that into catalog/admin/

do make a backup first, I have not tested the above code, use this at own risk.

And do make sure you change the category id's above to the correct and existing categories.

Link to comment
Share on other sites

Would the Multi categories contrib not work better? You have one product, but it can be in more than one category. This is really useful when you have to update a product (photo, price, description, attribs, ect) it would change in all categories, rather than having to find them all, and change each one.

Link to comment
Share on other sites

i am still making my site and just want example ::big::small::medium for most of my main catagories. they will all have the same title picture, but i will create different products myself.

eg:(This is just an example.)

 

Category:subcategory

subcategory

subcategory

 

Tshirts:big

small

medium

 

Pants: big

small

medium

 

Shirts big

small

medium

thanks for all help regards

Link to comment
Share on other sites

Archived

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

×
×
  • Create New...