How to change product categories in Magento via Mysql?

Asked

Viewed 2,127 times

0

I did the import of of the products from my store but they came with all changed categories.

Is there any way to exchange categories via or in some other faster way?

  • It is not easier to fix csv file generation and redo import?

  • That’s the problem, are know that change to correctly associate the categories

  • 1

    Mysql has SQL UPDATE command

  • @Tony I know that .--.

  • 1

    @luckakashi already starting there, you need to know where the problem is to know what to trade. Furthermore, if you know, just build the logic in sql or as the friend Osvaldo said, you can opt for the correction of csv. Already I say that there will not be a magic option that corrects exports, if you do not inform where the problem is and what the solution is.

  • @luckakashi: so your problem has nothing to do with Mysql but with the organization of the data in its origin, prior to the load in DBMS. You need to re-examine this data in order to generate the csv file correctly.

  • 1

    For a better answer, maybe having access to CSV or mysql SQL dump

Show 2 more comments

1 answer

1


How to use phpMyAdmin to move products from one category to another in Magento

The admin panel offers a couple of ways to move products from one category to another. For example, you can move a single product by editing that product. When you go to Catálogo > Gerenciar os produtos and opens the editing screen of a product there is a button on the left that you can use to select which category (categories) the product should be associated with. Another way is to edit the category. When you go to Catálogo > Gerenciar Categorias and open the edit screen of a category, you can use the tab categoria de Produtos to remove products from the category or associate products with the category.

By modifying the database in which your Magento is installed, you can quickly move products from one category to another. For example, this is a quick solution if you want to move all products from one category to another. You can do this with phpMyAdmin.

you can do this with an SQL query that looks like this:

UPDATE `magento_catalog_category_product` SET `category_id` = 8 WHERE `category_id` = 7

In the query that you execute you need to replace Maxoon with the actual prefix of your database tables (if it has prefix). You also have to replace the category Ids with those of the specific categories.

In our above query example of all category 7 products will be moved to the category with ID 8. If you are not sure which the identifications of your categories are, in a way to verify that it is in your Magento admin panel. When you go to Catálogo > Gerenciar Categorias and you click on a category, it will show not only the category settings, but also your name and ID (at the top, above the category settings).

After executing the query reindexar the Magento data. You can do this from the admin panel of the Sistema > Gerenciar Índices.

Source

Browser other questions tagged

You are not signed in. Login or sign up in order to post.