kineas Posted April 8, 2016 Share Posted April 8, 2016 Hello, I noticed that Prestashop (default-theme, modified) doesn't display "mini-images" of categories and subcategories when no "category-image" is defined. Is anyone familiar with this issue? here is my process, and why I don't get it: - I want my subcategories to be displayed with their "mini-image" - Sometimes, I don't want to have an category-image (displayed on the category page, as a banner) - I upload the "mini-image" in the admin - If there is no category-image, it simply doesn't show up on the website, even though it's showed in the admin... If anyone has an Idea, I'm all ears! Thanks a lot Link to comment Share on other sites More sharing options...
NemoPS Posted April 9, 2016 Share Posted April 9, 2016 Where are you uploading the mini-image exactly? The thumbs for subcategories are usually just category images Link to comment Share on other sites More sharing options...
kineas Posted April 10, 2016 Author Share Posted April 10, 2016 Directly in the Admin -> Categories. When you click to modify a category, you can upload a category-image and* a mini-image (thumb). I actually find it faster than a FTP upload, especially since you have to upload 3 versions of each image.. However, it's non-sense to me that you can upload a thumb, that will show up in the admin, associated to your category, but not on the website itself if you haven't uploaded a "category-image". And I don't get the "why", and most important, the "how to fix this?" Link to comment Share on other sites More sharing options...
NemoPS Posted April 11, 2016 Share Posted April 11, 2016 That is only used in the menu actually. To be honest, the menu itself uses a pretty silly way to grab it, as there is no built in method: if ((int)$category['level_depth'] > 1 && !$is_children) { $files = scandir(_PS_CAT_IMG_DIR_); if (count(preg_grep('/^'.$category['id_category'].'-([0-9])?_thumb.jpg/i', $files)) > 0) { $html .= '<li class="category-thumbnail">'; foreach ($files as $file) { if (preg_match('/^'.$category['id_category'].'-([0-9])?_thumb.jpg/i', $file) === 1) { $html .= '<div><img src="'.$this->context->link->getMediaLink(_THEME_CAT_DIR_.$file) .'" alt="'.Tools::SafeOutput($category['name']).'" title="' .Tools::SafeOutput($category['name']).'" class="imgm" /></div>'; } } $html .= '</li>'; } } Link to comment Share on other sites More sharing options...
kineas Posted April 18, 2016 Author Share Posted April 18, 2016 Indeed, but did you change the code here? sorry I don't understand if your answer is to the "why" or to the "how to fix it" :-D Thanks ! Link to comment Share on other sites More sharing options...
NemoPS Posted April 20, 2016 Share Posted April 20, 2016 The answer is to the why. You can't do that, unless you use that code in a category controller, loop through each subcategory and with that assign the category thumb link to each Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now