When an already registered customer apply to register as affiliate, it looks like the code in /catalog/controller/avent/activity.php is set to work only with the affiliate registration form intended to "non previously registered customers".
The code in activity.php is looking for the name and lastname fields on the form to write the associated activity entry, but this form (used by current logged-in customers) doesn't have those fields because they are already in the database.
This is the original code:
Code: Select all
// model/account/customer/addAffiliate/after
public function addAffiliate(&$route, &$args, &$output) {
if ($this->config->get('config_customer_activity')) {
$this->load->model('account/activity');
$activity_data = array(
'customer_id' => $output,
'name' => $args[1]['firstname'] . ' ' . $args[1]['lastname']
);
$this->model_account_activity->addActivity('affiliate_add', $activity_data);
}
}
Code: Select all
// model/account/customer/addAffiliate/after
public function addAffiliate(&$route, &$args, &$output) {
if ($this->config->get('config_customer_activity')) {
$this->load->model('account/activity');
if ($this->customer->isLogged()) {
$activity_data = array(
'customer_id' => $this->customer->getId(),
'name' => $this->customer->getFirstName() . ' ' . $this->customer->getLastName(),
);
$this->model_account_activity->addActivity('affiliate_add', $activity_data);
} else {
$activity_data = array(
'customer_id' => $output,
'name' => $args[1]['firstname'] . ' ' . $args[1]['lastname']
);
$this->model_account_activity->addActivity('affiliate_add', $activity_data);
}