Jump to content

undifined hookDisplay method style working


Florian_domomat

Recommended Posts

I was looking for a way to display the displayNav3 in base prestashop theme in 2 different hooks, the first one for the cart and the second one for the customer sign in.

After a few hours, looking for a solution,  i choose to override Ps_Shoppingcart in the way you can see below

<?php
class Ps_ShoppingcartOverride extends Ps_Shoppingcart
{
    public function __construct()
    {
        parent::__construct();
    }

    public function install()
    {
        return
            parent::install() &&
            $this->registerHook('displayHeaderCart');
    }
}

here is my header.tpl file

<div class="secondaryNav">
    <div class="secondaryNav-content">
        <div class="secondaryNav-img">
            <a href="{$urls.base_url}">
                {*            <img src="{$shop.logo}" alt="{$shop.name}">*}
                <img src="https://img/img.png" alt="{$shop.name}">
                <!--todo dell image en dure-->
            </a>
        </div>
        {hook h='displayTop' mod='ps_searchbar'}
        {hook h='displayHeaderCart'}
    </div>
</div>

It's working (i can move displayHeaderCart anywhere in a .tpl file), but i don't understand why it's work,there is absolutly nowhere a declaration of hookDisplayHeaderCart.

i would like to know how it's work. i found nothing about this subject.

Ty For help !

Link to comment
Share on other sites

  • 2 weeks later...

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...