Jump to content

Prestashop Product image folder definition


fordtman

Recommended Posts

Does anyone have any information about the product images folder setup (img->p->......)? I cannot find any information about the criteria Prestashop uses when it creates the image sub-folders. I know that when an image is added to a product, Prestashop changes its name and places it and the other associated images it generates in a specific folder e.g. image "130.jpg" is in folder img->p->1->3->0, However I would like to know what the sub-folders 1, 2, 3 refer to, they do not seem to be related to categories or other product attributes. I have seen some products added to the img->p->1 level and others added to other levels. What are the factors used to create the sub-folders of img->p and how are they applied to a product image.

 

Hope this is clear. Thank you in advance for any help.

Link to comment
Share on other sites

Thanks for replying, I guess what I really wanted to know was where is id_image set up. I have been trying to determine what criteria Prestashop uses when it creates the image name. It looks as though the RewriteRules in .htaccess convert the filename into the full path name. I am using Prestashop 1.6.1.4.

Link to comment
Share on other sites

I think I have figured this out. I have been looking too deeply into this and was expecting to find something devious when it appears that it is quite obvious. I started with a clean database and added products and checked how they were named and it appears that "id_image" is incremented for each added image (1,2,3....) and the name is then dissected to determine which directory the image is stored in, e.g. image 123.jpg is stored in directory p->1->2->3, image 11.jpg is stored in p->1->1 etc. If after adding 3 products with images you then add another image to one of these products this new image is given the next sequential number and it has nothing to do with the product ID (which I would have thought would be the more sensible way to store images, but some people may want the same image for different products). Anyway I shall close this query and mark it as solved. Thank you all for your support.

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...