Post by vivekvijaynair » Thu Apr 05, 2018 6:32 pm

Hello,
I am developing a custom module for Opencart 2.0.3.1 now. This module has already been implemented for latest versions and its working fine. I have a bit of confusion with the event handling for this version. Please note following are the events i used in newer versions :

Code: Select all

			$this->load->model('extension/event');
			$this->model_extension_event->addEvent('sms', 'catalog/controller/account/success/after', 'module/sms/otp');
			$this->model_extension_event->addEvent('smsorder', 'catalog/controller/checkout/success/before', 'module/sms/neworder');
			$this->model_extension_event->addEvent('smsorderstatus', 'catalog/controller/api/order/history/after', 'module/sms/orderstatus');
			$this->model_extension_event->addEvent('contactform', 'catalog/controller/information/contact/success/after', 'module/sms/contactform');
I took a look at the events mentioned here: https://github.com/opencart/opencart/wi ... -&-2.1.x.x
But I could not determine which of them can be used and does for all the events mentioned above a respective one exists with the older events.

The other way I have is to edit the core files, I only wish to use it if its inevitable.
Please update if anybody knows about this.

Thank you in advance.


Posts

Joined
Thu Apr 05, 2018 6:25 pm

Post by straightlight » Thu Apr 05, 2018 10:43 pm

Using v3.x releases to handle events have been eased so to launch the /before and /after events by a single row rather than the need to edit core files. :)

Dedication and passion goes to those who are able to push and merge a project.

Regards,
Straightlight
Programmer / Opencart Tester


Legendary Member

Posts

Joined
Mon Nov 14, 2011 11:38 pm
Location - Canada, ON

Post by thekrotek » Thu Apr 05, 2018 10:51 pm

Don't use events in OC, they're completely useless comparing to other frameworks like Joomla, for example.
Don't use OC 3, because it's awful and simplified event management is not an excuse.
If you want to modify or add something, use VQMod/OCMod.

Professional OpenCart extensions, support and custom work.
Contact me via email or Skype by support@thekrotek.com


User avatar
Expert Member

Posts

Joined
Sun Jul 03, 2016 12:24 am


Post by straightlight » Thu Apr 05, 2018 10:52 pm

Don't use OC 3, because it's awful and simplified event management is not an excuse.
That is of course a one-mind opinion but my reply above definitely hasn't been posted as an excuse.

Dedication and passion goes to those who are able to push and merge a project.

Regards,
Straightlight
Programmer / Opencart Tester


Legendary Member

Posts

Joined
Mon Nov 14, 2011 11:38 pm
Location - Canada, ON

Post by thekrotek » Thu Apr 05, 2018 10:56 pm

straightlight wrote:
Thu Apr 05, 2018 10:52 pm
That is of course a one-mind opinion but my reply above definitely hasn't been posted as an excuse.
One-minded, sure. You're fun!

Professional OpenCart extensions, support and custom work.
Contact me via email or Skype by support@thekrotek.com


User avatar
Expert Member

Posts

Joined
Sun Jul 03, 2016 12:24 am

Who is online

Users browsing this forum: No registered users and 172 guests