Jump to content

How to fill nleft/nright after import categories


Recommended Posts

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

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

  • 1 month later...

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.

  • Like 1
Link to comment
Share on other sites

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...