Jump to content

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

Link to comment
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
Link to comment
Share on other sites

  • 3 years later...

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)
Link to comment
Share on other sites

  • 4 months later...

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

Link to comment
Share on other sites

  • 1 month later...
  • 3 months later...
  • 2 weeks later...

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

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

Link to comment
Share on other sites

  • 10 months later...
  • 1 month later...
  • 4 months later...

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

Link to comment
Share on other sites

  • 3 months later...

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?

Link to comment
Share on other sites

  • 3 years later...

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?

Link to comment
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)

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

Link to comment
Share on other sites

  • 3 months later...
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 !!

  • Like 1
Link to comment
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,

Link to comment
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!

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

Link to comment
Share on other sites

  • 10 months later...
On 3/9/2010 at 4:59 PM, Benn said:

I would like to know, after I add product to Showbox jiofi.local.html tplinklogin 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

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?

Edited by diondlemarcu (see edit history)
Link to comment
Share on other sites

  • 9 months later...

If anyone still need this, try:

SELECT
    p.id_product,
concat( 'https://yoursite.url/img/p/',mid(`i`.`id_image`,1,1),'/', 
if (length(`i`.`id_image`)>1,concat(mid(`i`.`id_image`,2,1),'/'),''),
if (length(`i`.`id_image`)>2,concat(mid(`i`.`id_image`,3,1),'/'),''),
if (length(`i`.`id_image`)>3,concat(mid(`i`.`id_image`,4,1),'/'),''),
if (length(`i`.`id_image`)>4,concat(mid(`i`.`id_image`,5,1),'/'),''), 
`i`.`id_image`,'-large_default.jpg') AS image
FROM
    `ps_product` `p`
JOIN `ps_image` `i` ON `p`.`id_product` = `i`.`id_product`
WHERE
    `i`.`cover` = 1

 

 

Last WHERE will only show the cover images, remove to show ALL image urls.

  • Like 1
Link to comment
Share on other sites

  • 2 months later...

ger

On 1/29/2021 at 11:00 PM, SebyM said:

If anyone still need this, try:

SELECT
    p.id_product,
concat( 'https://yoursite.url/img/p/',mid(`i`.`id_image`,1,1),'/', 
if (length(`i`.`id_image`)>1,concat(mid(`i`.`id_image`,2,1),'/'),''),
if (length(`i`.`id_image`)>2,concat(mid(`i`.`id_image`,3,1),'/'),''),
if (length(`i`.`id_image`)>3,concat(mid(`i`.`id_image`,4,1),'/'),''),
if (length(`i`.`id_image`)>4,concat(mid(`i`.`id_image`,5,1),'/'),''), 
`i`.`id_image`,'-large_default.jpg') AS image
FROM
    `ps_product` `p`
JOIN `ps_image` `i` ON `p`.`id_product` = `i`.`id_product`
WHERE
    `i`.`cover` = 1

 

 

Last WHERE will only show the cover images, remove to show ALL image urls.

Great works fine !|

Link to comment
Share on other sites

  • 1 year later...

Hello friends I'm kind of new in Prestashop
so a Hook to open a new field to add icons in categories !
how do I do to be able to save image or icon format in the database 
because first I did a text field and that if you can save but I think to save image is already something different 
thank you so much for your help!

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