W
W
Wasya UK2020-11-29 17:58:04
Prestashop
Wasya UK, 2020-11-29 17:58:04

Why is the hook not applied in prestashop?

I'm trying to create a button to add to my wishlist. I created a hook, registered it, but I can't do anything with it( What am I doing wrong?

mymodule.php

public function install()
    {
        Configuration::updateValue('FAVORITES_LIVE_MODE', false);

        return parent::install() &&
            $this->registerHook('header') &&
            $this->registerHook('backOfficeHeader');
            $this->registerHook('addToWishlist');
    }

    public function hookAddToWishlist()
    {
        return "Hello from ".$this->name;
    }


product.tpl
<strong>{hook h='addToWishlist' mod='favorites'}</strong>


I installed the module, I don’t understand why there is no my hook in transplant modules (
5fc3b6f187ba2982196014.png

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question