Jump to content

[SOLVED] PS 1.6.1.4 Category Images FO and BO no available


wmh90

Recommended Posts

Hello, I'm facing an annoying issue on my store.

Searched in some topics and there's a lot of people with the same issue.

My configuration is Prestashop 1.6.1.4 and I'm using Transformer Theme.

 

The problem is the Category thumbnail from the category and sub-category pages.

I upload them via BO and they appear in the BO but in the Front Office, it just appear the "No Image available" image I've uploaded.

The files are being uploaded to img/c folder correctly I guess, as:

12-medium-default.jpg; 12_thumb.jpg and so on...

 

I tryed the fix of regenerating the thumbnails but when I do that, the images from the BO just disappear too.

 

I did a F12 in Chrome and look at what folder it was linking the image and is a folder that didn't exist:

http://mysite.com.br/loja/c/br-default-medium_default/lps-long-plays.jpg

 

I am guessing this might be some upload image core problem, I really don't know what is happening.

Even in the img/c folder there's nothing about those files/folders that it is looking for.

It seems it is getting the friendly-url I'm using as the name of the file...

 

I could create that folder and rename all my category images (which is a lot of work), but there must have a fix for this as I could see there's a lot of people facing it or some variation of this.

 

Edited by wmh90 (see edit history)
Link to comment
Share on other sites

It has something to do with the category.tpl file.

I found it! OMG I can't believe I solved this by my own!

 

The original sentence is:

{if $subcategory.id_image}
                            <img class="replace-2x" src="{$link->getCatImageLink($subcategory.link_rewrite, $subcategory.id_image, 'medium_default')|escape:'html':'UTF-8'}" alt="{$subcategory.name|escape:'html':'UTF-8'}" width="{$mediumSize.width}" height="{$mediumSize.height}" />
                        {else}
                            <img class="replace-2x" src="{$img_cat_dir}{$lang_iso}-default-medium_default.jpg" alt="{$subcategory.name|escape:'html':'UTF-8'}" width="{$mediumSize.width}" height="{$mediumSize.height}" />
                        {/if} 

I replaced the original code of my theme (it has some modifications, but these lines are identical to the main theme) with:

{if $subcategory.id_image}
<img class="replace-2x" src="{$img_cat_dir}{$subcategory.id_category}-medium_default.jpg" width="{$mediumSize.width}" height="{$mediumSize.height}" />
{else}
<img src="{$img_cat_dir}{$lang_iso}-default-medium_default.jpg" alt="{$subcategory.name|escape:'html':'UTF-8'}" width="{$mediumSize.width}" height="{$mediumSize.height}" />
{/if} 

And there it is! At least to me, the problem was solved and my sub-categories images are showing perfectly!

 

I don't know what will happen if you restore images, but at a first glance, it is solved!

 

Let's spread the word to everyone with the same problem!

Edited by wmh90 (see edit history)
  • Like 3
Link to comment
Share on other sites

  • 2 weeks later...
  • 2 weeks later...
  • 4 weeks later...

I'm really new to PrestaShop and have spent 2 days trying to figure out everything.  Wmh09, can you please dummify everthing for me?    Step by step click instructions appreciated.   :) 

It's not that hard.

You will have to open your FTP and browse to your theme folder like: store/themes/default and find the file named category.tpl.

After that, you have to copy the first code I quoted above and find it in your file, then replace for the second code mentioned.

Not so hard.

Link to comment
Share on other sites

Agree hakeryk2; it's exactly the same problem that yours and when I searched the forum, your topic didn't showed in results, but we found the same solution, this is cool and strange at same time :)

Link to comment
Share on other sites

  • 3 months later...

EDIT: Found a solution. If I just upload an image under category thumbnail (together with whm90's fix) it works like I want. 

 

Hello,

 

I've added your solution wmh90 and it works so thank you. But I have another question, now you need to add an image for the cover. But what do you need to do if you only want the thumbnails? I only want the images shown when you click in the menubar on a parent category. When you know click on a subcategory I don't want the cover displayed. 

Knipsel.jpg

Edited by timonandries (see edit history)
Link to comment
Share on other sites

  • 4 weeks later...
  • 1 year later...

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