Jump to content

[SOLVED] Category fields 'nleft' & 'nright' & category images?


media-x
 Share

Recommended Posts

Hi,

 

1. i have to import a complex data structure, so i write a custom import script, my question is, for fields `nleft`, `nright` i give as value 0, is there any function is shop or frontend functionality to run it and get here right values?

 

2. My categorys have also a image, who can i iimport it, i found image tables for products, but can't understand the way to add images for categorys?

 

Thank you.

Share this post


Link to post
Share on other sites

The function should be:

Category::regenerateEntireNtree();

 

(a public static function)

 

 

In Back office, I believe add/delete a category or (temporarily) move a category under a new parent and then save it will rebuild the tree structure. 

(maybe make a category 'tempcat' and put it under any parent. Then save the category. Check if the left and right values are added in the database. Then delete the tempcat afterwards)

 

Hope this helps,

pascal.

Share this post


Link to post
Share on other sites

Ok. i understand, i can tell image name already in import of categories, and as told it's a custom script what i write because of complex data structure. Where i have to save this image name from category?

Share this post


Link to post
Share on other sites

So, this name of the image (i.e. full path + name) is just one of the columns in your csv file. Then in PrestaShop, you go to import csv, match the columns with the entities in PrestaShop (like first column represents Category Name, 2nd Column is description, etc, etc, and let it import.

 

(N.B. Word of caution: It's always a good idea to backup your database before every import, as a matching mistake is easily made...)

 

Look in the PrestaShop user guide for some more details on importing.

 

Good luck!

pascal

Share this post


Link to post
Share on other sites

  • 4 weeks later...

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
 Share

×
×
  • Create New...

Important Information

Cookies ensure the smooth running of our services. Using these, you accept the use of cookies. Learn More