Jump to content

Sub-Category Thumbnails & Category Logo Feature Doesn't Work Right..


sounds

Recommended Posts

Hi,

 

PrestaShop 1.6.1.0. issue with sub-category images.

 

When editing a sub-category,

The two image options (thumbnails & category logo)

They never seem to display the way you'd expect them to.

 

I mean if I add an image for thumbnail,

It doesn't display (no image available)

I can see the thumbnail was uploaded if I go into FTP.

I made the image 125 x 125 and saved in jpg format.

 

Does the size and format matter?

 

Then I upload an image for the category logo, 900 x 210 jpg.

That displays in the top as it should but it also makes it hard

to see the text I entered manually that's displayed in that space.

That category logo image is also displaying as the thumbnail image.

 

It just doesn't look right.

 

I need thumbnail images to display for thumbnail images,
And the category logo to display how it should.

 

Any solutions?

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

Reply to self, for future reference..

 

I figured it out, took me a few nights of searching, this topic refreshed my memory:

https://www.prestashop.com/forums/topic/365718-please-help-subcategory-thumbnail-to-small/

 

 

I went into my sub category settings, added a new category logo.

It creates two new jpg image files inside that /public_html/shop/img/c folder

 

In my case, the ID for the sub-category I want to add a category logo to is 14.

When I click save, two new jpb files are created in /public_html/shop/img/c folder

14-category_default.jpg (for the sub category page top logo)

14-medium_default.jpg (for the thumbnail image)

 

To fix the thumbnails image: (don't upload it in the category settings page)

Just create your small thumbnail first and name it 14-medium_default.jpg
In your FTP client upload the new 14-medium_default.jpg over the existing one.

 

This fixes the full sub-category logo and the small thumbnail image.

 

I used the same 14-category_default.jpg for all categories/sub-categories, basically a dark background.

So the text I entered manually for that section shows over the dark background I uploaded (same for each category)

 

Image Sizes:
To change the size of the category image I went into preferences > images and changed category_default sizes.

Make your 14-category_default.jpg the same size you set in preferences > images.

 

 

This is an issue that many new users have trouble with, I think many people would have given up simply because
Such a simply feature that adds extra details to your store, it just doesn't work as it should, and I was searching for

nights to find a fix, little things like that put people off, I deleted PrestaShop before after weeks of work simply because
Small features that were or should be there were left out, like for instance, that feature that lets you set the minimum

order quantity, obviously you would expect to see another option to set the max order quantity right? I don;t think there is one.

 

And that ID in URL's is very annoying, at least give people the option to take it out, without paying 50 bucks or whatever to fix it.

There are some really orcward ways around simple things in PrestaShop, I love it thought, wish the developers would correct them.

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

  • 1 month later...

Tell me about it.. I have several things that need to be fixed, hard to get support sometimes.

 

BTW. I'm not using the default theme any more, I'm using Leotheme Game Gear,

I just noticed, this doesn't work the same in ps version 1.6.1.0 because those small images

are pulled from the ID-category_default.jpg instead of the ID-medium_default.jpg if that makes sense.

 

Have to find another solution

 

EDIT

 

I found this topic with another solution...

 

https://www.prestashop.com/forums/topic/320098-subcategories-images-change-square-125x-by-125x-to-rectangle-125x-by-31x/

 

I followed that example but had to change some of the code to point to my  medium_default.jpg instead of the category_default.jpg

When you do that the small images will be over sized, I used 125x125 and they appeared double that size.... so I went back to that code

and replaced width="{$categorySize.width}" height="{$categorySize.height}" with the actual size of my image width="125" height="125"

And I wrapped them with the < center> tag, if there's a better way please let me know, hope I didn't break anything in presta.

 

Here's what it looks like before:

 

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

 

Here's how it looks now:

 

{if $subcategory.id_image}
    <center><img class="replace-2x img-responsive" src="{$link->getCatImageLink($subcategory.link_rewrite, $subcategory.id_image, 'medium_default')|escape:'html':'UTF-8'}" alt="" width="125" height="125" />
{else}
    <img class="replace-2x img-responsive" src="{$img_cat_dir}medium_default.jpg" alt="" width="125" height="125" /></center>
{/if}
 
Now your small images are displayed as 125 x 125 or whatever size, and centered above the text... jesus.... loves me.
Edited by sounds (see edit history)
Link to comment
Share on other sites

  • 2 months later...

Hi

 

I was struggling, trying to find any info about the objects in the code and trying to get the same thumbnail as loaded in the admin panel...

But it wasn't the same functions called, not even the same object...

 

Eventually I just had to modify the first image with the class replace-2x by changing the name of the picture, since the function adds "<subcategory's index>-" at the beginning of the image src.

 

Thanks a lot for the post !

Edited by T.Baron (see edit history)
Link to comment
Share on other sites

  • 4 months 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...