Post by OSWorX » Wed Dec 16, 2020 10:23 pm

Since OpenCart Version 2.x there is a new way to add and edit already existing code (see array $data and string $route).
And as well the already parsed HTML $output when used with after.

This is called events and the core princip is explained here: https://github.com/opencart/opencart/wiki/Events-System

Events should replace the so well used VQMod and OCMod system.
Files using those 2, are based on xml-files and the manipulated files are stored as flat files.
While files affected by events are stored in the database only.

This thread here should be a place where everybody should post the experience with events.
And also a place where everybody can ask and add ideas, solutions and samples.

Extensions and Developers should prefer to use events rather the old VQ- & OCMod-system.
Events are constantly developed and extended and will provide a future proof solution.
The more OpenCart 4.x is in sight ..

Here are a few links which explain what Events are and how they work and can be used:
https://www.opencart.com/blog?blog_id=174
https://www.opencart.com/blog?page=7&blog_id=215
https://stackoverflow.com/questions/264 ... art-events
https://extensioncart.com/posts/writing ... ith-events

How to modify .twig template files: viewtopic.php?f=144&t=221533#p807608

Full Stack Web Developer :: Dedicated OpenCart Development & Support DACH Region
Contact for Custom Work / Fast Support.


User avatar
Guru Member

Posts

Joined
Mon Jan 11, 2010 10:52 pm
Location - Austria

Post by straightlight » Wed Dec 16, 2020 10:33 pm

OSWorX wrote:
Wed Dec 16, 2020 10:23 pm
Since OpenCart Version 2.x there is a new way to add and edit already existing code (see arrays $data and $route).
And as well the already parsed HTML $output when used with after.

This is called events and the core princip is explained here: https://github.com/opencart/opencart/wiki/Events-System

Events should replace the so well used VQMod and OCMod system.
Files using those 2, are based on xml-files and the manipulated files are stored as flat files.
While files affected by events are stored in the database only.

This thread here should be a place where everybody should post the experience with events.
And also a place where everybody can ask and add ideas, solutions and samples.

Extensions and Developers should prefer to use events rather the old VQ- & OCMod-system.
Events are constantly developed and extended and will provide a future proof solution.
The more OpenCart 4.x is in sight ..
Couldn't agree more on that with the exception on the request size an OP could bring to share the Events. Based on the size, Commercial Support should be handling those claims.

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 devmiqbal » Tue Nov 15, 2022 6:50 pm

Can anyone please share a tutorial to capture the product add/update and product add to cart and cart update events implementation in OpenCart V4.
I was using that events by implementing them in install.xml, but I am not getting any clue how to implement them in v4.
Please help

Newbie

Posts

Joined
Tue Nov 08, 2022 9:39 pm
Location - Pakistan

Post by JNeuhoff » Tue Nov 15, 2022 9:19 pm

devmiqbal wrote:
Tue Nov 15, 2022 6:50 pm
Can anyone please share a tutorial to capture the product add/update and product add to cart and cart update events implementation in OpenCart V4.
I was using that events by implementing them in install.xml, but I am not getting any clue how to implement them in v4.
Please help
This question has been discussed on github for OpenCart 4.

When I have some time I'll publish an article on how to modify library classes using event handlers.

Export/Import Tool * SpamBot Buster * Unused Images Manager * Instant Option Price Calculator * Number Option * Google Tag Manager * Survey Plus * OpenTwig


User avatar
Guru Member

Posts

Joined
Wed Dec 05, 2007 3:38 am


Post by devmiqbal » Tue Nov 15, 2022 9:45 pm

You are talking about this one https://github.com/opencart/opencart/wiki/Events-System ?
or send me the git link so I can check.

Newbie

Posts

Joined
Tue Nov 08, 2022 9:39 pm
Location - Pakistan
Who is online

Users browsing this forum: No registered users and 5 guests