Prestawise Posted December 3, 2010 Share Posted December 3, 2010 Hi guysAnyone know how to remove the subcategories text within the main categories?See the attached picture.Best regards Napz Link to comment Share on other sites More sharing options...
rocky Posted December 4, 2010 Share Posted December 4, 2010 Edit category.tpl in your theme's directory and {* comment out *} the following on lines 32-53 (in PrestaShop v1.3.2): {if isset($subcategories)} <!-- Subcategories --> {l s='Subcategories'} {foreach from=$subcategories item=subcategory} <a href="{$link->getCategoryLink($subcategory.id_category, $subcategory.link_rewrite)|escape:'htmlall':'UTF-8'}" title="{$subcategory.name|escape:'htmlall':'UTF-8'}"> {if $subcategory.id_image} <img src="{$link->getCatImageLink($subcategory.link_rewrite, $subcategory.id_image, 'medium')}" alt="" /> {else} <img src="{$img_cat_dir}default-medium.jpg" alt="" /> {/if} <a href="{$link->getCategoryLink($subcategory.id_category, $subcategory.link_rewrite)|escape:'htmlall':'UTF-8'}">{$subcategory.name|escape:'htmlall':'UTF-8'} {/foreach} {/if} Link to comment Share on other sites More sharing options...
Prestawise Posted December 5, 2010 Author Share Posted December 5, 2010 Hey RockyThanks for your replyHmm if i comment out the code it removes the entire product page..Im using version 1.3.1.1This is the code from my category.tplCould you look thru the code please? {include file=$tpl_dir./breadcrumb.tpl} {include file=$tpl_dir./errors.tpl} {if $category->id AND $category->active} {$category->name|escape:'htmlall':'UTF-8'} {*{$nb_products|intval} {if $nb_products>1}{l s='products'}{else}{l s='product'}{/if}*} {if $scenes} <!-- Scenes --> {include file=$tpl_dir./scenes.tpl scenes=$scenes} {else} <!-- Category image --> {if $category->id_image} getCatImageLink($category->link_rewrite, $category->id_image, 'category')}" alt="{$category->name|escape:'htmlall':'UTF-8'}" title="{$category->name|escape:'htmlall':'UTF-8'}" id="categoryImage" /> {/if} {/if} {if $category->description} {$category->description} {/if} {if isset($subcategories)} <!-- Subcategories --> {l s='Subcategories'} {foreach from=$subcategories item=subcategory} getCategoryLink($subcategory.id_category, $subcategory.link_rewrite)|escape:'htmlall':'UTF-8'}" title="{$subcategory.name|escape:'htmlall':'UTF-8'}"> {if $subcategory.id_image} getCatImageLink($subcategory.link_rewrite, $subcategory.id_image, 'medium')}" alt="" /> {else} {/if} getCategoryLink($subcategory.id_category, $subcategory.link_rewrite)|escape:'htmlall':'UTF-8'}">{$subcategory.name|escape:'htmlall':'UTF-8'} {/foreach} {/if} {if $products} {include file=$tpl_dir./product-list.tpl products=$products} {elseif !isset($subcategories)} {l s='There is no product in this category.'} {/if} {elseif $category->id} {l s='This category is currently unavailable.'} {/if} Link to comment Share on other sites More sharing options...
rocky Posted December 5, 2010 Share Posted December 5, 2010 Try the following: {include file=$tpl_dir./breadcrumb.tpl} {include file=$tpl_dir./errors.tpl} {if $category->id AND $category->active} {strip} {$category->name|escape:'htmlall':'UTF-8'} {* {if $nb_products == 0}{l s='There are no products.'} {else} {if $nb_products == 1}{l s='There is'}{else}{l s='There are'}{/if} {$nb_products} {if $nb_products == 1}{l s='product.'}{else}{l s='products.'}{/if} {/if} *}{/strip} {if $scenes} <!-- Scenes --> {include file=$tpl_dir./scenes.tpl scenes=$scenes} {else} <!-- Category image --> {if $category->id_image} <img src="{$link->getCatImageLink($category->link_rewrite, $category->id_image, 'category')}" alt="{$category->name|escape:'htmlall':'UTF-8'}" title="{$category->name|escape:'htmlall':'UTF-8'}" id="categoryImage" /> {/if} {/if} {if $category->description} {$category->description} {/if} {if isset($subcategories)} <!-- Subcategories --> {l s='Subcategories'} {foreach from=$subcategories item=subcategory} <a href="{$link->getCategoryLink($subcategory.id_category, $subcategory.link_rewrite)|escape:'htmlall':'UTF-8'}" title="{$subcategory.name|escape:'htmlall':'UTF-8'}"> {if $subcategory.id_image} <img src="{$link->getCatImageLink($subcategory.link_rewrite, $subcategory.id_image, 'medium')}" alt="" /> {else} <img src="{$img_cat_dir}default-medium.jpg" alt="" /> {/if} <a href="{$link->getCategoryLink($subcategory.id_category, $subcategory.link_rewrite)|escape:'htmlall':'UTF-8'}">{$subcategory.name|escape:'htmlall':'UTF-8'} {/foreach} {/if} {if $products} {include file=$tpl_dir./product-sort.tpl} {include file=$tpl_dir./product-list.tpl products=$products} {include file=$tpl_dir./pagination.tpl} {elseif !isset($subcategories)} {l s='There are no products in this category.'} {/if} {elseif $category->id} {l s='This category is currently unavailable.'} {/if} Link to comment Share on other sites More sharing options...
Prestawise Posted December 5, 2010 Author Share Posted December 5, 2010 Thank you Rocky... Your the best! Link to comment Share on other sites More sharing options...
wubugs Posted January 18, 2011 Share Posted January 18, 2011 This does not work for me. It removed the entire subcategory {include file=$tpl_dir./breadcrumb.tpl} {include file=$tpl_dir./errors.tpl} {if $category->id AND $category->active} {$category->name|escape:'htmlall':'UTF-8'} {$nb_products|intval} {if $nb_products>1}{l s='products'}{else}{l s='product'}{/if} {if $scenes} <!-- Scenes --> {include file=$tpl_dir./scenes.tpl scenes=$scenes} {else} <!-- Category image --> {if $category->id_image} getCatImageLink($category->link_rewrite, $category->id_image, 'category')}" alt="{$category->name|escape:'htmlall':'UTF-8'}" title="{$category->name|escape:'htmlall':'UTF-8'}" id="categoryImage" /> {/if} {/if} {if $category->description} {$category->description} {/if} {if isset($subcategories)} <!-- Subcategories --> {l s='Subcategories'} {foreach from=$subcategories item=subcategory} getCategoryLink($subcategory.id_category, $subcategory.link_rewrite)|escape:'htmlall':'UTF-8'}" title="{$subcategory.name|escape:'htmlall':'UTF-8'}"> {if $subcategory.id_image} getCatImageLink($subcategory.link_rewrite, $subcategory.id_image, 'medium')}" alt="" /> {else} {/if} getCategoryLink($subcategory.id_category, $subcategory.link_rewrite)|escape:'htmlall':'UTF-8'}">{$subcategory.name|escape:'htmlall':'UTF-8'} {/foreach} {/if} {if $products} {include file=$tpl_dir./product-sort.tpl} {include file=$tpl_dir./product-list.tpl products=$products} {include file=$tpl_dir./pagination.tpl} {elseif !isset($subcategories)} {l s='There is no product in this category.'} {/if} {elseif $category->id} {l s='This category is currently unavailable.'} {/if} Link to comment Share on other sites More sharing options...
rocky Posted January 18, 2011 Share Posted January 18, 2011 I've updated the code. It now doesn't comment out the subcategories anymore. Link to comment Share on other sites More sharing options...
wubugs Posted January 18, 2011 Share Posted January 18, 2011 Sorry to ask but where is your updated code? Link to comment Share on other sites More sharing options...
rocky Posted January 18, 2011 Share Posted January 18, 2011 It's on post #3 above. Link to comment Share on other sites More sharing options...
wubugs Posted January 18, 2011 Share Posted January 18, 2011 When I used that code nothing changes at all Link to comment Share on other sites More sharing options...
rocky Posted January 18, 2011 Share Posted January 18, 2011 What is it exactly that you want to do? Link to comment Share on other sites More sharing options...
wubugs Posted January 18, 2011 Share Posted January 18, 2011 I want to keep the subcategory items I just dont want the title "Subcategories" to be visible anymore. Thank you so much for your help I really appreciate it. Link to comment Share on other sites More sharing options...
rocky Posted January 18, 2011 Share Posted January 18, 2011 In that case, the only thing you need to do is change line 35 of category.tpl (in PrestaShop v1.3.6) from: {l s='Subcategories'} to: {*{l s='Subcategories'}*} The rest can remain the same as the default category.tpl. Link to comment Share on other sites More sharing options...
wubugs Posted January 18, 2011 Share Posted January 18, 2011 that didn't seem to work. Does the fact that i am using Version 1.3.2.3 - 0.573s change things? Link to comment Share on other sites More sharing options...
wubugs Posted January 18, 2011 Share Posted January 18, 2011 that didn't seem to work. Does the fact that i am using Version 1.3.2.3 - 0.573s change things? Link to comment Share on other sites More sharing options...
rocky Posted January 18, 2011 Share Posted January 18, 2011 Makes no difference. It should work. Make sure you are editing the right theme. If you have force_compile set to false, then you should temporarily change it to true, or clear out your Smarty cache in tools/smarty/compile (except index.php). Link to comment Share on other sites More sharing options...
wubugs Posted January 18, 2011 Share Posted January 18, 2011 Fixed!! It was the cache. Thank you x 100000 you are so awesome and patient :) 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