How to show cover image of your product with combination in PrestaShop 1.7?

In e-Commerce business, Product image is a vital aspect, to attract a visitor’s eye in the first place. In PrestaShop 1.7, If you have combination product then PrestaShop shows image of the one selected by default in product combination instead of the generic (Cover) image of your product.

Do you want to show generic (Cover) image of your product on the product listing (On the homepage and category page)? If yes, then find out how to show generic (Cover) image of your product on the product listing in PrestaShop 1.7 programmatically.

Step 1: Open the file, In your theme directory : templates\catalog\_partials\miniatures\product.tpl

Step 2: Find the below code:

Step 3: Replace the below code snippet:

Step 4: Clear the Cache and check for the same. Done!

Enjoy PrestaShop 1.7!

4 Comments

  1. Wow thanks a lot it worked well. By any chance do you have the code that could permit to display also as a thumbnail the first image of each combination available for a product ? I’m dying with it trying to find how to do it.

  2. Thank you very much!

    It worked very well!

  3. I cant the accurate code on PS1.7.6.5
    I’m using a template

  4. Hi, in homepage and search page not working.
    I solved it in this way:
    modify $product->id in $product.id
    {assign var=’coverImage’ value=Product::getCover($product.id)}
    {assign var=’coverImageId’ value=”{$product->id}-{$coverImage.id_image}”}

Leave a Reply

Your email address will not be published. Required fields are marked *