pinci Posted March 6, 2017 Share Posted March 6, 2017 Hi people have such a problem after importing products by emagic one store manager. When i create a new category so it does not show when i turn it on, in category menu, but when I open a link that reports 404 Not Found.I noticed in database that left n = 0 and n = right 0 . Any ideas? web is www.workie.sk thx. Link to comment Share on other sites More sharing options...
rocky Posted March 7, 2017 Share Posted March 7, 2017 Try creating a file like regenerate.php in your website's root, then enter the following: <?php require(dirname(__FILE__).'/config/config.inc.php'); echo 'Regenerating tree...'; Category::regenerateEntireNtree(); echo 'done'; You can then go to http://www.yoursite.com/regenerate.php to regenerate the ntree values. If you see "Regenerating tree...done", then it worked. You can then delete regenerate.php. 1 Link to comment Share on other sites More sharing options...
pinci Posted March 7, 2017 Author Share Posted March 7, 2017 Try creating a file like regenerate.php in your website's root, then enter the following: <?php require(dirname(__FILE__).'/config/config.inc.php'); echo 'Regenerating tree...'; Category::regenerateEntireNtree(); echo 'done'; You can then go to http://www.yoursite.com/regenerate.php to regenerate the ntree values. If you see "Regenerating tree...done", then it worked. You can then delete regenerate.php. Thx, Regenerating tree...done but does not work . Still n values are 0 Link to comment Share on other sites More sharing options...
rocky Posted March 8, 2017 Share Posted March 8, 2017 Strange. It works fine on my PrestaShop v1.6.1.11 test site. Perhaps there's code preventing the function working? Check whether override/classes/Category.php exists and the regenerateEntireNtree() function hasn't been overridden. Are your level_depth values 0 too? If so, you can run the following to regenerate the level depths too: <?php require(dirname(__FILE__).'/config/config.inc.php'); echo 'Regenerating tree...'; Category::regenerateEntireNtree(); echo 'done<br />'; echo 'Recalculating level depths...'; $category = new Category((int)Configuration::get('PS_ROOT_CATEGORY')); $category->recalculateLevelDepth($category->id); echo 'done'; Link to comment Share on other sites More sharing options...
pinci Posted March 13, 2017 Author Share Posted March 13, 2017 Strange. It works fine on my PrestaShop v1.6.1.11 test site. Perhaps there's code preventing the function working? Check whether override/classes/Category.php exists and the regenerateEntireNtree() function hasn't been overridden. Are your level_depth values 0 too? If so, you can run the following to regenerate the level depths too: <?php require(dirname(__FILE__).'/config/config.inc.php'); echo 'Regenerating tree...'; Category::regenerateEntireNtree(); echo 'done<br />'; echo 'Recalculating level depths...'; $category = new Category((int)Configuration::get('PS_ROOT_CATEGORY')); $category->recalculateLevelDepth($category->id); echo 'done'; Thx for your response. Regenerating tree...done Recalculating level depths...done but still 0 . And in override/classes/Category.php category.php does not exist , is it problem? Link to comment Share on other sites More sharing options...
rocky Posted March 14, 2017 Share Posted March 14, 2017 No, it's normal to not have override/classes/Category.php. Sorry, I have no more ideas on how to help. The script works perfectly for me. I don't understand why it isn't working for you. Link to comment Share on other sites More sharing options...
Iryna Posted March 14, 2017 Share Posted March 14, 2017 Hi people have such a problem after importing products by emagic one store manager. When i create a new category so it does not show when i turn it on, in category menu, but when I open a link that reports 404 Not Found.I noticed in database that left n = 0 and n = right 0 . Any ideas? web is www.workie.sk thx. Hello Have you imported category tree with Store Manager or categories with products? Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now