cancel
Showing results for 
Search instead for 
Did you mean: 

Hide "My Account" button

Hide "My Account" button

Hi,

 

Is there a way to hide on front page the "My Account" button (link ../customer/account) when users are not logged in?

 

Currently this button and "Login" Button (../customer/account/login) redirect on the same page when not logged in.

 

Thank you,

Thomas 

4 REPLIES 4

Re: Hide "My Account" button

Hello @magentodeb ,

Please refer the following link https://magento.stackexchange.com/questions/245446/remove-my-account-top-bar-when-user-is-not-logged... 

Hope this help you to solve you problem.

If this helps you, please accept it as solution and give kudos.

Regards.

Re: Hide "My Account" button

Hi @vishi_gulati

Thank you for your answer.

I've found my ultimo theme header.phtml file, ut I'm not sure where to include the condition; code looks like this :

<?php if (!empty($accountLinksHtml)): ?>
                            <a href="#header-account" class="skip-link skip-account">
                                <span class="icon ic ic-user"></span>
                                <span class="label"><?php echo $this->__('My Account'); ?></span>
                            </a>
                        <?php endif; ?>

Thank you,

BR

Thomas

Re: Hide "My Account" button

Hello @magentodeb 

Please use it as below: 

<?php if (!empty($accountLinksHtml)): ?>
    <div data-bind="scope: 'customer'">
        <!-- ko if: customer().firstname  -->
        <a href="#header-account" class="skip-link skip-account">
            <span class="icon ic ic-user"></span>
            <span class="label"><?php echo $this->__('My Account'); ?></span>
        </a>
        <!-- /ko -->
        <script type="text/x-magento-init">
            {
                "*": {
                    "Magento_Ui/js/core/app": {
                        "components": {
                            "customer": {
                                "component": "Magento_Customer/js/view/customer"
                            }
                        }
                    }
                }
            }
        </script>
    </div>
<?php endif; ?>

If this helps you please accept it as solution and give kudos.

Regards.

 

 

Re: Hide "My Account" button

Thank you, but unfortunately it didn't work; same behaviour with the modification than before.