6

I am using magento copy category extension, this extension copies categories successfully.

But on Manage Product page in Categories tab, sub-categories of the original category (that i copied) disappears from the category tree. The copied categories are ok. But when i add a sub category manually to the original category, it solves the problem and subcategories appears.

It shows that sub-categories were not disturbed by the module but problem arises from somewhere else.

Any Suggestions?

Edit

Category page-Fine Product Page- Error

Thanks in advance for your help

5
  • are copied subcategories visible elsewhere? maybe below the whole list of category? what exactly you are seeing add product page >category tab. ?
    – echoashu
    Sep 4, 2014 at 12:02
  • @echoashu Updated Question with screen shots
    – Haris
    Sep 4, 2014 at 12:15
  • did you rebuild the indexes.. after copying and checked whether they are active or not ?
    – echoashu
    Sep 4, 2014 at 12:55
  • @echoashu Neither manual nor programmatic re-index works. used this code after copy but of no help. '$indexCollection = Mage::getModel('index/process')->getCollection(); foreach ($indexCollection as $index) { $index->reindexAll(); }'
    – Haris
    Sep 4, 2014 at 13:00
  • Like same i have 2 stores, i have cloned my category tree, but store 2 website category tree not shown on the website.
    – zus
    Dec 22, 2017 at 5:25

1 Answer 1

7

Maybe there is inconsistency data which was caused by custom module.

You can check catalog table catalog_category_entity with help of query

SELECT c.entity_id, c.children_count as original_children_count, COUNT(c2.children_count) as `children_count`, c.level as original_level, (LENGTH(c.path)-LENGTH(REPLACE(c.path,'/',''))) as `level`
FROM catalog_category_entity c
LEFT JOIN catalog_category_entity c2 ON c2.path like CONCAT(c.path,'/%')
GROUP BY c.path

and if it will needed (just compare results), then fix with help of following query

INSERT catalog_category_entity(`entity_id`,`children_count`, `level`)
SELECT c.entity_id, COUNT(c2.children_count) as `children_count`, (LENGTH(c.path)-LENGTH(REPLACE(c.path,'/',''))) as `level`
FROM catalog_category_entity c
LEFT JOIN catalog_category_entity c2 ON c2.path like CONCAT(c.path,'/%')
GROUP BY c.path
ON DUPLICATE KEY UPDATE `children_count` = VALUES(`children_count`), `level` = VALUES(`level`);
0

Your Answer

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

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