Jump to content

create product without image "No Image Available" graphic


jokerstar

Recommended Posts

Hello,

 

when I create in prestashop version, 1.7.1. new product without image, why it automaticaly dont get default image (NO IMAGE AVAILABLE) from  /img/p/en.jpg  ?

 

There is still blank image.

 

Please let me know.

Link to comment
Share on other sites

  • 3 weeks later...

Hello,

I managed to solve this issue by changing the following code:

 

For product list:

open themes\classic\templates\catalog\_partials\miniatures\product.tpl and change:

 

{block name='product_thumbnail'}
      <a href="{$product.url}" class="thumbnail product-thumbnail">
          <img
            src = "{$product.cover.bySize.home_default.url}"
            alt = "{$product.cover.legend}"
            data-full-size-image-url = "{$product.cover.large.url}"
          >
        </a>
      {/block}

 

to

 

{block name='product_thumbnail'}
      {if empty($product.cover.bySize.home_default.url)}
        <a href="{$product.url}" class="thumbnail product-thumbnail">
          <img
            src = "
link_to_your_image"
            alt = "{$product.cover.legend}"
            data-full-size-image-url = "{$product.cover.large.url}"
          >
        </a>    
      {else}
        <a href="{$product.url}" class="thumbnail product-thumbnail">
          <img
            src = "{$product.cover.bySize.home_default.url}"
            alt = "{$product.cover.legend}"
            data-full-size-image-url = "{$product.cover.large.url}"
          >
        </a>
        {/if}
      {/block}

 

For product page:

open themes\classic\templates\catalog\_partials\product-cover-thumbnails.tpl and change:

 

{block name='product_cover'}
     <div class="product-cover">
      <img class="js-qv-product-cover" src="{$product.cover.bySize.large_default.url}" alt="{$product.cover.legend}" title="{$product.cover.legend}" style="width:100%;" itemprop="image">
      <div class="layer hidden-sm-down" data-toggle="modal" data-target="#product-modal">
        <i class="material-icons zoom-in"></i>
      </div>
    </div>
  {/block}

 

to

 

{block name='product_cover'}
  {if empty($product.cover.bySize.large_default.url)}
    <div class="product-cover">
      <img class="js-qv-product-cover" src="
link_to_your_image" alt="{$product.cover.legend}" title="{$product.cover.legend}" style="width:100%;" itemprop="image">
    </div>
  {else}
    <div class="product-cover">
      <img class="js-qv-product-cover" src="{$product.cover.bySize.large_default.url}" alt="{$product.cover.legend}" title="{$product.cover.legend}" style="width:100%;" itemprop="image">
      <div class="layer hidden-sm-down" data-toggle="modal" data-target="#product-modal">
        <i class="material-icons zoom-in"></i>
      </div>
    </div>
  {/if}
  {/block}

Link to comment
Share on other sites

  • 1 month later...

Hi, I have the same issue, all my images broken where should be no image cover. and i can't fint the code like you posted before. for example this is my product_cover_thumbnails.tpl file and product tpl file code.
Thank you in advance
broken_images.png product.png cover.png
 

Link to comment
Share on other sites

  • 1 month later...

By my experience this code only works in the CLASSIC theme, if you have any third-party one do you need insert part of this code depending of the theme installed.

Best regards,

 

P.S. in the classic theme works as a charm!

Thanks!

Link to comment
Share on other sites

  • 1 month later...
  • 1 year later...

A temporal solution for PS 1.7.4.3 until prestashop fix it in an official way:

1º Go to /img/p/ and download files: 

es-default-cart_default.jpg

es-default-home_default.jpg

es-default-large_default.jpg

es-default-medium_default.jpg

es-default-small_default.jpg

change with the image you want and upload again.

 

Go to /theme/YOURTHEME/templates/catalog/_partials/miniatures/product-listrgrid.tpl

And add this in product-listrgrid.tpl

{if count($product.images) < 1 }
        <a href="{$product.url}" class="thumbnail product-thumbnail">
            <img
              src = "https://www.YOURWEBSITE.com/img/p/es-default-medium_default.jpg"
              alt = "{$product.cover.legend}"
              data-full-size-image-url = "{$product.cover.large.url}"
            >
{/if}

          <a href="{$product.url}" class="thumbnail product-thumbnail">
            <img
              src = "{$product.cover.bySize.home_default.url}"
              alt = "{$product.cover.legend}"
              data-full-size-image-url = "{$product.cover.large.url}"
            >
             {if count($product.images) > 1 }
         {hook h="displayTmHoverImage" id_product=$product.id_product home='home_default' large='large_default'}
       {/if} 

Go to /themes/YOURTHEME/templates/catalog/_partials/product-cover-thumbnails.tpl

And add this in product-cover-thumbnails.tpl

change green

<img class="js-qv-product-cover" src="https://www.YOURWEBSITE.com/img/p/es-default-large_default.jpg" alt="{$product.cover.legend}" title="{$product.cover.legend}" style="width:100%;" itemprop="image">

 

Clear cache

Link to comment
Share on other sites

  • 2 years later...

Buonasera a tutti, capita anche a me dopo aggiornamento a prestashop 1.7.7.3 dopo aver migrato 1.6.1.24.

Prima di mettere mano c'è un aggiornamento al problema? 

@drakrukain quale cartella fare questa modifica?

 

On 21/9/2017 at 20:22, drakruka said:

 


 

e sostituiscilo con 


 

e voilà!

 

 

Link to comment
Share on other sites

Just now, Pianetasvapo said:

Buonasera a tutti, capita anche a me dopo aggiornamento a prestashop 1.7.7.3 dopo aver migrato 1.6.1.24.

Ps: il tema default è stato modificato

Prima di mettere mano c'è un aggiornamento al problema? 

@ drakrukain quale cartella fare questa modifica?

 

 

@mistik777la tua modifica funziona su 1.7.7 tema modificato? 

Link to comment
Share on other sites

  • 4 weeks later...

Can you please know, know how to solve this problem ??
I theme Drama, and I can't find product-list.tpl anywhere
how to solve the problem du PS 1.7.7.4
please help me how and what to modify?
possible that a CMS like PS does not take into account something so IMPORTANT FUNDAMENTAL I find it really as children who do not take into account, considering that PS is used for thousands of products in csv is ... absurd!

Link to comment
Share on other sites

4 hours ago, ujeb said:

Potete per favore sapere, sapere come risolvere questo problema ??
Ho un tema Drammatico e non riesco a trovare product-list.tpl da nessuna parte
come risolvere il problema du PS 1.7.7.4 per
favore aiutami come e cosa modificare?
possibile che un CMS come PS non tenga conto di qualcosa di così IMPORTANTE FONDAMENTALE lo trovo davvero da bambini che non lo tengono in considerazione, considerando che PS si usa per migliaia di prodotti in csv è...assurdo!

Ciao, purtroppo, ho dovuto reinserire tutto a mano. Nel mio caso la cartella img era danneggiata o mancante nel backup. Se nel tuo caso, invece, è completa, prova a rigenerare le miniature, pulire la cache disabilitare i friend url, pulire il file .htaccess e riabilitare i friend url (per rigenerare il file). Fammi sapere se funziona (come descritto qui : 

) Ciao  

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