Jump to content

Hide subcategories in Category page at Prestashop 8.1.1 (Solved)


beluafi.ilustracion

Recommended Posts

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 by beluafi.ilustracion (see edit history)
Link to comment
Share on other sites

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

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*}

obrazek.thumb.png.a90c2d367a0753904dbf4d0cc3726dcd.png

Edited by ps8moduly.cz (see edit history)
  • Like 1
Link to comment
Share on other sites

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*}

obrazek.thumb.png.a90c2d367a0753904dbf4d0cc3726dcd.png

 

Link to comment
Share on other sites

  • beluafi.ilustracion changed the title to Hide subcategories in Category page at Prestashop 8.1.1 (Solved)
  • 7 months later...
  • 2 weeks later...
  • 4 months later...

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

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

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

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

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...