WVW Posted July 31, 2023 Share Posted July 31, 2023 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 More sharing options...
ps8modules Posted July 31, 2023 Share Posted July 31, 2023 (edited) Hi. In the image settings administration, at the very bottom, choose image regeneration. Design -> Image Settings Edited July 31, 2023 by ps8moduly.cz (see edit history) Link to comment Share on other sites More sharing options...
WVW Posted July 31, 2023 Author Share Posted July 31, 2023 Thank you for your quick response @ps8moduly.cz I had a look in my BO and just wanted to confirm did you mean the regenerate thumbnails section at the bottom? Link to comment Share on other sites More sharing options...
ps8modules Posted July 31, 2023 Share Posted July 31, 2023 Yes. Link to comment Share on other sites More sharing options...
WVW Posted July 31, 2023 Author Share Posted July 31, 2023 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 More sharing options...
ps8modules Posted July 31, 2023 Share Posted July 31, 2023 (edited) From what I'm reading, I think the id_product and id_image in the database don't match. Find a product in the database and ps_image table. id_image is the path to the image. For example id_image = 12345: path: ./img/p/1/2/3/4/5/12345.jpg Edited July 31, 2023 by ps8moduly.cz (see edit history) Link to comment Share on other sites More sharing options...
WVW Posted August 1, 2023 Author Share Posted August 1, 2023 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 More sharing options...
musicmaster Posted August 1, 2023 Share Posted August 1, 2023 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 More sharing options...
WVW Posted August 2, 2023 Author Share Posted August 2, 2023 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! 1 Link to comment Share on other sites More sharing options...
musicmaster Posted August 2, 2023 Share Posted August 2, 2023 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 More sharing options...
ps8modules Posted August 2, 2023 Share Posted August 2, 2023 Hi @WVW If your site is up and running, you can give us a link here, or contact me via private message and I will look into your problem remotely via AnyDesk. It will be solved in a few minutes and then you will write your findings here 😉 Link to comment Share on other sites More sharing options...
ps8modules Posted August 4, 2023 Share Posted August 4, 2023 1. error was missing image types in the ps_image_type database table 2. an error in the wrong setting of permissions for folders and files 1 1 Link to comment Share on other sites More sharing options...
WVW Posted August 4, 2023 Author Share Posted August 4, 2023 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 1 Link to comment Share on other sites More sharing options...
ps8modules Posted August 4, 2023 Share Posted August 4, 2023 I gladly helped 1 Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now