NemoPS Posted October 29, 2014 Share Posted October 29, 2014 Howdy!I just published a tutorial on how to add a secondary image for categories (but applies to other entities as well) http://nemops.com/prestashop-categories-second-image/#.VFDHzvmjOr1 Cheers! Fabio 1 1 Link to comment Share on other sites More sharing options...
matogolf Posted October 23, 2017 Share Posted October 23, 2017 On 29. 10. 2014 at 11:59 AM, NemoPS said: Howdy! I just published a tutorial on how to add a secondary image for categories (but applies to other entities as well) http://nemops.com/prestashop-categories-second-image/#.VFDHzvmjOr1 Cheers! Fabio Hello. I would like to use it for categories not for subcategories. So I would like to make the second image show next to the default category image. How can I achieve that? I was following tutorial but I am not sure what to do in last steps when you are overriding getSubCategories method... Thanks! Link to comment Share on other sites More sharing options...
NemoPS Posted October 25, 2017 Author Share Posted October 25, 2017 Actually if it's the object itself, it should be accessible using $category->image2 Link to comment Share on other sites More sharing options...
matogolf Posted October 25, 2017 Share Posted October 25, 2017 Oh of course. I am just silly. Thanks Link to comment Share on other sites More sharing options...
idee Posted January 21, 2019 Share Posted January 21, 2019 (edited) Hi NemoPS, I use that code, but cant get to work that if NO Second Image was uploaded -> I want NO image to show.Now in standard It always shows the default image.How can I achieve that? (in categroy.tpl, when I comment out the {else} for the subcategorie images, it does not affect, still showing the standard)Thx for help, Edited January 21, 2019 by idee (see edit history) Link to comment Share on other sites More sharing options...
idee Posted January 22, 2019 Share Posted January 22, 2019 (edited) {if $subcategory.id_image2} <img class="replace-2x" src="{$link->getCatImageLink($subcategory.link_rewrite, $subcategory.id_image2, 'medium_default')|escape:'html':'UTF-8'}" alt="" width="{$mediumSize.width}" height="{$mediumSize.height}" /> {else} <img class="replace-2x" src="{$img_cat_dir}default-medium_default.jpg" alt="" width="{$mediumSize.width}" height="{$mediumSize.height}" /> {/if} If I would delete the default image in the {else}, the default would not shown. But with the changes from your tutorial it does not work. Any help would be nice Edited January 22, 2019 by idee (see edit history) 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