0

After login redirect to previous page all page it's working fine but i am using custom url for shopping cart page so it redirect to my account page. How to fix it

<div class="Login_cart">
                      <ul>
                        <li>
                        <?php if(Mage::getSingleton('customer/session')->isLoggedIn()){ ?>
                        <?php
                        $customer = Mage::getSingleton('customer/session')->getCustomer();
                        $cusname = $customer->getFirstname().' '.$customer->getLastname();
                        $name = substr($cusname,0,18)."..";
                        ?>
                        <a href="<?php echo Mage::getUrl('customer/account'); ?>"><?php echo "Hi "."$name"  ?> &nbsp;</a>
                            <ul  class="subaccount">
                            <li><a href="<?php echo Mage::getUrl('customer/account'); ?>">Profile</a></li>
                            <li><a href="<?php echo Mage::getUrl('sales/order/history'); ?>">Order</a></li>
                            <li><a href="<?php echo Mage::getUrl('wishlist'); ?>">Wishlist</a></li>
                            <li><a href="<?php echo Mage::getUrl('newsletter/manage'); ?>">Newsletter</a></li>
                            <li><a href="<?php echo Mage::getUrl('review/customer'); ?>">Review</a></li>
                            <li><a href="<?php echo Mage::getUrl('customer/account/logout'); ?>">Logout</a></li>
                            </ul>
                        <?php } else { ?>
                        <a href="<?php echo Mage::getUrl('customer/account/login'); ?>">Login / Register</a>
                        <?php } ?>
                        </li>
                </ul>
                </div>
  • Your question is confusing. Describe your problem in detail. – ladle3000 Sep 2 '15 at 12:57
  • i added above code in shopping cart page, after login it redirect to My account. If I use magento default top link (login) it redirect to previous page – Magento 2 Sep 2 '15 at 13:20
  • where i can't understand sorry – Magento 2 Sep 2 '15 at 13:44
  • <a href="<?php echo Mage::getUrl('customer/account'); ?> change to <a href="<?php echo Mage::getUrl(''); ?> – ladle3000 Sep 2 '15 at 13:49
1

Please simply change the following in your code.

<a href="<?php echo Mage::getUrl('customer/account'); ?>

to

<a href="<?php echo Mage::getUrl(''); ?>

Also, I believe all of this is irrelevant as it pertains to account area. You can try removing it and test:

                    <ul  class="subaccount">
                    <li><a href="<?php echo Mage::getUrl('customer/account'); ?>">Profile</a></li>
                    <li><a href="<?php echo Mage::getUrl('sales/order/history'); ?>">Order</a></li>
                    <li><a href="<?php echo Mage::getUrl('wishlist'); ?>">Wishlist</a></li>
                    <li><a href="<?php echo Mage::getUrl('newsletter/manage'); ?>">Newsletter</a></li>
                    <li><a href="<?php echo Mage::getUrl('review/customer'); ?>">Review</a></li>
                    <li><a href="<?php echo Mage::getUrl('customer/account/logout'); ?>">Logout</a></li>
                    </ul>

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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