Index: units/orders/orders_event_handler.php =================================================================== --- units/orders/orders_event_handler.php (revision 14705) +++ units/orders/orders_event_handler.php (working copy) @@ -245,24 +245,32 @@ } /** - * Enter description here... + * Updates shopping cart with logged-in user details * - * @param unknown_type $event - * @return unknown + * @param kEvent $event + * @return void + * @access protected */ - function OnUserLogin(&$event) + protected function OnUserLogin(&$event) { - if( !($event->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'); }