AbanteCart Community

AbanteCart Development => New Features Discussion => Topic started by: yonghan on June 17, 2016, 01:55:39 AM

Title: Add hooks to BlocksMenu controller
Post by: yonghan on June 17, 2016, 01:55:39 AM
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.
Title: Re: Add hooks to BlocksMenu controller
Post by: abolabo on June 17, 2016, 07:40:09 AM
you should to create hook for admin side, on your extension status changing event. 
Just replace link of item via menu_control class.
Title: Re: Add hooks to BlocksMenu controller
Post by: yonghan on June 17, 2016, 10:00:26 AM
Hi abolabo. I want to apologize for not explaining in detail. I was saying about storefront blocksmenu controller, not admin side.
Title: Re: Add hooks to BlocksMenu controller
Post by: abolabo on June 17, 2016, 12:24:28 PM
please clarify "The link will be replaced if the extension is turned on and vice versa."
Turn On where? on admin or storefront side?

Title: Re: Add hooks to BlocksMenu controller
Post by: yonghan on June 17, 2016, 07:51:55 PM
The extension is turned on via admin side. The link that i want to change is storefront side.
Title: Re: Add hooks to BlocksMenu controller
Post by: abolabo on June 21, 2016, 04:38:22 AM
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.
Title: Re: Add hooks to BlocksMenu controller
Post by: yonghan on August 22, 2016, 07:03:45 AM
Thanks Abolabo, I'll try it. Sorry for late reply.
Title: Re: Add hooks to BlocksMenu controller
Post by: yonghan on August 22, 2016, 08:16:57 AM
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.