4

After sign in to account, page redirect to my account page and click on some other page and again click on my account link not working. My code:

<li class="authorization-link">
    <?php if ($block->isLoggedIn()): ?>
        <a href="<?php echo $block->getAccountUrl() ?>">
            <?php echo __('My Account') ?>
        </a>
   <?php endif; ?>
</li>
3
  • You can replace $block->getAccountUrl() with $this->getUrl('customer/account/create'); Oct 6, 2016 at 8:33
  • Thanks Rakesh its working, but i want $this->getUrl('customer/account');
    – User0434
    Oct 6, 2016 at 8:56
  • I have just updated answer please check it Oct 6, 2016 at 9:05

1 Answer 1

2

You can do like below code,

  <li class="authorization-link">
        <?php if ($block->isLoggedIn()): ?>
            <a href="<?php echo $this->getUrl('customer/account') ?>">
                <?php echo __('My Account') ?>
            </a>
       <?php endif; ?>
    </li>

Your Answer

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

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