Jump to content

How to map the uploaded images with the products, using mysql


Recommended Posts

I have loaded 300,000 images into my prestashop "img/pic" folder using FTP. I also imported products using phpMyadmin in bulk.


Now i've no idea how to map these images with the related products. I can't map them manually.


I've worked in opencart, magento and wordpress. Everything is pretty easy, if i put the correct path and file names in the mysql table it will work straight away. But here i'm stuck :(


Please someone suggest me something?


Thank you in advance.



Link to comment
Share on other sites

  • 2 months later...

Hi karthikram,


unfortunately, but by this situation it's only one way. You have to change the structure of the image picking.


I have done differently.

For each image I gave ID. For ex: 358.

Prestashop takes pictures by this way: ..img/p/3/5/8/358-home_default.jpg

Pay attention that image ID which is in database are part of this path. One digit of ID number = one folder in path. So if you have a four digit ID, you'll have 4 folders in path. If two digits - 2 folders. etc.


Do not forget that the ID is also in the title of image.


There're 7 images with different names in folder and one in template dir (..img/tmp/) wich name should be product_mini_(ID of image)_1.jpg



* give ID for image

* insert necessary information in database (tables: yourPrefix_image, yourPrefix_image_lang, yourPrefix_image_shop,)

* upload images with given ID



 ID: 47865

 Insert data in database

 Upload image in dir: ../img/p/4/7/8/6/5/

 With names: 47865.jpg, 47865-large_default.jpg, 47865-thickbox_default.jpg, 47865-cart_dafault.jpg, 47865-medium_default.jpg, 47865-small_default.jpg, 47865-home_default.jpg.

 And don't forget upload image in dir: ../img/tmp/

 With name: product_mini_47865_1.jpg



Link to comment
Share on other sites

Hi Tadas,


Thank you for your reply. yeah i understood this finally, finally i prepared the csv with ID, Image path's and uploaded into prestashop again through their same import csv option. it took time to upload but worth it finally its all mapped with the products correctly.

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