3

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>
  • You can replace $block->getAccountUrl() with $this->getUrl('customer/account/create'); – Rakesh Jesadiya Oct 6 '16 at 8:33
  • Thanks Rakesh its working, but i want $this->getUrl('customer/account'); – Nadh Oct 6 '16 at 8:56
  • I have just updated answer please check it – Rakesh Jesadiya Oct 6 '16 at 9:05
1

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, privacy policy and cookie policy

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