Jump to content

in what table is the reference to the product image file name??


ctech

Recommended Posts

  • 3 months later...

There is no direct image name used in PrestaShop. We developed the code under FileMaker 11, and other software pieces, to create the proper PS images, the image names, and FTP them to the right location.

It is a bit tricky to do it right, especially all of the image processing thta is needed to resize/reshape images into the varios image types that PS uses.

Unfortunately, my code is not ready for release at this time.

Joe

Link to comment
Share on other sites

  • 5 years later...

What exactly are you looking for?

Prestashop only stores the ids, coming from the table ps_image

 

echo 'id.'-large_scene.jpg" />

';

So, the images are like 1-large.jpg

 

 

The image folder is inside shop/img

 

Using your comment I was able to extract the image URL's from Database which I guess was needed by some other people as well, here I will share the simplified SQL code that can do the job;

 

select pp.reference as partNumber, concat('http://YOURSHOPNAME.com/', im.id_image, '-home_default/', pp.reference,'.jpg') as img_link 
from ps_product pp
join ps_image im on (im.id_product = pp.id_product)
where pp.active = 1
This will generate a table with product reference as one column and URL to image of the product as the other column. 
YOURSHOPNAME.COM: should be replaced with your shop's domain.
-home_default: can be replaced with any other image format you might need, i.e. 'large' ...
 
Hope it helps,
  • Like 2
  • Thanks 2
Link to comment
Share on other sites

  • 8 months later...
  • 4 years later...
On 4/14/2016 at 7:11 PM, eec said:

 

Using your comment I was able to extract the image URL's from Database which I guess was needed by some other people as well, here I will share the simplified SQL code that can do the job;

 


select pp.reference as partNumber, concat('http://YOURSHOPNAME.com/', im.id_image, '-home_default/', pp.reference,'.jpg') as img_link 
from ps_product pp
join ps_image im on (im.id_product = pp.id_product)
where pp.active = 1
This will generate a table with product reference as one column and URL to image of the product as the other column. 
YOURSHOPNAME.COM: should be replaced with your shop's domain.
-home_default: can be replaced with any other image format you might need, i.e. 'large' ...
 
Hope it helps,

Thanks just what I was looking for, I already have the product images.
Now I have a question how can I make them have the real order that is on the web, since the csv extracts the images of products out of order (in order of upload) but not in order within the article.

And another question, how to extract the images from the Categories and Subcategories?

The post is years old but that exact sql data is of great value to achieve this.
Thank you!

 

SPANISH / ESPAÑOL

Gracias justo lo que buscaba, ya tengo las imagenes de productos.
Ahora tengo una pregunta como puedo hacer que tengan el orden real que esta en la web, dado que el csv extrae las imágenes de productos desordenado (por orden de subida) pero no por orden dentro del artículo.

Y otra duda como extraer las imágenes de las Categorías y Subcategorías?

El post tiene años pero es de gran valor ese dato de la sql exacta para lograr esto.
Mil gracias! 

 

Link to comment
Share on other sites

  • 1 year later...

Hello, does anyone know how to get the main image, because by im.id_image the one with the lowest id appears, but not the main one :S

Spanish:

Hola, alguien sabe como coger la imagen principal, por que por im.id_image aparece la que tiene menor id, pero no la principal :S

Edited by seron (see edit history)
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...