Move block layered navigation above the list of products

some month ago I bought your step-by-step-categories module. When you open some category in shop, you see some Products. In future there will be more than 100 products. On the left side I set a filter to select different types of this product category. My customer wants now, that the filter is shown above the list of the articles, not on the left side. But this seems to be impossible. Would it be possible with the step-by-step module? In the Backend I could not find a possibily to put your module at that place. Frank

PrestaShop does not have a "hook" to execute the modules there, so by default it is not possible to put the modules right above the list of products.
But there are some possibilities that allow to move the filters there. 

for exmaple
Website you linked do not use right column. So we can use it to show the filters module there. Firstly we need to move the right column hook execution code to position located right above the product list.
Open category.tpl file in your theme directory, put the code to show rightColumn hook code: {$HOOK_RIGHT_COLUMN} right before the code:  {include file="./product-list.tpl" products=$products}

after this go to your shop back office to section modules > positions, search there for list of modules named displayRightColumn and unhook all modules from this position.
Then use transplant tool and move "block layered navigation" module to displayRightColumn Hook.

it is applicable also for step by step module.

how to do the same in PrestaShop 1.7 ?

  1. i went to design > positions
  2. clicked on "transplant" button
  3. transplanted "faceted search" module to "displayRightColumn" hook
  4. i went to design > positions
  5. unassigned "faceted search" from list of modules named "displayLeftColumn" (removed faceted search from left column to avoid conflicts)
  6. then i altered file: /themes/classic/templates/catalog/listing/product-list.tpl - i added there code to execure displayRightColumn hook:
            {if $smarty.get.controller=="category"}
                {hook h='displayRightColumn'}
    i added {if} condition to check if viewed page is a category page (faceted search is applicable only to category pages)
    i added this code right after the
    <section id="products">
    {if $listing.products|count} ... HERE CODE ...

the result is: faceted search on category page, right above the list of products:

Share on Google Plus


This is a short description in the author block about the author. You edit it by entering text in the "Biographical Info" field in the user admin panel.
    Blogger Comment


Post a Comment