Jump to content

Image to product extraction


Recommended Posts

Hi guys..
i have a problem. I am not been able to find the database field where the product's image location is stored.. and it seems to me that probably the images are not even stored on database (not the binary file or the image location). So.. my problem consists on the following... I need to extract all product images on my prestashop installation and in some form correlate them with the product's ID. Same thing should happen with extra images.

I would need something like : product_id -> Image1.jpg; extra_image1.jpg; extra_image2.jpg;

... and so on..

Any help? Any direction you could point me out.. i would be very thankful...

Link to comment
Share on other sites

product images are stored in /prestshop/img/p/ ...the file names are $image_id-$product_id-$size.jpg (i think)
there's a table in the database that tells prestashop to associate images with products, it just has image id and product id as columns.

I'm not entirely sure what it does as i'm not looking at the code right now, but i assume there is just some sql/php that builds the image url within product.php ...it obviously pulls a whole lot of data from multiple tables when it shows a product.. the imageid and product id would be part of the array, allowing it to parse something like $product['id']-$product['imageid']-large.jpg

theres also some kind of check as to whether records exist for the images.. if you delete from the image_product table then it displays the default image, regardless of whether the appropriate file exists in the img/p folder

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