SebbC Posted November 21, 2017 Share Posted November 21, 2017 Hi, Sorry for my english (i'm french ), I work with prestashop 1.6.1.17 and i need to disable/hide the category image only in a specific catégory (ID 55), just keep the title and link... Somebody has already realized this modification or something similar ? Can you help me ? Thanks a lot, Seb Link to comment Share on other sites More sharing options...
allanextreme Posted November 22, 2017 Share Posted November 22, 2017 send and image of what you want to clarify, so we can help you. Link to comment Share on other sites More sharing options...
SebbC Posted November 27, 2017 Author Share Posted November 27, 2017 hi, Thanks for your answer. in category.tpl, there is this code : <div id="subcategories"> <p class="subcategory-heading">{l s='Subcategories'}</p> <ul class="clearfix"> {foreach from=$subcategories item=subcategory} <li> <div class="subcategory-image"> <a href="{$link->getCategoryLink($subcategory.id_category, $subcategory.link_rewrite)|escape:'html':'UTF-8'}" title="{$subcategory.name|escape:'html':'UTF-8'}" class="img"> {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} </a> </div> I think that it is necessary to modify the code later {else} with the subcategory ID... i don't know the syntax.. to create that : "if no image in subcategory ID55 > Do not show the image"... I post a screenshot and the desired result... Thanks, Seb Link to comment Share on other sites More sharing options...
allanextreme Posted November 28, 2017 Share Posted November 28, 2017 So your category 55 is "TOUS LES TUBES CARBONE O" and you want to hide all the subcategories in that category right?, what you want is easy and i can help you but you need to be more specific, i attached an image, it's right? Link to comment Share on other sites More sharing options...
SebbC Posted November 29, 2017 Author Share Posted November 29, 2017 Hi, yes it's what i want, i found a solution but i think it's not very clean, I modified the file category.tpl like that : <div id="subcategories"> <p class="subcategory-heading">{l s='Subcategories'}</p> <ul class="clearfix"> {foreach from=$subcategories item=subcategory} <li> <div class="subcategory-image"> {if $subcategory.id_image==7 or $subcategory.id_image==21 or $subcategory.id_image==22 or $subcategory.id_image==23 or $subcategory.id_image==24 or $subcategory.id_image==25 or $subcategory.id_image==26 or $subcategory.id_image==27 or $subcategory.id_image==28 or $subcategory.id_image==29 or $subcategory.id_image==65 or $subcategory.id_image==69} <img class="no-image" src="../../img/c/fr-default-no-medium_default.jpg" alt="" width="1" height="1" /> {else} <a href="{$link->getCategoryLink($subcategory.id_category, $subcategory.link_rewrite)|escape:'html':'UTF-8'}" title="{$subcategory.name|escape:'html':'UTF-8'}"> <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}" /> {/if} </a> 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