Post by TinTopHat » Fri Mar 11, 2022 8:15 pm

Version: OpenCart 3.0.3.7
I've found partial/incomplete answers to this in various searches but nothing definitive.

Could someone explain how I can send an email to a customer if I register them in the admin please?

Would I need to add a call to the event below in the

Code: Select all

admin/customer/customer/add()
controller action?

Code: Select all

// admin/model/customer/customer/addCustomer/after
public function customerCreate(&$route, &$args, &$output)
If so does anyone have any examples (for the parameter values) or suggestions for other methods?

Follow up issues/questions...
* Can I auto-generate a password for sending to this customer?
* If not then the password entered in the backend.

Version: OpenCart 3.0.3.7

Newbie

Posts

Joined
Fri Mar 11, 2022 7:37 pm

Post by straightlight » Fri Mar 11, 2022 9:37 pm


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 » Fri Mar 11, 2022 10:03 pm

straightlight wrote:
Fri Mar 11, 2022 9:37 pm
github.com/opencart/opencart/wiki/Events-System
The documentation, examples(none). etc etc etc are a complete joke.
Plus I have noticed you NEVER EVER give example mods OR code of any sort to actually HELP anybody
Why is that.

Active Member

Posts

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

Post by straightlight » Sat Mar 12, 2022 2:07 am

mikeinterserv wrote:
Fri Mar 11, 2022 10:03 pm
straightlight wrote:
Fri Mar 11, 2022 9:37 pm
github.com/opencart/opencart/wiki/Events-System
The documentation, examples(none). etc etc etc are a complete joke.
Plus I have noticed you NEVER EVER give example mods OR code of any sort to actually HELP anybody
Why is that.
Because those e.gs have already been provided on the wiki. You just need to spend the time to read the entire documentation in order to understand its purpose. Besides, I don't see anybody asking questions about the documentation itself but rather keeps creating new topics as if no documentation were created at all. If you believe this is a joke, that is up to your total opinion and yours only. However, rather think about a time when no documentation did existed before about it and, now that we do, all I see from your previous reply is to complain about it.

Therefore, rather be grateful with what you have than convincing the people otherwise while we have the resource that we need to keep things on-going.

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 » Sat Mar 12, 2022 2:27 am

straightlight wrote:
Sat Mar 12, 2022 2:07 am
Because those e.gs have already been provided on the wiki. You just need to spend the time to read the entire documentation in order to understand its purpose. Besides, I don't see anybody asking questions about the documentation itself but rather keeps creating new topics as if no documentation were created at all. If you believe this is a joke, that is up to your total opinion and yours only. However, rather think about a time when no documentation did existed before about it and, now that we do, all I see from your previous reply is to complain about it.

Therefore, rather be grateful with what you have than convincing the people otherwise while we have the resource that we need to keep things on-going.
You are joking right.
I spent a lot of time looking, also searching google for as much info as I could find on EVENTS - there is VERY LITTLE.
It seems there is very little interest in events and very few people utilizing them.
So far I can see absolutely NO WAY of converting some OCMods usingEVENTS. If you are so sure I am wrong just show me an example.
In theory the OPs question should be a VERY SIMPLE thing to do with events no ?
As a developer you know damn well how many things you learned from EXAMPLE CODE.
I would seek Jonathans opinion as he has developed many fine OCMods, can they ALL be converted to EVENTS.

Active Member

Posts

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

Post by straightlight » Sat Mar 12, 2022 2:51 am

mikeinterserv wrote:
Sat Mar 12, 2022 2:27 am
straightlight wrote:
Sat Mar 12, 2022 2:07 am
Because those e.gs have already been provided on the wiki. You just need to spend the time to read the entire documentation in order to understand its purpose. Besides, I don't see anybody asking questions about the documentation itself but rather keeps creating new topics as if no documentation were created at all. If you believe this is a joke, that is up to your total opinion and yours only. However, rather think about a time when no documentation did existed before about it and, now that we do, all I see from your previous reply is to complain about it.

Therefore, rather be grateful with what you have than convincing the people otherwise while we have the resource that we need to keep things on-going.
You are joking right.
I spent a lot of time looking, also searching google for as much info as I could find on EVENTS - there is VERY LITTLE.
It seems there is very little interest in events and very few people utilizing them.
So far I can see absolutely NO WAY of converting some OCMods usingEVENTS. If you are so sure I am wrong just show me an example.
In theory the OPs question should be a VERY SIMPLE thing to do with events no ?
As a developer you know damn well how many things you learned from EXAMPLE CODE.
I would seek Jonathans opinion as he has developed many fine OCMods, can they ALL be converted to EVENTS.
If you have absolutely no way to convert specific OCMods into Events, then those limitations comes from you and from you only. Think about how many extensions are already published on the Marketplace where I even provided positive feedbacks last year to those developers who did took the time to build their extensions and, that being, without the need to request any assistance. If these extensions were feasible to be feedbacked into, then it means it's definitely achievable to build extensions with Events.

If you're not convinced about it, that is not my problem nor does it originate from Opencart. Simply download and test as many free extensions from the Marketplace and use them on a test environment to see how they work. Forum supporters have been telling the same thing since the beginning of time to forum users and that won't change for you nor for anyone else on this forum.

According to your previous post, since you seem to be at this stage where you have limited knowledge about Event Triggers, then it simply describe that you're as limited as other users that don't know where to look for their answers while these answers have been published online a long time ago. If you haven't tested any free extensions from the Marketplace, so far, I would suggest to start working on it - on yourself!

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 » Sat Mar 12, 2022 3:06 am

and you find these many example on the marketplace HOW exactly
They don't state - HEY this OCMod is using EVENTS and NOT OCMod

I also forgot you were just BORN as an EXPERT programmer.
Nobody said it was YOUR problem - its my problem obviously.
I still see you DID NOT help the OP further.
This could have been done with an OCMod in 5 minutes.

Active Member

Posts

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

Post by straightlight » Sat Mar 12, 2022 3:59 am

mikeinterserv wrote:
Sat Mar 12, 2022 3:06 am
and you find these many example on the marketplace HOW exactly
They don't state - HEY this OCMod is using EVENTS and NOT OCMod

I also forgot you were just BORN as an EXPERT programmer.
Nobody said it was YOUR problem - its my problem obviously.
I still see you DID NOT help the OP further.
This could have been done with an OCMod in 5 minutes.
- The same way forum supporters are telling the users on an everyday basis; to take the time to search the Marketplace or by looking on Google
- I wasn't born an expert but did took the time to become one by believing in it and practicing the knowledge without the need to complain about it
- Forum supporters comes here on their free will to assist other users without any obligations (forum rules)
- OCMod is getting abolished whereas Event Triggers are taking the lead. Which is why, documentation have been published for users to understand its purpose in an introduction level without the need to be an expert in order to use it

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 » Sat Mar 12, 2022 4:09 am

You speak like a politician
Big word salad with very little substance

as an example here from OC
https://www.opencart.com/blog?filter_au ... log_id=174

Code: Select all

<?php
  class ControllerEventChangeViewCommonHeader extends Controller {
    public function before_view(&$route, &$data, &$output){
      $route = str_replace('common/header', 'common/my_custom_header', $route);
    }
  }
Now WHAT HAPPENS when you try to upload your my_custom_header' to the common folder ?
Thats just 1 example of many misleading or wrong examples on OC

Also how would anybody know that $route = str_replace('common/header', 'common/my_custom_header', $route); can be used from the DOCUMENTATION.
It mentions NOTHING AT ALL.

The current documentation is not fit for purpose at all.

Active Member

Posts

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

Post by straightlight » Sat Mar 12, 2022 6:21 am

mikeinterserv wrote:
Sat Mar 12, 2022 4:09 am
You speak like a politician
Big word salad with very little substance

as an example here from OC
https://www.opencart.com/blog?filter_au ... log_id=174

Code: Select all

<?php
  class ControllerEventChangeViewCommonHeader extends Controller {
    public function before_view(&$route, &$data, &$output){
      $route = str_replace('common/header', 'common/my_custom_header', $route);
    }
  }
Now WHAT HAPPENS when you try to upload your my_custom_header' to the common folder ?
Thats just 1 example of many misleading or wrong examples on OC

Also how would anybody know that $route = str_replace('common/header', 'common/my_custom_header', $route); can be used from the DOCUMENTATION.
It mentions NOTHING AT ALL.

The current documentation is not fit for purpose at all.
That is up to your own beliefs. While there are people who did succeed and proved to be worth their time to develop their own extensions with Event Triggers, you have only proved yourself toward others that you are the one falling behind with this core Engine that has been integrated since many years.

As for the str_replace, the reason why this hasn't been documented is because this function is not the only way to modify the output. The differed ways are based on the developers and the way they want to do it. The wiki documentation simply introduces the Engine on how it starts while developing an installation package. The install() and uninstall() method steps have been clearly written since. Besides, these two methods existed way before the Event Engine was built into the core. At this point, if you're still not convinced that the Event Triggers are not documented as it should, ask the same questions to the people who did managed to complete their extensions with it. Until then, just piss off and stop bothering people about things you should know if your intentions are to help other people on the forum.

Right now, by baby-crying over the public forum, you're only making it worst to yourself and others that don't need to hear about somebody who should follow the same suggestions that's been provided thousands of time to the users; to download packages and to keep practicing on it. Alternatively, if you don't want to put your time on it, you can also follow the same suggestion by creating a new service request in the Commercial Support section of the forum to have your projects developed as a custom job. The Events Trigger is the future with OC and, until a new Engine gets developed in the future (and if need be), this is what is implicit in the core for its use while developing new extensions, still on this day, and this is the way I've been going since its first version.

Why? Simple enough to say that I didn't wasted my time to learn about it, I just put my time to it rather than opposing to the idea like you're doing by complaining in here. Therefore, if you don't want to spend sometime on the idea, then there's no need from you to argue about it either period. Enough said.

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 » Sat Mar 12, 2022 8:57 am

The fact that you will write pages of vitriolic crap instead of simply providing an example for the OP says everything about you.
You are a complete waste of space sometimes.
As proven MANY MANY times and commented on, on this forum.
You are ignorant and selfish in every respect.

Soon I will eventually understand completely events.
Unfortunately you will still be ignorant and selfish.

Active Member

Posts

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

Post by straightlight » Sat Mar 12, 2022 11:44 am

mikeinterserv wrote:
Sat Mar 12, 2022 8:57 am
The fact that you will write pages of vitriolic crap instead of simply providing an example for the OP says everything about you.
You are a complete waste of space sometimes.
As proven MANY MANY times and commented on, on this forum.
You are ignorant and selfish in every respect.

Soon I will eventually understand completely events.
Unfortunately you will still be ignorant and selfish.
While you may believe to be eventually ready and is still your call to make to put yourself in a better position, today, you are not ready to understand Events.

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 paulfeakins » Tue Mar 15, 2022 12:31 am

mikeinterserv wrote:
Fri Mar 11, 2022 10:03 pm
straightlight wrote:
Fri Mar 11, 2022 9:37 pm
github.com/opencart/opencart/wiki/Events-System
The documentation, examples(none). etc etc etc are a complete joke.
Plus I have noticed you NEVER EVER give example mods OR code of any sort to actually HELP anybody
Why is that.
Yes I have noticed the full extent of @straightlight's help is often "Events."

I've asked @straightlight before to explain how something could be accomplished with an event, and was of course met with silence because it wasn't possible.

Events really cannot do much and have many problems. Mod systems like vQmod and OCMOD are the best method I have ever seen of applying extensions to code without changing that code, breaking updates, or conflicting. Yes of course those problems sometimes happen, but you can simply disable offending mods to resolve conflicts.

To give a very specific example, two events cannot modify the same function, but an unlimited number of mods could modify any combination of the lines in said function.

If @straightlight really is going to bang on about events as the panacea to every possible request, then they must start to give examples of how events could be used to achieve the given goal or I will consider removing any one-word "Events." or "Use an Event." posts in future.

UK OpenCart Hosting | OpenCart Audits | OpenCart Support - please email info@antropy.co.uk


User avatar
Legendary Member
Online

Posts

Joined
Mon Aug 22, 2011 11:01 pm
Location - London Gatwick, United Kingdom

Post by straightlight » Tue Mar 15, 2022 1:32 am

paulfeakins wrote:
Tue Mar 15, 2022 12:31 am
mikeinterserv wrote:
Fri Mar 11, 2022 10:03 pm
straightlight wrote:
Fri Mar 11, 2022 9:37 pm
github.com/opencart/opencart/wiki/Events-System
The documentation, examples(none). etc etc etc are a complete joke.
Plus I have noticed you NEVER EVER give example mods OR code of any sort to actually HELP anybody
Why is that.
Yes I have noticed the full extent of @straightlight's help is often "Events."

I've asked @straightlight before to explain how something could be accomplished with an event, and was of course met with silence because it wasn't possible.

Events really cannot do much and have many problems. Mod systems like vQmod and OCMOD are the best method I have ever seen of applying extensions to code without changing that code, breaking updates, or conflicting. Yes of course those problems sometimes happen, but you can simply disable offending mods to resolve conflicts.

To give a very specific example, two events cannot modify the same function, but an unlimited number of mods could modify any combination of the lines in said function.

If @straightlight really is going to bang on about events as the panacea to every possible request, then they must start to give examples of how events could be used to achieve the given goal or I will consider removing any one-word "Events." or "Use an Event." posts in future.
I don't recall that your expectations for me to reply was done in silence since recent extensions have been released on my behalf on the Marketplace. The fact that you believe that this was done in silence simply means that you may have not taken the time to look for free extensions on the Marketplace where these solutions have already been provided to store owners, in addition to state that feedbacks on my behalf were provided to the extension developers accordingly. Therefore, I did kept my presence up-to-date regarding those requests. Users, as part of anyone else, simply need to keep themselves up-to-date since the introduction has been published on the wiki in order to, first, begin their projects before going to the next level.

At this stage of time, I fail to see where OCMod is the best option whereas the Master Branch no longer contains this functionality.

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 1:48 am

Once again you post without an iota of value.
Your a legend in your own mind a.

Active Member

Posts

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

Post by OSWorX » Tue Mar 15, 2022 4:51 am

Sorry folks,

but it's time to calm down.
And I will close this thread immediately when former posters will continue the way they started, because most arguments from a few of you are only ridiculous!

For example, her is one user who is replying always with arguments to read a non complete documentation.
Another one is really telling us, that this easy task cannot be achieved with an event.
But he want us to believe, how good are VQMod and OCMod (which by the way are dead and obsolete with OpenCart 4.x).

To finalize this discussion and show everybody how easy this can be done, here 2 code parts as a "starting point".
Tested and is working.

And when I say "starting point" I really mean it this way, because there is currently no further language file, or view.
And both should be here to complete this whole story and create this as installable extension.

Okay, here we go.
The first part is the event:

code:

Code: Select all

ox_test_admin_add_user
trigger:

Code: Select all

admin/model/user/user/addUser/after
action:

Code: Select all

extension/module/test/eventModelUserUserAddUserAfter
(see also inside the controller)

Part 2 (the controller which has to be exist):

Code: Select all

<?php
/**
 * @version		$Id: test.php 2022-3-14 21:21Z mic $
 * @package		test
 * @author		mic - https://osworx.net
 * @copyright	2022 OSWorX
 * @license		AGPL
 */

class ControllerExtensionModuleTest extends Controller
{
	/**
	 * event to be called after creating a new user
	 * name:    ox_test_admin_add_user
	 * trigger: admin/model/user/user/addUser/after
	 * action:  extension/module/test/eventModelUserUserAddUserAfter
	 * 
	 * @param string    $route      the current called rout, not used here
	 * @param array     $args       array with all needed values
	 * @param string    $output     not used here (=parsed template) - only available when after method is used
	 */
	public function eventModelUserUserAddUserAfter( &$route, &$args, &$output = null ) {
		if( filter_var( $args[0]['email'], FILTER_VALIDATE_EMAIL)) {
			$store_name = html_entity_decode( $this->config->get( 'config_name' ), ENT_QUOTES, 'UTF-8' );
			$subject = 'Hello ' . $args[0]['firstname'] . ' ' . $args[0]['lastname'];
			$body = '<p>here is your new login data for ' . $store_name . '.</p><p>Below you will find your access data for ' . HTTPS_SERVER . '<br>As username please use <b>' . $args[0]['username'] . '</b>, your password is <b>' . $args[0]['password'] . '</b>.</p>Regards<br>' . $store_name . '<br>' . HTTPS_SERVER;

			// call the mail class and init
			$mail = new \Mail( $this->config->get( 'config_mail_engine' ) );
			$mail->parameter		= $this->config->get( 'config_mail_parameter' );
			$mail->smtp_hostname	= $this->config->get( 'config_mail_smtp_hostname' );
			$mail->smtp_username	= $this->config->get( 'config_mail_smtp_username' );
			$mail->smtp_password	= html_entity_decode( $this->config->get( 'config_mail_smtp_password' ), ENT_QUOTES, 'UTF-8' );
			$mail->smtp_port		= $this->config->get( 'config_mail_smtp_port' );
			$mail->smtp_timeout		= $this->config->get( 'config_mail_smtp_timeout' );
			// set values
			$mail->setTo( trim( $args[0]['email'] ) );
			$mail->setFrom( $this->config->get( 'config_email' ) );
			$mail->setSender( $store_name );
			$mail->setSubject( html_entity_decode( $subject, ENT_QUOTES, 'UTF-8' ) );
			// we use html and text
			$mail->setHtml( $body );
			$mail->setText( str_replace( '<br>', "\n", $body ) );
			// send finally the email
			$mail->send();
		}
	}
}
$subject and $body are hardcoded - that's why I have written the language and view files are missing.
Because normally this whole 2-minute thing would be installed as common module/extension.

To add the event parts, use your database management tool (e.g. phpMyAdmin) and create a new event.
Normally this will be done by the install function inside the controller.

Save the controller part in a new .php-file, save it is test.php and store it in the folder:
../admin/extension/module

The only thing I agree with paulfeakins is: future answers - in the whole forum - with "see the documentation" or "read the docs" or "simply use Events" (from the one) as well as replying only with pointing to his own services (from the other one) - will be deleted without any further notice.

Wish all a good day or night.

[edited 2022.03.16 - correct OC 3.x code for mail and event)

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 » Tue Mar 15, 2022 4:55 am

OSWorX wrote:
Tue Mar 15, 2022 4:51 am
Another one is really telling us, that this easy task cannot be achieved with an event.
And, yet, as a result, the way the story has finalized as part of your posted solution is that it is achievable with an Event after all.

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 » Tue Mar 15, 2022 4:59 am

straightlight wrote:
Tue Mar 15, 2022 4:55 am
OSWorX wrote:
Tue Mar 15, 2022 4:51 am
Another one is really telling us, that this easy task cannot be achieved with an event.
And, yet, as a result, the way the story has finalized as part of your posted solution is that it is achievable with an Event after all.
Let it be - please!
Why did you not posted a solution instead "argue around the cow"?
Would help more ..

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 » Tue Mar 15, 2022 5:07 am

OSWorX wrote:
Tue Mar 15, 2022 4:59 am
straightlight wrote:
Tue Mar 15, 2022 4:55 am
OSWorX wrote:
Tue Mar 15, 2022 4:51 am
Another one is really telling us, that this easy task cannot be achieved with an event.
And, yet, as a result, the way the story has finalized as part of your posted solution is that it is achievable with an Event after all.
Let it be - please!
Why did you not posted a solution instead "argue around the cow"?
Would help more ..
Because the documentation has been built as an introduction, it's been provided to the users on this topic as there are also free extensions that are available on the Marketplace for the users to understand how Events already works. At this point, I couldn't agree more than to state that these directions that's been provided already shouldn't been brought to an argument - period.

We have the resources already, it's up to the users to use them!

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 » Tue Mar 15, 2022 5:43 am

Just to answer some questions or "theories":
1.
mikeinterserv wrote:
Sat Mar 12, 2022 2:27 am
So far I can see absolutely NO WAY of converting some OCMods usingEVENTS. If you are so sure I am wrong just show me an example.
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.

2.
mikeinterserv wrote:
Sat Mar 12, 2022 4:09 am
as an example here from OC
https://www.opencart.com/blog?filter_au ... log_id=174

Code: Select all

<?php
  class ControllerEventChangeViewCommonHeader extends Controller {
    public function before_view(&$route, &$data, &$output){
      $route = str_replace('common/header', 'common/my_custom_header', $route);
    }
  }
Now WHAT HAPPENS when you try to upload your my_custom_header' to the common folder ?
What happens - nothing.
Why?
Because this IS THE WRONG approach!

With OpenCart 3.0.2.x following was introduced (to prevent fullfilling the system with unwanted extensions and code):

Code: Select all

// A list of allowed directories to be written to
$allowed = array(
	'admin/controller/extension/',
	'admin/language/',
	'admin/model/extension/',
	'admin/view/image/',
	'admin/view/javascript/',
	'admin/view/stylesheet/',
	'admin/view/template/extension/',

	'catalog/controller/extension/',
	'catalog/language/',
	'catalog/model/extension/',
	'catalog/view/javascript/',
	'catalog/view/theme/',

	'system/config/',
	'system/library/',

	'image/catalog/'
);
Which means, extensions (and their files) can only be uploaded and used if they are copied into one of these folders!

Taking the above sample, the correct code should be:

Code: Select all

 class ControllerEventChangeViewCommonHeader extends Controller {
    public function before_view(&$route, &$data, &$output){
      $route = str_replace('common/header', 'extension/module/my_custom_header', $route);
    }
btw: extensions from Dreamvention are not the best recommendation ..

3.
mikeinterserv wrote:
Sat Mar 12, 2022 4:09 am
Also how would anybody know that $route = str_replace('common/header', 'common/my_custom_header', $route); can be used from the DOCUMENTATION.
Well, using str_replace(..) or any other method like preg_replace(..) etc. is the difference between "good" developer and someone else.

4.
paulfeakins wrote:
Tue Mar 15, 2022 12:31 am
Events really cannot do much and have many problems. Mod systems like vQmod and OCMOD are the best method I have ever seen of applying extensions to code without changing that code, breaking updates, or conflicting. Yes of course those problems sometimes happen, but you can simply disable offending mods to resolve conflicts.
Well, just one opinion.
Nothing else - and not more.

VQMod and OCMod were really helpfully with OC 2.x and 3.x
With OC 4.x they are obsolete (and will not come back .. well I am sure, some so called clever "devs" will create a new extension for them to use it again.

pssst .. to these "devs": it they want to have their extension(s) also listed in the OpenCart Cloud, they should learn how to code ..

The argument Events really cannot do much and have many problems .. is useless because has no base at all.
Instead, events can much more you can imagine!

To be honest: I have developeed several hundred extensions over the years I am working with OpenCart.
And it was easy to work with VQMod and OCMod.
But once you have discovered what all you can do with events, you will not miss one of these two.
In very rare situations (to stay honest) a solution based on events may need time to find the correct method, but finally it is here and can be done.

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.

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: Amazon [Bot], maffe and 49 guests