This modification is so simple to do, yet so useful once you do it.  How many times have you had to look up a user account, edit their account to view some detail and then decide you need to log in as that user?  Or even worse, create a brand new user account and immediately need to log in as that user?
Well for me it happens a lot.  I often view a user’s order history before deciding my next action.  The easiest way to do that (for me) is to search for the user in Admin/People/Users and then hit the Orders tab.  But the problem is once you’ve edited the user, there’s no way to log in as that user.  You have to hit the back button and do it from the main User Search page.
What’s worse is if you want to do it for a brand new user.  There’s no easy way to log in as that newly created user after creating the new account.  You have to return the User Search page, re-enter the email address again, search and finally hit the Login icon button.  YAWN!
Wouldn’t it be handy to be able to log in as that user account right from the Edit User page?
This modification will add a nifty little Login-As-User button to the top of your Edit User page.  It’s at the top for a reason – that way it’s always available no matter what tab you’re viewing.
FIrst you need to find your /Admin/People/Users/EditUser.aspx file and edit it with your favorite text editor.  In the file, find this code near the top:
Once you find this section of code, replace it with this new code:
Save the file once the changes are made.  The change you just made adds the button to the page.  However we still need some logic on the programming side so the server knows what to do when the button is clicked.
To add the programming logic, edit your /Admin/People/Users/EditUser.aspx.cs file with your favorite text editor.  Find this section of code at the very top:
and change it to look like this:
Now move further down the file and find this code:
And replace it with this:
Save the changes once you are done.
The next step in ANY programming change is to test your changes.  So fire up your AbleCommerce store, log into your Admin side and select the People/Users menu option.
Once you’re on the User Search page, edit an existing user or add a new user account to reach the Edit User page.  Once the Edit User page is displayed, you should see your new button in the caption directly above the tabs.  Click it and see how it works.
Adding nifty little buttons like this one can make your daily work go so much smoother.  Browser-based applications have long been a hassle because of all the additional mouse clicks necessary.   By modifying your AbleCommerce Edit User page to have a new button for Login-As-User, you’ve saved yourself time and stress by simplifying your workload.