beluafi.ilustracion Posted October 24, 2023 Share Posted October 24, 2023 (edited) I would like to hide the subcategories that appear on the category pages. Not the tree that appears on the left margin but the other list that comes out in the central body. In fact, I would like to hide everything that appears between the header and the products. I have been looking for several hours and all the solutions that appear to me are for old versions of Prestashop and it is possible that none of the solutions that I have found work for me. I am using 8.1.1. Thank you! Edited October 30, 2023 by beluafi.ilustracion (see edit history) Link to comment Share on other sites More sharing options...
Zohaib-fk Posted October 25, 2023 Share Posted October 25, 2023 Hi, You need to search for code in the categories tpl file which shows the results of sub-categories in the listing page, then need to comment code in the tpl file of categories products listing. I found below forum post useful. The post has a solution for 1.7, I think it will work for version 8 as well as the new version has old version code and some enhancements. Link to comment Share on other sites More sharing options...
ps8modules Posted October 25, 2023 Share Posted October 25, 2023 (edited) 17 hours ago, beluafi.ilustracion said: I would like to hide the subcategories that appear on the category pages. Not the tree that appears on the left margin but the other list that comes out in the central body. In fact, I would like to hide everything that appears between the header and the products. I have been looking for several hours and all the solutions that appear to me are for old versions of Prestashop and it is possible that none of the solutions that I have found work for me. I am using 8.1.1. Thank you! Hi. Did you mean to hide the subcategories as crossed out? ./themes/your_theme/templates/catalog/listing/product-list.tpl (The placement of the subcategory block may be different, depending on your template) Find and comment: An asterisk is added after the first character { and before the last character } {*block name='subcategory_list'} {if isset($subcategories) && $subcategories|@count > 0} {include file='catalog/_partials/subcategories.tpl' subcategories=$subcategories} {/if} {/block*} Edited October 25, 2023 by ps8moduly.cz (see edit history) 1 Link to comment Share on other sites More sharing options...
beluafi.ilustracion Posted October 28, 2023 Author Share Posted October 28, 2023 I have already comentented the tpl and it still appears.😖 On 10/25/2023 at 7:46 AM, ps8moduly.cz said: Hi. Did you mean to hide the subcategories as crossed out? ./themes/your_theme/templates/catalog/listing/product-list.tpl (The placement of the subcategory block may be different, depending on your template) Find and comment: An asterisk is added after the first character { and before the last character } {*block name='subcategory_list'} {if isset($subcategories) && $subcategories|@count > 0} {include file='catalog/_partials/subcategories.tpl' subcategories=$subcategories} {/if} {/block*} Link to comment Share on other sites More sharing options...
ps8modules Posted October 28, 2023 Share Posted October 28, 2023 In that case, it is necessary to clear the cache and recompile the template. Link to comment Share on other sites More sharing options...
alexmiami Posted October 29, 2023 Share Posted October 29, 2023 I have the same issue, i tried with * but still there, how to clear the cache and recompile the template.? thanks a lot, Im a beginner Link to comment Share on other sites More sharing options...
alexmiami Posted October 29, 2023 Share Posted October 29, 2023 Hehe, i found a way to clear the cache and recompile the template and it is working, thanks a lot @ps8moduly.cz 1 Link to comment Share on other sites More sharing options...
beluafi.ilustracion Posted October 30, 2023 Author Share Posted October 30, 2023 Everyting working propperly also for me! Thank you so much!!! 1 Link to comment Share on other sites More sharing options...
gray Posted June 19 Share Posted June 19 Sorry to hijack this thread. But how do I do it just for specific sub categories. Link to comment Share on other sites More sharing options...
ps8modules Posted June 25 Share Posted June 25 Hi. In your case, you need to modify the file ./themes/your_theme/templates/catalog/_partials/subcategories.tpl Link to comment Share on other sites More sharing options...
ps8modules Posted July 4 Share Posted July 4 Hi. Sample modification ./themes/your_theme/templates/catalog/_partials/subcategories.tpl array(5, 7) = a list of category IDs that you do not want to display Link to comment Share on other sites More sharing options...
Press ta chope Posted 18 hours ago Share Posted 18 hours ago (edited) On 10/28/2023 at 11:19 AM, beluafi.ilustracion said: if i comment block name='subcategory_list' it also hide the main category description....wird.. my problem is if i comment Edited 18 hours ago by Press ta chope (see edit history) Link to comment Share on other sites More sharing options...
Press ta chope Posted 18 hours ago Share Posted 18 hours ago if i comment block name='subcategory_list' it also hide the main category description....wird.. Link to comment Share on other sites More sharing options...
Divine Posted 18 hours ago Share Posted 18 hours ago Can you copy your code as we can see it please ? Link to comment Share on other sites More sharing options...
Press ta chope Posted 18 hours ago Share Posted 18 hours ago Bonjour, on peut écrire en français. ce qui est bizarre c'est que la description de la catégorie est gérée dans un autre fichier ...(dans templates/catalog/_partials/category-header.tpl) je commence à avoir les yeux qui se croisent... mon code product-list.tpl {** * Copyright since 2007 PrestaShop SA and Contributors * PrestaShop is an International Registered Trademark & Property of PrestaShop SA * * NOTICE OF LICENSE * * This source file is subject to the Academic Free License 3.0 (AFL-3.0) * that is bundled with this package in the file LICENSE.md. * It is also available through the world-wide-web at this URL: * https://opensource.org/licenses/AFL-3.0 * If you did not receive a copy of the license and are unable to * obtain it through the world-wide-web, please send an email * to [email protected] so we can send you a copy immediately. * * DISCLAIMER * * Do not edit or add to this file if you wish to upgrade PrestaShop to newer * versions in the future. If you wish to customize PrestaShop for your * needs please refer to https://devdocs.prestashop.com/ for more information. * * @author PrestaShop SA and Contributors <contact@prestashop.com> * @copyright Since 2007 PrestaShop SA and Contributors * @license https://opensource.org/licenses/AFL-3.0 Academic Free License 3.0 (AFL-3.0) *} {extends file=$layout} {block name='head_microdata_special'} {include file='_partials/microdata/product-list-jsonld.tpl' listing=$listing} {/block} {block name='content'} <section id="main"> {block name='product_list_header'} <h1 id="js-product-list-header" class="h2">{$listing.label}</h1> {/block} {*block name='subcategory_list'} {if isset($subcategories) && $subcategories|@count > 0} {include file='catalog/_partials/subcategories.tpl' subcategories=$subcategories} {/if} {/block*} {hook h="displayHeaderCategory"} <section id="products"> {if $listing.products|count} {block name='product_list_top'} {include file='catalog/_partials/products-top.tpl' listing=$listing} {/block} {block name='product_list_active_filters'} <div class="hidden-sm-down"> {$listing.rendered_active_filters nofilter} </div> {/block} {block name='product_list'} {include file='catalog/_partials/products.tpl' listing=$listing productClass="col-xs-12 col-sm-6 col-xl-4"} {/block} {block name='product_list_bottom'} {include file='catalog/_partials/products-bottom.tpl' listing=$listing} {/block} {else} <div id="js-product-list-top"></div> <div id="js-product-list"> {capture assign="errorContent"} <h4>{l s='No products available yet' d='Shop.Theme.Catalog'}</h4> <p>{l s='Stay tuned! More products will be shown here as they are added.' d='Shop.Theme.Catalog'}</p> {/capture} {include file='errors/not-found.tpl' errorContent=$errorContent} </div> <div id="js-product-list-bottom"></div> {/if} </section> {block name='product_list_footer'}{/block} {hook h="displayFooterCategory"} </section> {/block} Link to comment Share on other sites More sharing options...
Divine Posted 18 hours ago Share Posted 18 hours ago Normalement en commentant ainsi : {*{block name='subcategory_list'} {if isset($subcategories) && $subcategories|@count > 0} {include file='catalog/_partials/subcategories.tpl' subcategories=$subcategories} {/if} {/block}*} Cela devrait fonctionner. Vérifiez que vous ne vous trompez pas dans la mise en place du commentaire. Link to comment Share on other sites More sharing options...
Press ta chope Posted 2 hours ago Share Posted 2 hours ago Bonjour, même avec cette façon de commenter, toujours le même résultat. J'utilise le theme enfant child classic de base généré par prestashop. Ce qui est vraiment bizarre c'est qu'il suffit que je crée une copie du fichier product-list.tpl dans ce theme enfant (templates/catalog/_partials/listing/product-list.tpl pour que cela fasse "disparaître le texte de description de la catégorie. Link to comment Share on other sites More sharing options...
Divine Posted 1 hour ago Share Posted 1 hour ago Ah c'est peut-être qu'il ne parvient plus à trouver le fichier qui contient la description. Avez-vous essayé de placer également le fichier "category-header.tpl" dans le thème enfant ? Link to comment Share on other sites More sharing options...
Press ta chope Posted 1 hour ago Share Posted 1 hour ago merci pour votre réponse, oui j'ai bien le category-header.tpl dans templates/catalog/_partials de mon theme enfant... 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