Index: branches/5.2.x/units/orders/orders_event_handler.php =================================================================== diff -u -N -r14702 -r14729 --- branches/5.2.x/units/orders/orders_event_handler.php (.../orders_event_handler.php) (revision 14702) +++ branches/5.2.x/units/orders/orders_event_handler.php (.../orders_event_handler.php) (revision 14729) @@ -1,6 +1,6 @@ MasterEvent->status == kEvent::erSUCCESS) ) { - return false; + if ( ($event->MasterEvent->status != kEvent::erSUCCESS) || kUtil::constOn('IS_INSTALL') ) { + // login failed OR login during installation + return; } $ses_id = $this->Application->RecallVar('ord_id'); - if ($ses_id) $this->updateUserID($ses_id, $event); + + if ( $ses_id ) { + $this->updateUserID($ses_id, $event); + } $user_id = $this->Application->RecallVar('user_id'); $affiliate_id = $this->isAffiliate($user_id); - if($affiliate_id) $this->Application->setVisitField('AffiliateId', $affiliate_id); + if ( $affiliate_id ) { + $this->Application->setVisitField('AffiliateId', $affiliate_id); + } + $event->CallSubEvent('OnRecalculateItems'); }