Jump to content

Product images not showing in Front Office


WVW

Recommended Posts

Hi

I run PS 1.7.8.8 and have added some products. The problem I have noticed is the images are not showing in the FO. It turned out this looks like a common problem in PS as I found a lot of sites giving solutions to this problem (as posted further down below).

In the BO I can see the images show under the list of products page and when clicking on a product to edit it the image also shows.

I have uploaded high quality images for each product and not sure if this would be part of the problem. Although I have tried using PNG and JPEG images to see if this would make a difference but unfortunately not.

Before posting this I have done some reading up and tried the following:

Renamed the .htaccess file in root

Disable friendly url then reload the FO images (still not showing) the enable friendly url then reload the FO still not showing images even though tried with different device and using a different internet connection. .htaccess file was recreated after doing the above and is showing a much smaller size than the original file.
This was the URL for the above solution

Changed use jpeg to use PNG under PS BO image settings. Reduced PNG compression from 7 to 5 as per PS help
From PS help: https://docs.prestashop-project.org/1.7-documentation/user-guide/improving-shop/customizing-store-design/image-settings

Generate High resolution images set to No already so changed to yes. Enabled force update of friendly URL's
Also read that the watermark on images module can do this but I don't have that module installed

One site advised to check the images are in the /img/p/* folders. I am able to see the images from the img/p/* folders using file manager (from the cpanel) but these folders have only 1 image each. From PS help the shop is supposed to have all the sizes for the various display sizes (like thumbnail & large image in the folder) in each folder although I stand to be corrected on this.

Also from PS help site I looked at the different images and their respective sizes. For small image the setting is 98 x 98 pixels. I created a 98 x 98 pixel sized image and uploaded that to one of the products but still not showing. So I went through the steps of disable friendly URL then cleared cache. Refreshed the FO website but still no images showing. Then enabled friendly URL and refreshed the FO site and still no images showing.

I am not sure what else I can try? I am not a PS pro so I don't know if I can or should edit any of the BO files but if that will solve this problem I am happy to give it a try.

Can someone please help?

Thanks in advance

Link to comment
Share on other sites

After I replied to your response I decided to try the regenerate thumbnails button so I selected products, all enabled the erase previous images button and hit the regenerate thumbnails button, but still no luck. I then cleared the cash in thebBO and went back doing the above steps again and same outcome.

Link to comment
Share on other sites

Having looked at the DB tables I think you hit the nail on the head.

In the ps_product table I can see id_product 2 and id_product 3 (which is correct as I only have 2 products listed), there is no id_image column.

I also looked at the ps_image table

It only shows 4 columns: id_image, id_product, position, cover no other columns
The id_image column shows 20 next to 3 where 3 is under id_product column and a second line shows 22 also next to 3 under id_product column
These look correct as I only have 2 images for product 3 but nothing about any paths in that table

This had me look at the folders for the images. I found under img/p folders named 1 to 9 which appears to coincide with the 9 images for product 2 however under folder name 2 it has 2 subfolders namely 0 and 2. When I look under subfolder 0 it shows the product image for product 3 and subfolder 2 shows the cover image of product 3.

From what I can see it looks like there is no link between the DB and the images

Link to comment
Share on other sites

It keeps amazing me how lazy people are.

The logical thing to do when images don't show is to look whether they are there. Disable pretty urls. And then look at the image links in the page ("page source" or "inspect" in your browser). And then look whether the mentioned files are actually there.

Link to comment
Share on other sites

Thank you for the reply @musicmaster!

I just want to confirm your reference to pretty urls do you mean friendly urls? Sorry for sounding so clueless, as I said in my original post I am not a PS Pro. thanks to you and @ps8moduly.cz for helping me!

I checked the page source for the products but those image names are not showing as I cannot find any of the picture names like 1.jpg or 20.jpg etc

Is there a way to somehow link the images in the PS folder to the tables on the DB?

Again thanks for any help!

  • Like 1
Link to comment
Share on other sites

36-community-theme-default_home_default/prestools-super-package.jpg

3 minutes ago, WVW said:

I just want to confirm your reference to pretty urls do you mean friendly urls?

Seems rather obvious to me. Please invest time before you ask. It feels like you are wasting my time by asking for the obvious.

The url of a pretty image looks like this:  /36-community-theme-default_home_default/prestools-super-package.jpg

In this format 36 is the image number (you can find the image under /img/p/3/6/36-community-theme-default_home_default.jpg)

prestools-super-package is just the product name.

When you disable this the image url will become: /img/p/3/6/36-community-theme-default_home_default.jpg

The exact name depends on your theme and the format used at that place of the template.

Link to comment
Share on other sites

Firstly a big shoutout to @ps8moduly.cz for helping me with fixing this problem

From the PS BO images when right clicking on an image and selecting inspect it showed the image name as 1-home_default.jpg which was incorrect

Opened the image in a new tab w/ error image not found

Correcting the name to what is loaded on PS BO the image showed in the new tab

Looking under ps_image_type in the DB showed nothing

This was corrected w/ a few entries pasted and saved

From PS regenerated thumbnail section: Selected products below that all and selected erase thumbnail button

This showed up cannot write to the directory

Changed the folder permissions and checked again and the images are now showing!

Big thanks for your help @ps8moduly.cz

  • Like 1
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...