I decided rather than fiddling with extra tables/fields, I would simply make it add the user before sending them off to paypal. So I have added the following code just after line 150 of uc_cart_checkout_pane.inc
$fields = array(
'name' => $_SESSION['new_user']['name'],
'mail' => $arg2['primary_email'],
'init' => $arg2['primary_email'],
'pass' => $_SESSION['new_user']['pass'],
'roles' => array(),
'status' => variable_get('uc_new_customer_status_active', TRUE) ? 1 : 0,
);
$user = user_save('', $fields);
$tmpQuery = db_query("update {uc_cart_products} set cart_id = %d WHERE cart_id = '%s'", $user->uid, session_id());
It appears to work fine. It's probably not the cleanest way to do it as I haven't bothered to remove the code that sets the session vaiables up, but other than that, do you see any potential issues with it?
Kind Regards,
Matt Winchester
