Post by straightlight » Tue Mar 15, 2022 5:58 am

OSWorX wrote:
Tue Mar 15, 2022 5:43 am

Well, using str_replace(..) or any other method like preg_replace(..) etc. is the difference between "good" developer and someone else.
Couldn't agree more here. Which is why, as explained on a previous reply on the topic already, it is also the reason why this specific process was not documented in the wiki since there are almost endless ways that an output can be used aside from str_replace.
OSWorX wrote:
Tue Mar 15, 2022 5:43 am
5.
straightlight wrote:
Tue Mar 15, 2022 1:32 am
.. free extensions on the Marketplace where these solutions have already been provided ..
The main problem there is, that no selection after events only is possible.
And - when looking at many extensions, it's really hard to find extensions made only with events.
While this observation is true, there are still great ones out there that can be used for free from the Marketplace and demonstrates great examples on how to achieve a project with it. The rest simply goes on dedicating our time to it since this Engine is already part of the core nevertheless.

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 mikeinterserv » Tue Mar 15, 2022 10:03 am

Well thanks for the input.
Text creates too much space for misunderstandings.
When you make a judgment on a misunderstood question or point of view things get worse.
Example. Who is a GOOD developer or OTHER. Well we can be here all day with that one.
Myself I do not doubt that events are what you say when fully understood, some of what I said is not specific to ME but to others also that especially may be less experienced. I do not always think just about myself. Personally I can get to the root of what I need - EVENTUALLY. I am surprised OSWorx and Straightlight think that myself or Paul would be UNABLE to understand the basics of events re installation etc etc etc. It is ridiculous to think ANY experienced developer would not grasp those basics so please don't treat anybody like children. I will grasp events the same as any other. Again thanks for the input it is genuinely appreciated.

Active Member

Posts

Joined
Thu May 28, 2020 6:55 am
Location - Wales

Post by mikeinterserv » Tue Mar 15, 2022 9:00 pm

OSWorX wrote:
Tue Mar 15, 2022 5:43 am

Well, I would say, let make us a challenge.
Post an OCMod here you think it will not be possible.
There are a few quite good developers around here, would surprise me it not one can find a solution.
OK - here is a very simple OCMod.
The Mod restricts ADDITIONAL IMAGES in ADD PRODUCT #images.
It means you can ONLY ADD 5 images and no more.
It gives a message upon 5 images and removes the ADD BUTTON.
If you delete an image it will replace the ADD BUTTON so you can add again. Up to 5.
It works WITHOUT having to submit the form. This is the important part. It is JS see it and you will understand.

NOW - I do not post this hoping you CANNOT make this with events - I honestly hope you can.
Maybe this is easy and you say OK no problem this is how I would do this, and put it here for all to see.

This is the thread I made the Mod for.
viewtopic.php?f=198&t=227591

Thanks

Active Member

Posts

Joined
Thu May 28, 2020 6:55 am
Location - Wales

Post by straightlight » Tue Mar 15, 2022 9:47 pm

mikeinterserv wrote:
Tue Mar 15, 2022 9:00 pm
OSWorX wrote:
Tue Mar 15, 2022 5:43 am

Well, I would say, let make us a challenge.
Post an OCMod here you think it will not be possible.
There are a few quite good developers around here, would surprise me it not one can find a solution.
OK - here is a very simple OCMod.
The Mod restricts ADDITIONAL IMAGES in ADD PRODUCT #images.
It means you can ONLY ADD 5 images and no more.
It gives a message upon 5 images and removes the ADD BUTTON.
If you delete an image it will replace the ADD BUTTON so you can add again. Up to 5.
It works WITHOUT having to submit the form. This is the important part. It is JS see it and you will understand.

NOW - I do not post this hoping you CANNOT make this with events - I honestly hope you can.
Maybe this is easy and you say OK no problem this is how I would do this, and put it here for all to see.


This is the thread I made the Mod for.
viewtopic.php?f=198&t=227591

Thanks
If you're addressing concerns about getting the blame for somebody who would provide Event Trigger codes whereas core codes were already published out-of-the-box in the first place in order to require some adjustments, it may not be an impossible theory on this forum but rather take note that people, in general, also do have the opportunity to perform better and grow by creating their own Events. Therefore, getting the blame for bad coding may not necessarily means it's for bad intentions when somebody with their own development gets either proposed other solutions or to create service requests.

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 mikeinterserv » Tue Mar 15, 2022 10:04 pm

straightlight wrote:
Tue Mar 15, 2022 9:47 pm
If you're addressing concerns about getting the blame for somebody who would provide Event Trigger codes whereas core codes were already published out-of-the-box in the first place in order to require some adjustments, it may not be an impossible theory on this forum but rather take note that people, in general, also do have the opportunity to perform better and grow by creating their own Events. Therefore, getting the blame for bad coding may not necessarily means it's for bad intentions when somebody with their own development gets either proposed other solutions or to create service requests.
I do not know what's up with you
What you write makes NO SENSE AT ALL to most of us here.

Active Member

Posts

Joined
Thu May 28, 2020 6:55 am
Location - Wales

Post by straightlight » Tue Mar 15, 2022 10:54 pm

mikeinterserv wrote:
Tue Mar 15, 2022 10:04 pm
straightlight wrote:
Tue Mar 15, 2022 9:47 pm
If you're addressing concerns about getting the blame for somebody who would provide Event Trigger codes whereas core codes were already published out-of-the-box in the first place in order to require some adjustments, it may not be an impossible theory on this forum but rather take note that people, in general, also do have the opportunity to perform better and grow by creating their own Events. Therefore, getting the blame for bad coding may not necessarily means it's for bad intentions when somebody with their own development gets either proposed other solutions or to create service requests.
I do not know what's up with you
What you write makes NO SENSE AT ALL to most of us here.
Yet, again, you still don't understand what's been posted. It's no problem, really. I see there's no point to answer to your replies furthermore at this point.

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 mikeinterserv » Wed Mar 16, 2022 12:42 am

straightlight wrote:
Tue Mar 15, 2022 10:54 pm
I see there's no point to answer to your replies furthermore at this point.
Well at least we can agree on something.

Active Member

Posts

Joined
Thu May 28, 2020 6:55 am
Location - Wales

Post by OSWorX » Wed Mar 16, 2022 12:53 am

As already written: better to stop and posting more and more arguments no one wants to hear.
Especially in this open forum here.

Normally I would say: "hey folks, let's meet for a coffee (or beer if you like that more ..), and discuss that .."

But, everyone of us lives in another part of this wonderfull world (yes, it would and could be a "wonderfull" if there would be no humans living on this planet - today more than yesterday!).
So, no need to waste time and air again and again.

The "challenge" was started by me and I am the one who is "guilty".
When I will have more time, I will convert it (please be a bit patient with me, have some clients and have to earn also money for daily living).
But I will do it.
And no one can "blame" me, if I am not able to do it, I will post it also (but I am confident to make it successfully without looking right now into the code).

To finalize that discussion here (and bring it to an end): the goal for all should be to "promote" events.
Publishing working code and solutions, improving the documentation.
Why?
Already written above, see by yourself!

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


User avatar
Administrator

Posts

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

Post by mikeinterserv » Wed Mar 16, 2022 1:26 am

OSWorX wrote:
Wed Mar 16, 2022 12:53 am
the goal for all should be to "promote" events.
Publishing working code and solutions, improving the documentation.
This ^
is also what I am aiming to achieve - nothing else.
some people just don't want to understand that.

Active Member

Posts

Joined
Thu May 28, 2020 6:55 am
Location - Wales

Post by straightlight » Wed Mar 16, 2022 1:31 am

mikeinterserv wrote:
Wed Mar 16, 2022 1:26 am
OSWorX wrote:
Wed Mar 16, 2022 12:53 am
the goal for all should be to "promote" events.
Publishing working code and solutions, improving the documentation.
This ^
is also what I am aiming to achieve - nothing else.
some people just don't want to understand that.
One day a time, people can get there.

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 OSWorX » Wed Mar 16, 2022 7:45 pm

For all those are interested in this (creating events in OC 3.x), I have created a new REPO at Github:
https://github.com/osworx/opencart-event-boilerplate

Includes all files to install this as an extension.
Read the comments inside the files, also the readme ..
Can be used as a "starter package" to create own events.

More will follow.

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


User avatar
Administrator

Posts

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

Post by straightlight » Wed Mar 16, 2022 7:52 pm

OSWorX wrote:
Wed Mar 16, 2022 7:45 pm
For all those are interested in this (creating events in OC 3.x), I have created a new REPO at Github:
https://github.com/osworx/opencart-event-boilerplate

Includes all files to install this as an extension.
Read the comments inside the files, also the readme ..
Can be used as a "starter package" to create own events.

More will follow.
One review I have, so far, would be this part:
The output we use at the extenson settings page.

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 OSWorX » Wed Mar 16, 2022 8:27 pm

straightlight wrote:
Wed Mar 16, 2022 7:52 pm
One review I have, so far, would be this part:
The output we use at the extenson settings page.
Thanks, but I am not sure what you mean ..

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


User avatar
Administrator

Posts

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

Post by straightlight » Wed Mar 16, 2022 8:53 pm

OSWorX wrote:
Wed Mar 16, 2022 8:27 pm
straightlight wrote:
Wed Mar 16, 2022 7:52 pm
One review I have, so far, would be this part:
The output we use at the extenson settings page.
Thanks, but I am not sure what you mean ..
There's a typo: extenson ...

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 OSWorX » Wed Mar 16, 2022 9:51 pm

straightlight wrote:
Wed Mar 16, 2022 8:53 pm
There's a typo: extenson ...
Found it in the meantime - thx.
Wrote all very quickly .. maybe there are more typos ..

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


User avatar
Administrator

Posts

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

Post by mikeinterserv » Wed Mar 16, 2022 11:59 pm

OSWorX wrote:
Wed Mar 16, 2022 7:45 pm
For all those are interested in this (creating events in OC 3.x), I have created a new REPO at Github:
https://github.com/osworx/opencart-event-boilerplate

Includes all files to install this as an extension.
Read the comments inside the files, also the readme ..
Can be used as a "starter package" to create own events.

More will follow.
Thanks OSWorx
This is much appreciated.
The OCMod i gave you for the challenge is almost nothing when you look at the code. I appreciate you have time constraints for such things.
Can I ask this - is calling this method of modification EVENTS rather misleading, as the EVENTS are actually ONLY the triggers and actions. just like in JS or Jquery for example. Is it not more a case of EXTENSION MODULES that are being installed from now on.
If OCMod really is going to disappear from OC 4 on then I want to concentrate on ONLY the new methods of modification.
Thanks again and I look forward to some progress in this area.

Active Member

Posts

Joined
Thu May 28, 2020 6:55 am
Location - Wales

Post by OSWorX » Thu Mar 17, 2022 12:56 am

mikeinterserv wrote:
Wed Mar 16, 2022 11:59 pm
Can I ask this - is calling this method of modification EVENTS rather misleading, as the EVENTS are actually ONLY the triggers and actions.
.. and so on ..
Too specific and not related to the original question.
Started a new thread for such, please ask there:
viewtopic.php?f=144&t=227710

thx.

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


User avatar
Administrator

Posts

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

Post by OSWorX » Sat Mar 19, 2022 2:54 pm

mikeinterserv wrote:
Tue Mar 15, 2022 9:00 pm
OSWorX wrote:
Tue Mar 15, 2022 5:43 am

Well, I would say, let make us a challenge.
Post an OCMod here you think it will not be possible.
There are a few quite good developers around here, would surprise me it not one can find a solution.
OK - here is a very simple OCMod.
You did not posted in the correct forum (as suggested), but anyway, there is the solution:
viewtopic.php?f=144&t=227710&p=839596#p839596

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


User avatar
Administrator

Posts

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

Post by Uudruid74 » Thu Mar 21, 2024 4:28 am

OSWorX wrote:
Tue Mar 15, 2022 4:51 am
Save the controller part in a new .php-file, save it is test.php and store it in the folder:
../admin/extension/module
Why is the file named test.php? How does Opencart know to load the test.php file? Just about everthing else is what I want to accomplish (mailing a discount code to new users to get them to create an account and try the products), I'm just not seeing how it knows to look for the code in test.php and not some other file. Does it load ALL the php files in a directory on startup??

Thanks for any info you can provide

New member

Posts

Joined
Thu Nov 09, 2023 10:43 pm

Post by OSWorX » Thu Mar 21, 2024 4:28 pm

Uudruid74 wrote:
Thu Mar 21, 2024 4:28 am
OSWorX wrote:
Tue Mar 15, 2022 4:51 am
Save the controller part in a new .php-file, save it is test.php and store it in the folder:
../admin/extension/module
Why is the file named test.php? How does Opencart know to load the test.php file? Just about everthing else is what I want to accomplish (mailing a discount code to new users to get them to create an account and try the products), I'm just not seeing how it knows to look for the code in test.php and not some other file. Does it load ALL the php files in a directory on startup??

Thanks for any info you can provide
You can name the file whatever you like - also mickey_and_minnie.php
The system will detect any file with the extension .php inside the folders (modules, payment, shipping, etc.)

The only important thing is: the class inside the file has to be correct, e.g. when a module and the file is called test.php then OC 2.x and 3.x

Code: Select all

class ControllerExtensionModuleTest extends Controller {
OC 4.x

Code: Select all

namespace Opencart\Admin\Controller\Extension\Opencart\Module;
/**
 * Class Test
 *
 * @package Opencart\Admin\Controller\Extension\Opencart\Module
 */
class Test extends \Opencart\System\Engine\Controller {

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


User avatar
Administrator

Posts

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

Users browsing this forum: Majestic-12 [Bot] and 76 guests