Jump to content

Recommended Posts

Hello.

I have a question if someone can answer this for me.

 

regarding the image system on my ftp /img folder. i always assumed that the /p/1/2/3 is the folder for product with the id 123. 

 

i guess is not like that. cause i have images scrambled in all folders that have nothing to do with the id of the product.

 

in fact if i upload a new image on a product. that image is given an id like 789.jpg that is found on the folder p/7/8/9/789.jpg. even if the product id is 123.

 

and the next image is given 790.jpg. and 791,792 and so one

 

my question now is. how do i relate an product with a folder on the ftp.

 

i say this cause i tried regenerating some images and it gives me some: Original image is missing or empty (/home/public_html/site/img/p/6/5/2/652.jpg)

 

now i know that in the folder /6/5/2 there is no image (it tells me that), but i don't know what product is referring to. if a have like 1000+ products is kinda hard to find the ones 40 errors where the image didn't get imported from my csv.

 

so anyone?!

 

Thank you.

Share this post


Link to post
Share on other sites

it is not the ID of the Product, it is the ID of the image.  Since a product can have multiple images, the Product ID cannot be used, since it is not unique.

 

So if you have an image, then the image will be assigned an ID, let us say 123.  The image would be store as /img/p/1/2/3/123.jpg

Share this post


Link to post
Share on other sites

thanks for your reply.

 

yes i know that (figured it out as stated)

 

my question: how can i know what folder is for what product?!

 

thanks

Share this post


Link to post
Share on other sites

Hello.

 

The association you 're looking for seems to be stored in the shop's database. Specifically, the "ps_image" table...

Share this post


Link to post
Share on other sites

simply looking at the folder or file name you cannot.  you have to take the image id from the filename, and then back trace to find the product id as parsifal states above.

Share this post


Link to post
Share on other sites

Another solution I noticed is to view the products on the Prestashop back office and check which have missing images, click on one of the products with missing images, go to the images tab and "Right click + Copy Link Location" this will give you the directory path you are looking for and not the friendly URL.

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


×
×
  • Create New...

Important Information

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