THELIA Forum

Welcome to the THELIA support and discusssion forum

Offline

#1 Can't hook to cart.top

(04-12-2017 23:59:29)


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 (04-12-2017 23:59:50)

Offline

#2 Re: Can't hook to cart.top

(05-12-2017 09:31:34)


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 ?


CQFDev | Sites, boutiques, modules, développement et intégration pour Thelia 1 et 2

Offline

#3 Re: Can't hook to cart.top

(05-12-2017 21:19:42)


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

#4 Re: Can't hook to cart.top

(05-12-2017 23:57:39)


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.


CQFDev | Sites, boutiques, modules, développement et intégration pour Thelia 1 et 2

Offline

#5 Re: Can't hook to cart.top

(07-12-2017 22:04:46)


Ok, I'll do.