Categories

Featured templates

PrestaShop 1.6.x. How to fix missing product images issue

Alice Weasley February 17, 2015
Rating: 5.0/5. From 3 votes.
Please wait...

This tutorial shows how to fix missing product images issue in PrestaShop 1.6.x.

PrestaShop_1.6.x._How_to_fix_missing_images_issue_for_products

Today we will explain how you can fix empty images issue that occurs in PrestaShop at times. By empty images we imply those pictures which are indexed in the database, but which files are not physically located on server. In such cases users will see a gray question mark instead of a placeholder with the caption that the product image is not available.

There are many reasons that can cause the issue.

Top reasons:

  • upgrading to 1.6.x PrestaShop version from the previous one (1.4.x, 1.5.x);
  • server settings;
  • wrong file location;
  • insufficient permissions;
  • friendly URL enabled;
  • third party modules installed.

To fix missing images issue, please follow the steps below:

  1. The first thing you need to check is if the images are really in the location set for the product (we suppose that the image was already checked in the Image tab of your product in the admin).

    In order to check the location of your image, you can use Mozilla Firebug Plugin:

    PrestaShop_1.6.x._How_to_fix_missing_images_issue_for_products_1_1

    When you know the location, check it on your server through FTP or on your hosting cPanel.

    If you cannot see the file in the path set for a product, you need to upload your image to exactly the same location. After that your image should appear.

  2. If the image still does not appear (though it really exists in the set path), you need to change permissions in img folder to 777, as sometimes the default server permissions 755 for folders and 644 for files are insufficient for the /img/ folder:

    PrestaShop_1.6.x._How_to_fix_missing_images_issue_for_products_2

  3. Another useful thing to do, especially if the question mark images appeared after uploading new images, is regenerating thumbnails.

    To do it, you need to log into your admin panel and go to Preferences -> Images section and click Regenerate thumbnails button in Regenerate thumbnails section.

    NOTE: regenerating thumbnails can take a lot of hours depending on the number of images you have. Try to choose the good moment to do it:

    PrestaShop_1.6.x._How_to_fix_missing_images_issue_for_products_3

  4. Enabling Friendly URL feature can also bring the problem of missing images for products.

    In order to check it, you need to log into your admin panel and go to Preferences -> SEO & URLs and scroll down to Set up URLs section to disable Friendly URL. Sometimes you will need to turn off Redirect to the canonical URL as well:

    PrestaShop_1.6.x._How_to_fix_missing_images_issue_for_products_4

  5. One more widespread reason causing the issue is third party module(s) installed.

    So, if you have installed any modules, go to Modules -> Modules in your admin and disable the module(s):

    PrestaShop_1.6.x._How_to_fix_missing_images_issue_for_products_5

  6. The fact that your files cannot be found can be the result of upgrading. The versions below PrestaShop 1.6 use ‘home’ in the string, while PrestaShop 1.6 uses ‘home_default’. Since some of your files can still use ‘home’ as a path and PrestaShop 1.6 has ‘home_default’ instead of it, the files cannot be found because ‘home’ no longer exists. You need to locate all the instances using ‘home’ and replace them with ‘home_default’. Usually, they are /themes/default-bootstrap/product.tpl, product-list.tpl, product-compare.tpl but there can be more files.

    We strongly recommend that you back up your files before editing them, so that you can always revert the changes in case something goes wrong:

    PrestaShop_1.6.x._How_to_fix_missing_images_issue_for_products_6

    Please note that upgrade within different lines of versions are not recommended as newest versions have updates of files that can be incompatible with yours and if you still want to do it, back up your database first.

  7. Deleting and regenerating the .htaccess file can solve the problem.

    In order to do it, delete the .htaccess file from the your root directory on the server using FTP or in cPanel (do not forget to make a backup of the file first) and go to Preferences -> SEO & URLs and scroll down to Set up URLs section. First, set Friendly URL to No and then set it back to Yes:

    PrestaShop_1.6.x._How_to_fix_missing_images_issue_for_products_7_1

    PrestaShop_1.6.x._How_to_fix_missing_images_issue_for_products_7_2

  8. Create a tools.php file in override/classes and paste the following code in it:

        <?php
        class Tools extends ToolsCore
    { public static function apacheModExists($name) { return true; } }

    PrestaShop_1.6.x._How_to_fix_missing_images_issue_for_products_8

    If the file already exists, copy-paste the code without the <?php. Be sure to make a back up first if you modify the existing file.

    You may also need to go to SEO URLs to turn them off and on (as described in step 4).

You may also need to clear Smarty cache after saving the changes:

PrestaShop_1.6.x._How_to_fix_missing_images_issue_for_products_fixed

Please note that the above described methods may not always help depending on the circumstances and environment of your PrestaShop site. In this case, we recommend that you visit PrestaShop official forum or/and contact your hosting provider.

Premium Prestashop Themes
This entry was posted in PrestaShop Tutorials and tagged image, missing, Prestashop, product. Bookmark the permalink.

Submit a ticket

If you are still unable to find a sufficient tutorial regarding your issue please use the following link to submit a request to our technical support team. We'll provide you with our help and assistance within next 24 hours: Submit a ticket