Search code examples
prestashopprestashop-1.6

How to hook blockcategories module next to blocknewproducts?


PrestaShop doesn't stop to amaze me how people can complicate such simple things. I can write for hours how frustrating this CMS is, but it's not the right place and time.

I'm creating a custom theme on the basis of presta's 1.6 default bootstrap theme and I have to add category module in the following position on the website:

[header: logo, menu, etc.]

[homepage-slider / displayTopColumn]

[htmlcontent-top / displayTopColumn]

[blockcategories]

[blocknewproducts / displayHomeTab or displayLeftColumn, not sure what position it is]

[rest of the page]

After several unsuccesful attempts I've decided to reinstall blockcategories, but after doing so it appeared I can't install it back because my theme doesn't have columns. So I've enabled columns in my theme's configuration panel, installed the module and hooked it to the rightColumn position. Now it's gone, doesn't appear on website at all. Why does it have to be like this?


Solution

  • Finally I did it.

    I needed to add to blockcategories.php:

    public function hookdisplayHomeTab($params)
    {
        return $this->hookLeftColumn($params);
    }
    
    public function hookDisplayHomeTabContent($params)
    {
        return $this->hookLeftColumn($params);
    }
    

    and then I could manually change module's position in Live Edit.