zapalm / homecategoriez

The module for PrestaShop that adds the block of categories in the middle of the homepage.
8 stars 4 forks source link

A new option to display a root category title instead of a caption "Popular categories" #6

Open dtamajon opened 2 years ago

dtamajon commented 2 years ago

Adding the rootCategory to smarty allows to use the parent category as title or whatever you want. For example, overwrite file "homecategoriez-boilerplate.tpl" and add title like:

    <h2 class="h2 text-uppercase">
        {assign var='categoryLink' value=$link->getcategoryLink($rootCategory->id_category, $rootCategory->link_rewrite)}
        <a href="{$categoryLink}" title="{$rootCategory->name|escape:html:'UTF-8'}">
            {$rootCategory->name|escape:html:'UTF-8'}
        </a>
    </h2>

Or add a "See all categories" link at the end, etc.

zapalm commented 2 years ago

Hello @dtamajon Thank you for your pull request! You are forgotten to include a code to a template in your pull request. I think this new feature should be enabled in the module settings (checkbox) so that a user can decide for himself.

zapalm commented 2 years ago

@dtamajon I have changed the target branch to Dev. Update your local Dev branch (git pull).