I am trying to show catalog prices only to logged in users. Following snippet works however it has two issues:

if(!Mage::helper('customer')->isLoggedIn()) {

echo '<a href="'.Mage::getUrl('customer/account/login').'">Please Login to view prices</a>';



1) If login credentials are incorrect, page redirects to previous page (on catalog page) and shows 'invalid login error'. Ideally, it should stay on the login page and should not redirect unless login is successful.

2) If user login is successful in first attempt, page redirects to catalog page. however, url contains port 8080. domain.com:8080/catalog/

Any fix for above issues?


Is it possible to have login on a popup on the catalog page?

1 Answer 1


Harry,first you need to check admin setting

Then goto admin>System>Configuration>Customer>

here find

Redirect Customer to Account Dashboard after Logging in setting make it NO


instead of using Mage::getUrl('customer/account/login');

used below code


Remove below code:

  • Thank you for the response. However, when I entered wrong login details, page redirected to catalog page with the error 'Invalid Login' but it suppose to go back to product view page!? Not working! Again,
    – harry
    Oct 23, 2014 at 8:25

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.