In my magento I have a problem. Categories tab of product when you edit is looking like this. I can't select subcategories from shop. I have no idea why. What could be the problem?


Store categories are:

enter image description here

Update 1

This is only when editing saved products. When adding all is ok. Also when reindexing, Category Flat Data is not reindexed.

Update 2

Reverted my code to a previous version, when this problem wasn't present. Still the same problem. This means that the problem is in BD.

  • What's wrong with this screenshot? – user487772 Feb 24 '14 at 12:12
  • Under shop there should be subcategories. – Marin Bînzari Feb 24 '14 at 12:12
  • Are you playing with scopes and visibilities? Are there any JS errors in console? – user487772 Feb 24 '14 at 12:13
  • scopes and visibilities I even don't know what is this. No JS errors. – Marin Bînzari Feb 24 '14 at 12:15
  • @Tim, I made an update. – Marin Bînzari Feb 24 '14 at 12:26

You may find your solution here Category Tree Not Showing In Magento Admin Product Edit Pages After Upgrade. Probably your Magento lost the Child_Count values in the catalog_category_entity table.

Aswer from there:

  1. Create a temporary table containing count values This step will depend on the path values on your database. For me, the Root category was of ID 340.. So all you need to do is to replace the 340 with your root category ID or the ID of the category you want to fix.

    CREATE TABLE temp_category_child_count (entity_id INT(11), child_count INT(11));
    INSERT INTO temp_category_child_count
    SELECT parent_id, COUNT(entity_id) total  FROM `catalog_category_entity` WHERE path LIKE '1/340/%' GROUP BY parent_id ORDER BY parent_id;
  2. Now move the counts to the entity table This step will now move the children count values from the temp table back to the main category entity table.

    UPDATE `catalog_category_entity` a, temp_category_child_count b 
    SET a.children_count = b.child_count WHERE a.entity_id = b.entity_id;
  3. Finally refresh your Magento indexes This is important step to ensure your Magento database is up to speed with your changes. The important index to refresh is the Category Flat Data

Your Answer

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.