THELIA Forum

Welcome to the THELIA support and discusssion forum

Announcement

Rejoignez la communauté sur le Discord Thelia : https://discord.gg/YgwpYEE3y3

Offline


Hi,
I have 3 hook defined in my config.xml

<hooks>
        <hook id="myserr.hook" class="MySerr\Hook\SerramentoHook">
            <tag name="hook.event_listener" event="cart.top" type="front" method="onCartTop"/>
            <tag name="hook.event_listener" event="product.details-top" type="front" method="onProductDetailTop"/>
            <tag name="hook.event_listener" event="product.after-javascript-include" type="front" method="onDetailAddJs"/>
        </hook>
</hooks>

I can't understand why only cart.top don't work.
I try before with key templates in tag, and after with a method written like the other productDetailTop.

Ther's something else that I need to activate?

thanks in adavance for your help.

Last edited by meo (26-12-2017 11:26:06)

Offline


Hi,

What do you mean saying "cart.top" is not working ? Nothing is displaed ? Are you sure that the template you're rendering for this hook is generating something ?


OpenStudio Toulouse

Offline


Sorry, Yes I mean that nothing is displayed. In template I wrote only a <p>string</p>.
But I solve refreshing module in admin. I've rebooted all, pc, wamp server, phpstorm ecc.. than went to thelia/admin deactivate mymodule and then reactivate.
After all the cart.top hooks my html file correctly.

There is a correct way to ensure that the thelia core reads correctly the newest version of every file of my module?
Clean hooks, creal cache of thelia and cache of firefox not always seems to work..

What else I've to do?

thanks

Offline


There is a correct way to ensure that the thelia core reads correctly the newest version of every file of my module?

When things become weird with hooks, you may use the following command in the console to reset your module's hook configuration: Thelia hook:clean YourModuleName (or php Thelia hook:clean YourModuleName on Windows).

You may also delete the cache/dev and cache/prod directories instead of using the Back Office to clear the cache.


OpenStudio Toulouse

Offline


Ok, I'll do.