OpenCart has many predefined methods that can be called anywhere, for example, in controller, model, as well as view template files. You can find system-level library files at system/library/
. We will show you how methods can be written and what their functions are.
You can find most of the affiliate code written in the affiliate section. You can check out the files at catalog/controller/affiliate/
and catalog/model/affiliate/
. Here is a list of methods we can use for the affiliate library:
When an e-mail and password are passed to this method, it logs in to the affiliate section if the username (e-mail) and password match among the affiliates. You can find this code at
catalog/controller/affiliate/login.php
on validate method:$this->affiliate->login($email, $password);
The affiliate gets logged out. This means the affiliate ID is cleared and its session is destroyed. Also, the affiliate's first name, last name, e-mail, telephone, and fax...