I'm looking for a way to change the login redirect. As it works right now the user is redirected to the last page they visited before signing in if they were not in the process of checkout, I would like to change it so that the user is redirected to the home page after they signed in and were not in the process of checking out. If they were checking out then I'd like the process to remain the same.

I've followed some code to around line 145 of includes/modules/pages/login/header_php.php where it looks like this is happening but when I start changing things my site starts acting strange.