Jump to content
Benn

Product image ( where is stored )?

Recommended Posts

I would like to know, after I add product to database, where is stored path to product image? I searched all database but didn't found it. If product image path is stored not in DB then where? Thx

Share this post


Link to post
Share on other sites

you didn't understand my question. I from where is script reading that img is in img/p/ dir

  • Like 1

Share this post


Link to post
Share on other sites

ok . so you want to find out the path to an image?

explain what you want to do with that path maybe i can understand better what you are trying to do

Share this post


Link to post
Share on other sites

Example: in this code from homefeatured.tpl

getImageLink($product.link_rewrite, $product.id_image, 'large')}" height="260px" width="300px" alt="{$product.legend|escape:html:'UTF-8'}" />



And here is function from Link.php in classes directory

    public function getImageLink($name, $ids, $type = null)
   {
       return ($this->allow == 1) ? (__PS_BASE_URI__.$ids.($type ? '-'.$type : '').'/'.$name.'.jpg') : (_THEME_PROD_DIR_.$ids.($type ? '-'.$type : '').'.jpg');
   }

  • Like 1

Share this post


Link to post
Share on other sites

Images from categories and products are stored in :

categories : /img/c
products : /img/p

All images are named with the ID in its name. So if your category iPods has ID 2 then the image name is 2.jpg
etc etc

  • Like 1
  • Thanks 1

Share this post


Link to post
Share on other sites

Hai

Anyone know the manual sql query to get image of a product.

ie: id_product=1 and i need image of this product.

Share this post


Link to post
Share on other sites

There is no sql query because the image is not stored in the database. The image is in a directory and is stored as an ordinary file :(

Edited by jwzumwalt (see edit history)
  • Like 1

Share this post


Link to post
Share on other sites

i think that he said about an url to product, and he asked about how to get it, but i might be wrong

Share this post


Link to post
Share on other sites

There is no sql query because the image is not stored in the database. The image is in a directory and is stored as an ordinary file :(

 

Yen now all i understood :)

It's funny way to get a product path

Share this post


Link to post
Share on other sites

Hai

I need to insert a customer manually using phpMyadmin.

I have already inserted all details in to table 'ps_customer' but when login with that id it cannot showing all layout clearly..means not showing header, all menus and side bars.

any one can help me please ?

Edited by muhsinap (see edit history)

Share this post


Link to post
Share on other sites

Hi to all,

 

So all images related to products are in the img/p folder and all those related to categories are in img/c folder under public_html on the server right?

 

So only way to get local copy (backup) of those images would be to download the whole folders to a local hdd?

 

I guess I'll use cPanel file manager instead of FileZilla as I can make archive and download the whole archive instead of downloading image by image using FTP.

 

Please correct me if Im wrong.

 

P.S. I guess I'll be downloading all images including original ones.

How can I simply get only original ones into a separate folder?

 

Ty in advance for the time and efforts.

Dean

Share this post


Link to post
Share on other sites

Hi,

in /img/p path there isn't all products' images, where can I found all the images?

 

thanks

Matteo

Share this post


Link to post
Share on other sites

there are all product images, especially in subdirectories /img/p/1/ img/p/2/ img/p/3/ etc.

Share this post


Link to post
Share on other sites

thanks for the reply  vekia!

there are some images that I can't find, there aren't even in the subdirectories :(

Share this post


Link to post
Share on other sites

@vekia, refresh the page, I have some problems with the hosting :(

 

@Nemo1 there isn't the folder 870, above the screenshot of the folders that I have in P directory

 

p-folder.png

Share this post


Link to post
Share on other sites

hmmm! Prestashop version? Can you check in preferences, products in the back office, and see if you are using the "Legacy filesystem"?

Share this post


Link to post
Share on other sites

That's why then. Set it to NO, then go to images, preferences and move all images. If they still don't display, regenerate all of them

Share this post


Link to post
Share on other sites

Thank you very much!! I do this operation!

I have a question: if I do this steps, do I lost some images or link?

Share this post


Link to post
Share on other sites

Links from within the store will be regenerated. As they are rewritten, they will *probably* stay the same, but to be honest I don't remember what ps 1.4 used to do!

Share this post


Link to post
Share on other sites

your website is under maintenance mode, so in effect we cant check it.

Share this post


Link to post
Share on other sites

Hai

I need to insert a customer manually using phpMyadmin.

I have already inserted all details in to table 'ps_customer' but when login with that id it cannot showing all layout clearly..means not showing header, all menus and side bars.

any one can help me please ?

 

Try updating the shop_id and the shop_group_id.

Also you should try logging-in from another browser (free cache).

Share this post


Link to post
Share on other sites

Hi, 

 

I'm also loking for place where is path to original image.

 

I need it for exporting to other shops and I need it without white space around picture. We can get picture, but it is in this format

http://www.trgovina-figura.si/16214-thickbox/zenska-obleka-k007.jpg whish is unusable for this purpose. 

 

I need in such path http://www.trgovina-figura.si/img/p/4/3/16214.jpg which is absolute path to picture ( in this case it is not correct)

 

How to get this path to picture?

Best regards 

 

Martin

Share this post


Link to post
Share on other sites

Try regenerating your htaccess file from the seo and urls tab, just hit the save button there

Share this post


Link to post
Share on other sites

Suppose If the image id of the product is 870....

 

you will need to go to img/p/8/7/0 and you should see the image :)

 

 

You will get the image id of the product in the the ps_image table in the database.

Edited by JoelWebsites (see edit history)

Share this post


Link to post
Share on other sites

from what i have seen it is one of 2 locations. 1st it should be theme/img/p . if not there, check rootfolder/img/p . reason i say this is cos i had multistore and was url rewritten in htaccess so i was consfused. also if you have a module, it can be in either a) themes/modules/moduleName/img or B) a) root/modules/moduleName/img hope this helps

Share this post


Link to post
Share on other sites

Try regenerating your htaccess file from the seo and urls tab, just hit the save button there

Hi Nemo. You are the smartest here)) do you know how to get all image links of 1 product. I have this code

concat( 'http://', ifnull( conf.value, 'marm.pl' ) , 
'/img/p/',mid(p.id_product,1,1),'/', 
if (length(p.id_product)>1,concat(mid(p.id_product,2,1),'/'),''),
if (length(p.id_product)>2,concat(mid(p.id_product,3,1),'/'),''),
if (length(p.id_product)>3,concat(mid(p.id_product,4,1),'/'),''),
if (length(p.id_product)>4,concat(mid(p.id_product,5,1),'/'),''), 
p.id_product, '.jpg' ) AS url_image

and it takes only main image. But how to get 2nd, 3rd image links?

Share this post


Link to post
Share on other sites

You're too kind, especially cause I am no SQL [spam-filter] at all :) I take it as you are not using url rewriting there?
As far as I know you'd need a subquery to grab all image ids from the image tab, there id_product equals yours

Share this post


Link to post
Share on other sites

Hi,

I got my website backup & found the p folder where all images saved. But my aim is to link my exported products with the image name. Example pepsi product has ID1000 but the picture name not the same?! Anyone can tell me does image number represnt?

Share this post


Link to post
Share on other sites

if you have set up google sitemap then you have inside picture url

Share this post


Link to post
Share on other sites

in your database you can find the table called ps_image where you can find the association with images and products.

for example you have for product ID 1000 an image with id 1234 you can found all images size in

/img/p/1/2/3/4/

(one folder for each number of the id)

in this folder you can find always the file 1234.jpg 

and also the other image size you associate for the product (for example 1234-home_default.jpg)

Share this post


Link to post
Share on other sites

Hi,

I got my pictures as attached in above post, but the problem is that I need these pictures in one folder only and not subfolders..., please advise?

BR//

Share this post


Link to post
Share on other sites

if you need to have all images in one folder, if you have a windows pc you can do those steps:
- create a new folder you'll use to put all images

- open img/p

- search *.jpg

- copy all images showed in the search result

- paste the image in the new folder

Share this post


Link to post
Share on other sites

Thanks for your advice, its works, but why I have for each product multiple pictures (six pictures)? How can i delete duplicates or only get certain image name.

Please check attachment.

19-Feb-19 4-12-11 PM.png

Share this post


Link to post
Share on other sites

you're welcome!

if you don't need other image you can search

cart_default

home_default
large_default

etc

 

and delete all the results

Share this post


Link to post
Share on other sites
On 2/19/2019 at 5:41 AM, mma87 said:

in your database you can find the table called ps_image where you can find the association with images and products.

for example you have for product ID 1000 an image with id 1234 you can found all images size in

/img/p/1/2/3/4/

(one folder for each number of the id)

in this folder you can find always the file 1234.jpg 

and also the other image size you associate for the product (for example 1234-home_default.jpg)

this answer solved my problem, now I am able to create direct link to image.... check in ps_image for the id_image and from there you can create the link, thank you !!

Share this post


Link to post
Share on other sites

Thank you for your reply.

But actually what you have mentioned is important & I know it. But my problem is that I have a list of products which I need its images. Doing what you've mentioned is a headache, is there a way to automate this in an easier way to help extract an only a specific group of image IDs?

 

Regards,

Share this post


Link to post
Share on other sites
On 5/22/2019 at 10:22 PM, leobardo said:

this answer solved my problem, now I am able to create direct link to image.... check in ps_image for the id_image and from there you can create the link, thank you !!

You're welcome!

Share this post


Link to post
Share on other sites
On 5/23/2019 at 4:00 AM, Moodi said:

Thank you for your reply.

But actually what you have mentioned is important & I know it. But my problem is that I have a list of products which I need its images. Doing what you've mentioned is a headache, is there a way to automate this in an easier way to help extract an only a specific group of image IDs?

 

Regards,

An easy solution, if you have a list of IDs is using an excel file, but you have to know excel functions

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.
Note: Your post will require moderator approval before it will be visible.

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