Question

I have created a ControllerModule in opencart. I want to include a SMS.php file which contains a class of SMS-API. How should I include this file and where is the proper place to put this file in the project? I'm a too newbie to opencart.

Was it helpful?

Solution

In index.php file after require_once($vqmod->modCheck(DIR_SYSTEM . 'library/cart.php')); add:

 require_once($vqmod->modCheck(DIR_SYSTEM . 'library/sms.php'));

Afer $registry->set('cart', new Cart($registry)); add

 //Sms library
 $registry->set('sms', new Sms($registry));  //where Sms is your class name

Once these changes are done you can call the class functions like $this->sms->getSmsInfo();

Have a nice day !!

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top