Frage

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.

War es hilfreich?

Lösung

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 !!

Lizenziert unter: CC-BY-SA mit Zuschreibung
Nicht verbunden mit StackOverflow
scroll top