Custom conetnts below pagination on category and manufacturers page


Hi, I wanted to add a block under the pagination. The problem is that my website has two paginations on the category listing page. Once I have added the code to pagination.tpl doc. It shows twice on the page. Could you please let me know how to solve this issue? I want to add it to category pages and also manufacturers page. i want to use html box pro module to achieve this.



Hello
okay all is clear,

So, you are on prestashop 1.6. In this case it will be required to add hook execution in two places.
Let's say that you created custom hoosk with names:
  1. "displayBelowPaginationUp" - to display contents below the pagination that is available at the top of list of products
  2. "displayBelowPaginationDown" - to display contents below the pagination that is available at the bottom of the list of products


modification for category page
open template file that is responsible for category page. The file is: themes/your-theme/xategory.tpl
you can find there code like:
  {if $products}
      <div class="content_sortPagiBar clearfix">
        <div class="sortPagiBar clearfix">
          {include file="./product-sort.tpl"}
          {include file="./nbr-product-page.tpl"}
        </div>
        <div class="top-pagination-content clearfix">
          {include file="./product-compare.tpl"}
          {include file="$tpl_dir./pagination.tpl"}
        </div>
      </div>
      {include file="./product-list.tpl" products=$products}
      <div class="content_sortPagiBar">
        <div class="bottom-pagination-content clearfix">
        {include file="./product-compare.tpl" paginationId='bottom'}
        {include file="./pagination.tpl" paginationId='bottom'}       
      </div>
     </div>
  {/if}
add hook execution code below the include code that implements the pagination.tpl file, like i show below
  {if $products}
      <div class="content_sortPagiBar clearfix">
        <div class="sortPagiBar clearfix">
          {include file="./product-sort.tpl"}
          {include file="./nbr-product-page.tpl"}
        </div>
        <div class="top-pagination-content clearfix">
          {include file="./product-compare.tpl"}
          {include file="$tpl_dir./pagination.tpl"}
        </div>
{hook h='displayBelowPaginationUp'}        
      </div>
      {include file="./product-list.tpl" products=$products}
      <div class="content_sortPagiBar">
        <div class="bottom-pagination-content clearfix">
        {include file="./product-compare.tpl" paginationId='bottom'}
        {include file="./pagination.tpl" paginationId='bottom'}
{hook h='displayBelowPaginationDown'}         
      </div>
     </div>
  {/if}

in effect you will be able to create contents in one of these hooks, depending on your requirements (if you want to display custom contents at the top of the list - use displayBelowPaginationUp hook, if you want to show contents at the bottom of the list of products use displayBelowPaginationDown.


modification for manufacturer page
open template file that is responsible for manufacturer's products page. The file is: themes/your-theme/manufacturer-list.tpl
you can find there code to implement pagination to the top of the list of products:
<div class="top-pagination-content clearfix bottom-line">
    {include file="$tpl_dir./pagination.tpl" no_follow=1}
</div>
and code that implements pagination at the bottom of the list of products:
<div class="bottom-pagination-content clearfix">
    {include file="$tpl_dir./pagination.tpl" no_follow=1 paginationId='bottom'}
</div>

modified code for top pagination:
<div class="top-pagination-content clearfix bottom-line">
    {include file="$tpl_dir./pagination.tpl" no_follow=1}
</div>
{hook h='displayBelowPaginationUp'} 

modified code for bottom pagination:
<div class="bottom-pagination-content clearfix">
    {include file="$tpl_dir./pagination.tpl" no_follow=1 paginationId='bottom'}
</div>
{hook h='displayBelowPaginationDown'} 


after you will save the files with new code it might be required to clear shop cache to see changes immediately. You can do it under preferences > performance section, as i show here: https://www.youtube.com/watch?v=8u590nf65Mg


if there will be anything else that i can help with just let me know.

best regards,
milos
Custom conetnts below pagination on category and manufacturers page Custom conetnts below pagination on category and manufacturers page Reviewed by VEKIA on Tuesday, August 27, 2019 Rating: 5

No comments