mjm Posted February 26, 2005 Share Posted February 26, 2005 I am looking for an easy way to copy a product to several categories at once. The current method of doing each categorty seperately is rather time consuming for the size of my store. Any ideas? Thanks. Link to comment Share on other sites More sharing options...
Jeremy at oddly enough Posted February 26, 2005 Share Posted February 26, 2005 If you have direct access to your database it's very simple. In the products_to_categories table you just add a line linking the product id to the category id. To add product 1 to categories 1, 2, and 3 (let's assume it's already in cat 1, and everything looks good) you can run an SQL script like this: INSERT into products_to_categories VALUES ('1','2'); INSERT into products_to_categories VALUES ('1','3'); It's as simple as that, as long as you know your product_id's and your category_id's. ps you can write the script quickly using a word processor, or even more quickly using excel, I find, then copy and paste it to run the SQL. Jeremy Link to comment Share on other sites More sharing options...
Guest Posted February 26, 2005 Share Posted February 26, 2005 Thanks Jeremy, that is very helpful. Here is a dumb followup question: I assume that by adding a product through the database to multiple parent categories, when you go to the Admin site, you will be able to administer that product under multiple categories right? And because there are no duplicate product records, any change you make to the product in "Category 1" will automatically appear in "Category 2", since all you are doing is changing a product attribute, is that right? So there is no possibility of having a "relic" product in a category that you forgot it was in, with out of date info right? since the product ID has not changed for this product in question. Please bear with me ;) Link to comment Share on other sites More sharing options...
mjm Posted February 26, 2005 Author Share Posted February 26, 2005 Thanks Jeremy, that is very helpful. Here is a dumb followup question: I assume that by adding a product through the database to multiple parent categories, when you go to the Admin site, you will be able to administer that product under multiple categories right? And because there are no duplicate product records, any change you make to the product in "Category 1" will automatically appear in "Category 2", since all you are doing is changing a product attribute, is that right? So there is no possibility of having a "relic" product in a category that you forgot it was in, with out of date info right? since the product ID has not changed for this product in question. Please bear with me ;) <{POST_SNAPBACK}> That is correct. The products information is stored in the products table and the products_to_categories table handles the mapping. Now, Are there any contributions setup to handle copyign the products to multiple categories? Link to comment Share on other sites More sharing options...
Jeremy at oddly enough Posted February 27, 2005 Share Posted February 27, 2005 Now, Are there any contributions setup to handle copyign the products to multiple categories? <{POST_SNAPBACK}> I don't know, as I mentioned, I find it easiest to use excel to write scripts of SQL commands to run via phpmyadmin. The features in a spread sheet program can be very helpful for banging out a large number of commands very quickly. This particular function should be very simple, as there are only two variables in play, on one table. Jeremy Link to comment Share on other sites More sharing options...
jweltydotcom Posted September 22, 2009 Share Posted September 22, 2009 bumping this back up. i understand the way to mod the products using PHPmyadmin.. but has anyone figured out a way to copy a products categories to another product. MUCH like the product attribute copier mod which allows you to copy attributes given to one product to another product. I have over 1000 categories and some products fit the same cars and it would be SO much easier to simply copy things over instead of selecting each category manually. Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.