Page 1 of 1

Can modules auto-hook events?

Posted: Tue Jul 13, 2010 12:02 pm
by xds
Hello,
I was looking to develop a module to auto-insert an item into a customers order based on other things in their cart and I am pretty sure I know how I can do this, but I wanted to know if it would be possible to have said module hook the insert function in admin/controller/sale/order.php without me actually having to add the code in this controller file itself.

Pretty much my goal is to develop this in a fashion that won't require any updates to this controller in the future when upgrading to newer versions of opencart that may overwrite this controller. I am new to opencart and this is my first attempt at modding it, but I figure with the way it's laid out there might be a method of achieving this.

Thanks.

Re: Can modules auto-hook events?

Posted: Tue Jul 13, 2010 12:58 pm
by Qphoria
We are looking into hooking events, but nothing is in place at this time.

Re: Can modules auto-hook events?

Posted: Sat Jun 04, 2011 11:34 pm
by mjalajel
That would be a great feature to be added. O0

Re: Can modules auto-hook events?

Posted: Wed Sep 21, 2011 1:23 pm
by rahman
Hello,
Any update to the events/hooks system?

Re: Can modules auto-hook events?

Posted: Wed Sep 21, 2011 2:00 pm
by Xsecrets
no and I wouldn't hold my breath. It won't be happening anytime soon. for now you can use vqmod. It's been discussed as possible for 1.6 or 2.0, but development hasn't even begun on 1.6 yet, and my guess is that it won't happen till 2.0

Re: Can modules auto-hook events?

Posted: Wed Sep 21, 2011 7:02 pm
by Qphoria
I thought about using vQmod to implement a hook system to give it a trial run. I think it has great potential... daniel has never been keen on the idea.. but it has been discussed.

Re: Can modules auto-hook events?

Posted: Wed Sep 21, 2011 10:04 pm
by Johnathan
Qphoria wrote:I thought about using vQmod to implement a hook system to give it a trial run. I think it has great potential... daniel has never been keen on the idea.. but it has been discussed.
:D For some reason that strikes me as funny...virtually modifying files so you can have hooks to functionally modify them.

Would there be any real benefit to doing this? It might not be quite as clean-cut to find where in the files, but it seems like anything you can do with hooks you can do with vQmod.

Re: Can modules auto-hook events?

Posted: Wed Sep 21, 2011 11:19 pm
by Qphoria
Johnathan wrote:
Qphoria wrote:I thought about using vQmod to implement a hook system to give it a trial run. I think it has great potential... daniel has never been keen on the idea.. but it has been discussed.
:D For some reason that strikes me as funny...virtually modifying files so you can have hooks to functionally modify them.

Would there be any real benefit to doing this? It might not be quite as clean-cut to find where in the files, but it seems like anything you can do with hooks you can do with vQmod.
lol well using vQmod to try a feature that would normally exist if vQmod wasn't used... ;)

Hooks still have their place in many other projects, namely wordpress. vQmod is an external system that just happens to work well but was created because of lack of proper hook... opencart should really have its own hook system in place tho for proper api integration.