I want to assign product to category by store.

What I did :

  • I update my database to add a column 'store_id' to catalog_category_product
  • When I save a product to category via the BO, I insert the store_id too

What I want to do now:

When I go to the product to see its categories. I want to make a distinction between category just for the store and global category.

Example of categories for product :

my page

So, someone knows where is the code to get the collection which display the checked boxes ? I didn't succeed to find it.

  • The values for categories are stored in the catalog_category_product table which only holds values for the category/product ids and one for position. I think the best solution would be to create websites to replace your Store Views, copy all your categories, and assign them to separate websites so you can then assign the products. It could be a lot of work and sort of an ugly solution, but doing it with the data and a custom extension would be more work, and it would be seriously changing the structure of category tables in the database.
    – mtr.web
    Jan 5, 2018 at 20:41
  • Thanks for your proposition, but the people who handle categories don't want to create new ones. So I will find another solution.
    – Kozame
    Jan 10, 2018 at 8:35
  • @Kozame, did you get the solution? Dec 27, 2021 at 12:16
  • @VinayaMaheshwari Sorry, I don't remember and now I'm on Magento 2 :(
    – Kozame
    Jan 10, 2022 at 9:15


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Browse other questions tagged or ask your own question.