Pages

Thursday, November 22, 2018

Prestashop 1.7.4.2 - How to remove category block header classic template

The category block header in the Prestashop sometimes is too big and used up unnecessary space that could prevent the customer to see the product - especially when a computer has a very small screen the first thing they see when browsing to the category is the header block first as it covers up quite big space. So we are going to remove this from the PrestaShop 1.7.4.2 classic template to clear up spaces and give the product listing a priority. Follow the tutorial guide as below how to remove it.

remove block category header from prestashop 1.7

1. Login to FileZilla FTP and locate this file in the directory .../themes/classic/templates/catalog/listing

2. View / Edit the category.tpl file using Notepad++

3. Edit the code as below



{extends file='catalog/listing/product-list.tpl'}

{block name='product_list_header'}
    <div class="block-category card card-block hidden-sm-down">
      <h1 class="h1">{$category.name}</h1>
      {if $category.description}
        <div id="category-description" class="text-muted">{$category.description nofilter}</div>
      {/if}
      {if $category.image.large.url}
        <div class="category-cover">
          <img src="{$category.image.large.url}" alt="{if !empty($category.image.legend)}{$category.image.legend}{else}{$category.name}{/if}">
        </div>
      {/if}
    </div>
    <div class="text-sm-center hidden-md-up">
      <h1 class="h1">{$category.name}</h1>
    </div>
{/block}

Edit / remove the red code above and make it only as below
{extends file='catalog/listing/product-list.tpl'}

{block name='product_list_header'}
   <div class="text-sm-center hidden-md-up">
   </div>
{/block}

4. Save the file and re-upload to the same directory and replace the old one

5. Login to prestashop back office Advanced Parameters >> Performance >> Clear Cache

6. Now browse to the shop the block header should be disabled

4 comments:

  1. excellent work! alot better without the block

    ReplyDelete
  2. Hi,
    After upgrading to 1.7.6.8 category block header appears again despite category.tpl file is changed.

    ReplyDelete
    Replies
    1. Meaning the upgrade you have done restored the same codes or they could have put it somewhere else. If you know how to use browser developer tools you could actually finds which file they put it... I havent try the 1.7.6.8 version

      Delete