Jump to content

Image to product extraction


Joanorsky
 Share

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

Share this post


Link to post
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

Share this post


Link to post
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
 Share

×
×
  • Create New...

Important Information

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