support

Add hooks to BlocksMenu controller

Started by yonghan, June 17, 2016, 01:55:39 AM

Previous topic - Next topic

yonghan

Hi admins, please consider to add hooks into BlocksMenu controller. I need to replace an item link via my extension. The link will be replaced if the extension is turned on and vice versa. I don't see another way to do that except replacing the items info for now. Thanks a lot.

abolabo

you should to create hook for admin side, on your extension status changing event. 
Just replace link of item via menu_control class.
"No one is useless in this world who lightens the burdens of another."
― Charles Dickens

yonghan

Hi abolabo. I want to apologize for not explaining in detail. I was saying about storefront blocksmenu controller, not admin side.

abolabo

please clarify "The link will be replaced if the extension is turned on and vice versa."
Turn On where? on admin or storefront side?

"No one is useless in this world who lightens the burdens of another."
― Charles Dickens

yonghan

The extension is turned on via admin side. The link that i want to change is storefront side.

abolabo

so.. when you turn on your extension on admin side you should to replace link for menu item with admin-side hook.
Just use core/lib/menu_control_storefront.php in it.
"No one is useless in this world who lightens the burdens of another."
― Charles Dickens

yonghan

Thanks Abolabo, I'll try it. Sorry for late reply.

yonghan

Hi Abolabo, i can get the menu item link replaced by using your suggestion. So i hook the extension status and change the menu item link based on the status. Thanks a lot.

Forum Rules Code of conduct
AbanteCart.com 2010 -