OpenCart has many predefined methods that can be called anywhere, such as in the controller
folder or in the model, and in the view template files. You can find system level library files at system/library/
. The following shows the different methods, how they can be written, and what their functions are:
Affiliate: You can find most of the affiliate code under the affiliate section, and check the files at
catalog/controller/affiliate/
and likewise atcatalog/model/affiliate/
. The following are the list of methods we can use for the affiliate library:$this->affiliate->login($email, $password);
This command ensures that the e-mail and password are passed to the method. If the username (e-mail) and password match among the affiliates, it logs into the affiliate section. You can find this code at
catalog/controller/affiliate/login.php
on the validate function.
$this->affiliate->logout();
The affiliate is logged out. It means the affiliate ID will be cleared...