Author Topic

Stéphane Le Merre

Saturday 17 July 2010 4:05:58 pm

Comment60246

I found out how to solve this, the checkout->after workflow is call by the bank script with no session in it, that's why eZUser::currentUser() returns anonymous. Quiet stupid question but i'm tired :)

Maybe solution can help, so i get the user from the order_id :

function execute( $process, $event )
 {
     $bResult = false;
     $s = new PremiumSubscription();
        
     $processParams  = $process->attribute( 'parameter_list' );
     $orderID        = $processParams['order_id'];
     $order          = eZOrder::fetch( $orderID );
     $currentUser    = $order->user();
     $userId         = $currentUser->id();

     //...
}

Regards,
Stéphane.

http://www.ligams.com