Jump to content

How to make New Arrivals, Popular and Best Seller per Category


Recommended Posts

Hello guys I have made a new feature on my website and I want to move the HOME TABS on every category that will sort them as New Arrivals, Best Sellers and Popular

 

jWGKa8V.png

 

Hope somebody can help me here I have already solved for new arrivals but the popular and best sellers are not yet.

Thanks in Advance

Link to comment
Share on other sites

  • 2 weeks later...

If you need all tabs, simply grab the displayHomeTabs and displayHomeTabsCOntent hooks that you find in index.tpl and try copying them into category.tpl

 

    {if isset($HOOK_HOME_TAB) && $HOOK_HOME_TAB|trim}
        <ul id="home-page-tabs" class="nav nav-tabs clearfix">
{$HOOK_HOME_TAB}
</ul>
{/if}
<div class="tab-content">{$HOOK_HOME_TAB_CONTENT}</div>
 
I am not totally sure it will work. If not, you need to create new hooks there, and register them in the module you want to plug in to that page

http://nemops.com/adding-hooks-to-prestashop-1-5/#.VSeFY_nQqr0
Link to comment
Share on other sites

  • 1 month later...

It would be complicated to explain you the whole procedure. It also depends on which category you want to  display products of.
Create a module, then a method named hookDisplayHome. Inside it, create a new category instance for each of the ones you need, and then again

$category->getProducts(); to get them. Of course, you need to assign them all to the template in the end

Link to comment
Share on other sites

Thanx Nemo, it turned out that the theme developers had disabled the widget heading in the code, so i had to add the following code to the widget_producttabs.tpl file.

{if isset($widget_heading)&&!empty($widget_heading)}
    <h4 class=”title_block”>
        {$widget_heading}
    </h4>
    {/if}
 

:)

Link to comment
Share on other sites

×
×
  • Create New...