bu_marius Posted January 18, 2015 Share Posted January 18, 2015 Hello, If you want to use a different picture for category and use category-thumbnail like subcategory picture it is very simple. You have to add category-thumbnail for your category and you have to change your category.tpl file.. replace <img class="replace-2x" src="{$link->getCatImageLink($subcategory.link_rewrite, $subcategory.id_image, 'medium_default')|escape:'html':'UTF-8'}" alt="" width="{$mediumSize.width}" height="{$mediumSize.height}" /> with <img class="replace-2x" src="{$link->getCatImageLink($subcategory.link_rewrite, $subcategory.id_image, '0_thumb')|escape:'html':'UTF-8'}" alt="" width="{$mediumSize.width}" height="{$mediumSize.height}" /> Marius Link to comment Share on other sites More sharing options...
bu_marius Posted January 18, 2015 Author Share Posted January 18, 2015 and if you want to test if file exists you can replace in your category.tpl <img class="replace-2x" src="{$link->getCatImageLink($subcategory.link_rewrite, $subcategory.id_image, 'medium_default')|escape:'html':'UTF-8'}" alt="" width="{$mediumSize.width}" height="{$mediumSize.height}" /> with {if file_exists($smarty.const._PS_ROOT_DIR_|cat:"/img/c/{$subcategory.id_image}-0_thumb.jpg")} <img class="replace-2x" src="{$link->getCatImageLink($subcategory.link_rewrite, $subcategory.id_image, '0_thumb')|escape:'html':'UTF-8'}" alt="" width="{$mediumSize.width}" height="{$mediumSize.height}" />{else} <img class="replace-2x" src="{$img_cat_dir}{$lang_iso}-default-medium_default.jpg" alt="" width="{$mediumSize.width}" height="{$mediumSize.height}" /> {/if} Maybe in the next version we will have "add a subcategory thumbnail" in the category admin page. Regards Marius Link to comment Share on other sites More sharing options...
procent85 Posted April 5, 2016 Share Posted April 5, 2016 Hello the solution is replace 84 line with: <img class="img-responsive" src="{$img_cat_dir}{$subcategory.id_image}_thumb.jpg" alt="{$subcategory.name|escape:'html':'UTF-8'}" /> I found it after 3h searching solution... 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