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 '18 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 '18 at 8:35

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.