nandelbosc Posted April 19, 2013 Share Posted April 19, 2013 Hi! We're using a bash script to import categories to prestashop (1.5.4.0, clean install and multishop activated), the following tables are filled... ps_category ps_category_group ps_category_lang ps_category_shop but I can't see the categories on my frontoffice. I think it's because all the fields nleft and nright on the ps_category table are set to "0". How can I fill them? I tried calling a php file with this ... <?php include(dirname(__FILE__).'/config/config.inc.php'); Category::regenerateEntireNtree(); ?> using wget ... /usr/bin/wget -O - -q -t 1 'http://myweb.com/shop/categoriesattempt.php' but don't work... any ideas? Thank's! Link to comment Share on other sites More sharing options...
nandelbosc Posted April 19, 2013 Author Share Posted April 19, 2013 I can confirm my theory: don't work because the fields nleft and nright on the ps_category table are all set to "0" If I create a new category by hand (using backoffice) nleft and nright columns are auto filled and now I can access all my categories (one create by hand and all the other imported)! But the question is still not resolved: how can I automate the process o fill nright/nleft columns? Thank's in advance! Link to comment Share on other sites More sharing options...
tomerg3 Posted April 19, 2013 Share Posted April 19, 2013 Try also calling $category->recalculateLevelDepth(1); (or the ID of the category) 1 Link to comment Share on other sites More sharing options...
ReactionCode Posted June 1, 2013 Share Posted June 1, 2013 I can confirm my theory: don't work because the fields nleft and nright on the ps_category table are all set to "0" If I create a new category by hand (using backoffice) nleft and nright columns are auto filled and now I can access all my categories (one create by hand and all the other imported)! But the question is still not resolved: how can I automate the process o fill nright/nleft columns? Thank's in advance! You only have to enter on categories menu, edit and save one category and prestashop recalculate all the nright and nleft colums. 1 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