Magento 2.2.2 - Display Customer Account header dropdown and remove Sign Out link post login The Next CEO of Stack OverflowHow can i rewrite TierPrice Block in Magento2magento 2 captcha not rendering if I override layout xmlmain.CRITICAL: Plugin class doesn't existMagento 2 : Problem while adding custom button order view page?Change “My Account” to “Sign in/Sign out” option in header in magento rwd theme?Magento 2.2.2 - Remove default welcome message and show username post loginRemove “Sign Out” link in header panel but keep “Sign Out” link in dropdownMagento 2.2.5: Overriding Admin Controller sales/orderMagento 2.2.5: Add, Update and Delete existing products Custom Options
Are there languages with no euphemisms?
How to write papers efficiently when English isn't my first language?
Can "Reverse Gravity" affect Meteor Swarm?
Grabbing quick drinks
How to disable updates in WordPress theme
What happens if you roll doubles 3 times then land on "Go to jail?"
Implement the Thanos sorting algorithm
Failed to fetch jessie backports repository
Is a stroke of luck acceptable after a series of unfavorable events?
Creating a generator function for a large data set for a neural network
How can I quit an app using Terminal?
What is the purpose of the Potent Cantrip ability?
Why do remote companies require working in the US?
How do I construct this japanese bowl?
What is the point of a new vote on May's deal when the indicative votes suggest she will not win?
How to pronounce the slash sign
Is it my responsibility to learn a new technology in my own time my employer wants to implement?
Only print output after finding pattern
Why does standard notation not preserve intervals (visually)
Why use "finir par" instead of "finir de" before an infinitive?
Opposite of a diet
Why is Miller's case titled R (Miller)?
declare as function pointer and initialize in the same line
How do I go from 300 unfinished/half written blog posts, to published posts?
Magento 2.2.2 - Display Customer Account header dropdown and remove Sign Out link post login
The Next CEO of Stack OverflowHow can i rewrite TierPrice Block in Magento2magento 2 captcha not rendering if I override layout xmlmain.CRITICAL: Plugin class doesn't existMagento 2 : Problem while adding custom button order view page?Change “My Account” to “Sign in/Sign out” option in header in magento rwd theme?Magento 2.2.2 - Remove default welcome message and show username post loginRemove “Sign Out” link in header panel but keep “Sign Out” link in dropdownMagento 2.2.5: Overriding Admin Controller sales/orderMagento 2.2.5: Add, Update and Delete existing products Custom Options
After successful login, Luma
theme shows customer account details in dropdown on header as seen in below image
I need to replicate the same in our custom theme which has Blank
as its parent.
Vendor/Theme/Magento_Theme/layout/default.xml
<?xml version="1.0"?>
<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd">
<body>
<referenceContainer name="header.panel">
<block class="MagentoFrameworkViewElementHtmlLinks" name="header.links">
<arguments>
<argument name="css_class" xsi:type="string">header links</argument>
</arguments>
</block>
</referenceContainer>
</body>
</page>
Vendor/Theme/Magento_Customer/layout/default.xml
<?xml version="1.0"?>
<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd">
<body>
<referenceBlock name="header.links">
<block class="MagentoCustomerBlockAccountCustomer" name="customer" template="Magento_Customer::account/customer.phtml" before="-"/>
<block class="MagentoCustomerBlockAccountAuthorizationLink" name="authorization-link-login" template="Magento_Customer::account/link/authorization.phtml">
</block>
</referenceBlock>
<move element="top.links" destination="customer"/>
</body>
</page>
Vendor/Theme/Magento_Customer/templates/account/customer.phtml
<?php
/**
* Copyright © Magento, Inc. All rights reserved.
* See COPYING.txt for license details.
*/
// @codingStandardsIgnoreFile
/** @var MagentoCustomerBlockAccountCustomer $block */
?>
<?php if($block->customerLoggedIn()): ?>
<li class="customer-welcome">
<span class="customer-name"
role="link"
tabindex="0"
data-mage-init='"dropdown":'
data-toggle="dropdown"
data-trigger-keypress-button="true"
data-bind="scope: 'customer'">
<span data-bind="text: customer().fullname"></span>
<button type="button"
class="action switch"
tabindex="-1"
data-action="customer-menu-toggle">
<span><?= $block->escapeHtml(__('Change')) ?></span>
</button>
</span>
<script type="text/x-magento-init">
"*":
"Magento_Ui/js/core/app":
"components":
"customer":
"component": "Magento_Customer/js/view/customer"
</script>
<?php if($block->getChildHtml()):?>
<div class="customer-menu" data-target="dropdown">
<?= $block->getChildHtml() ?>
</div>
<?php endif; ?>
</li>
<?php endif; ?>
Here, when user is not logged in, I can see Sign In link but after user logs in I can see sign-out in user account dropdown on header as well as besides it. How do I resolve this?
magento2 layout customer xml custom-theme
add a comment |
After successful login, Luma
theme shows customer account details in dropdown on header as seen in below image
I need to replicate the same in our custom theme which has Blank
as its parent.
Vendor/Theme/Magento_Theme/layout/default.xml
<?xml version="1.0"?>
<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd">
<body>
<referenceContainer name="header.panel">
<block class="MagentoFrameworkViewElementHtmlLinks" name="header.links">
<arguments>
<argument name="css_class" xsi:type="string">header links</argument>
</arguments>
</block>
</referenceContainer>
</body>
</page>
Vendor/Theme/Magento_Customer/layout/default.xml
<?xml version="1.0"?>
<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd">
<body>
<referenceBlock name="header.links">
<block class="MagentoCustomerBlockAccountCustomer" name="customer" template="Magento_Customer::account/customer.phtml" before="-"/>
<block class="MagentoCustomerBlockAccountAuthorizationLink" name="authorization-link-login" template="Magento_Customer::account/link/authorization.phtml">
</block>
</referenceBlock>
<move element="top.links" destination="customer"/>
</body>
</page>
Vendor/Theme/Magento_Customer/templates/account/customer.phtml
<?php
/**
* Copyright © Magento, Inc. All rights reserved.
* See COPYING.txt for license details.
*/
// @codingStandardsIgnoreFile
/** @var MagentoCustomerBlockAccountCustomer $block */
?>
<?php if($block->customerLoggedIn()): ?>
<li class="customer-welcome">
<span class="customer-name"
role="link"
tabindex="0"
data-mage-init='"dropdown":'
data-toggle="dropdown"
data-trigger-keypress-button="true"
data-bind="scope: 'customer'">
<span data-bind="text: customer().fullname"></span>
<button type="button"
class="action switch"
tabindex="-1"
data-action="customer-menu-toggle">
<span><?= $block->escapeHtml(__('Change')) ?></span>
</button>
</span>
<script type="text/x-magento-init">
"*":
"Magento_Ui/js/core/app":
"components":
"customer":
"component": "Magento_Customer/js/view/customer"
</script>
<?php if($block->getChildHtml()):?>
<div class="customer-menu" data-target="dropdown">
<?= $block->getChildHtml() ?>
</div>
<?php endif; ?>
</li>
<?php endif; ?>
Here, when user is not logged in, I can see Sign In link but after user logs in I can see sign-out in user account dropdown on header as well as besides it. How do I resolve this?
magento2 layout customer xml custom-theme
have the same issue. Also, how to add the styling for the dropdown? in the tutorial they just say "the last touch is adding styles". But i can't find the correct styles in the luma directory devdocs.magento.com/guides/v2.0/frontend-dev-guide/layouts/…
– fogx
Mar 29 '18 at 15:21
add a comment |
After successful login, Luma
theme shows customer account details in dropdown on header as seen in below image
I need to replicate the same in our custom theme which has Blank
as its parent.
Vendor/Theme/Magento_Theme/layout/default.xml
<?xml version="1.0"?>
<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd">
<body>
<referenceContainer name="header.panel">
<block class="MagentoFrameworkViewElementHtmlLinks" name="header.links">
<arguments>
<argument name="css_class" xsi:type="string">header links</argument>
</arguments>
</block>
</referenceContainer>
</body>
</page>
Vendor/Theme/Magento_Customer/layout/default.xml
<?xml version="1.0"?>
<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd">
<body>
<referenceBlock name="header.links">
<block class="MagentoCustomerBlockAccountCustomer" name="customer" template="Magento_Customer::account/customer.phtml" before="-"/>
<block class="MagentoCustomerBlockAccountAuthorizationLink" name="authorization-link-login" template="Magento_Customer::account/link/authorization.phtml">
</block>
</referenceBlock>
<move element="top.links" destination="customer"/>
</body>
</page>
Vendor/Theme/Magento_Customer/templates/account/customer.phtml
<?php
/**
* Copyright © Magento, Inc. All rights reserved.
* See COPYING.txt for license details.
*/
// @codingStandardsIgnoreFile
/** @var MagentoCustomerBlockAccountCustomer $block */
?>
<?php if($block->customerLoggedIn()): ?>
<li class="customer-welcome">
<span class="customer-name"
role="link"
tabindex="0"
data-mage-init='"dropdown":'
data-toggle="dropdown"
data-trigger-keypress-button="true"
data-bind="scope: 'customer'">
<span data-bind="text: customer().fullname"></span>
<button type="button"
class="action switch"
tabindex="-1"
data-action="customer-menu-toggle">
<span><?= $block->escapeHtml(__('Change')) ?></span>
</button>
</span>
<script type="text/x-magento-init">
"*":
"Magento_Ui/js/core/app":
"components":
"customer":
"component": "Magento_Customer/js/view/customer"
</script>
<?php if($block->getChildHtml()):?>
<div class="customer-menu" data-target="dropdown">
<?= $block->getChildHtml() ?>
</div>
<?php endif; ?>
</li>
<?php endif; ?>
Here, when user is not logged in, I can see Sign In link but after user logs in I can see sign-out in user account dropdown on header as well as besides it. How do I resolve this?
magento2 layout customer xml custom-theme
After successful login, Luma
theme shows customer account details in dropdown on header as seen in below image
I need to replicate the same in our custom theme which has Blank
as its parent.
Vendor/Theme/Magento_Theme/layout/default.xml
<?xml version="1.0"?>
<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd">
<body>
<referenceContainer name="header.panel">
<block class="MagentoFrameworkViewElementHtmlLinks" name="header.links">
<arguments>
<argument name="css_class" xsi:type="string">header links</argument>
</arguments>
</block>
</referenceContainer>
</body>
</page>
Vendor/Theme/Magento_Customer/layout/default.xml
<?xml version="1.0"?>
<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd">
<body>
<referenceBlock name="header.links">
<block class="MagentoCustomerBlockAccountCustomer" name="customer" template="Magento_Customer::account/customer.phtml" before="-"/>
<block class="MagentoCustomerBlockAccountAuthorizationLink" name="authorization-link-login" template="Magento_Customer::account/link/authorization.phtml">
</block>
</referenceBlock>
<move element="top.links" destination="customer"/>
</body>
</page>
Vendor/Theme/Magento_Customer/templates/account/customer.phtml
<?php
/**
* Copyright © Magento, Inc. All rights reserved.
* See COPYING.txt for license details.
*/
// @codingStandardsIgnoreFile
/** @var MagentoCustomerBlockAccountCustomer $block */
?>
<?php if($block->customerLoggedIn()): ?>
<li class="customer-welcome">
<span class="customer-name"
role="link"
tabindex="0"
data-mage-init='"dropdown":'
data-toggle="dropdown"
data-trigger-keypress-button="true"
data-bind="scope: 'customer'">
<span data-bind="text: customer().fullname"></span>
<button type="button"
class="action switch"
tabindex="-1"
data-action="customer-menu-toggle">
<span><?= $block->escapeHtml(__('Change')) ?></span>
</button>
</span>
<script type="text/x-magento-init">
"*":
"Magento_Ui/js/core/app":
"components":
"customer":
"component": "Magento_Customer/js/view/customer"
</script>
<?php if($block->getChildHtml()):?>
<div class="customer-menu" data-target="dropdown">
<?= $block->getChildHtml() ?>
</div>
<?php endif; ?>
</li>
<?php endif; ?>
Here, when user is not logged in, I can see Sign In link but after user logs in I can see sign-out in user account dropdown on header as well as besides it. How do I resolve this?
magento2 layout customer xml custom-theme
magento2 layout customer xml custom-theme
edited Feb 8 '18 at 10:44
Slimshadddyyy
asked Feb 8 '18 at 7:25
SlimshadddyyySlimshadddyyy
61511547
61511547
have the same issue. Also, how to add the styling for the dropdown? in the tutorial they just say "the last touch is adding styles". But i can't find the correct styles in the luma directory devdocs.magento.com/guides/v2.0/frontend-dev-guide/layouts/…
– fogx
Mar 29 '18 at 15:21
add a comment |
have the same issue. Also, how to add the styling for the dropdown? in the tutorial they just say "the last touch is adding styles". But i can't find the correct styles in the luma directory devdocs.magento.com/guides/v2.0/frontend-dev-guide/layouts/…
– fogx
Mar 29 '18 at 15:21
have the same issue. Also, how to add the styling for the dropdown? in the tutorial they just say "the last touch is adding styles". But i can't find the correct styles in the luma directory devdocs.magento.com/guides/v2.0/frontend-dev-guide/layouts/…
– fogx
Mar 29 '18 at 15:21
have the same issue. Also, how to add the styling for the dropdown? in the tutorial they just say "the last touch is adding styles". But i can't find the correct styles in the luma directory devdocs.magento.com/guides/v2.0/frontend-dev-guide/layouts/…
– fogx
Mar 29 '18 at 15:21
add a comment |
1 Answer
1
active
oldest
votes
Add this to your css file:
.header.panel>.header.links>.customer-welcome+.authorization-link
display: none;
add a comment |
Your Answer
StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "479"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);
else
createEditor();
);
function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: false,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: null,
bindNavPrevention: true,
postfix: "",
imageUploader:
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
,
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);
);
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fmagento.stackexchange.com%2fquestions%2f212665%2fmagento-2-2-2-display-customer-account-header-dropdown-and-remove-sign-out-lin%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
Add this to your css file:
.header.panel>.header.links>.customer-welcome+.authorization-link
display: none;
add a comment |
Add this to your css file:
.header.panel>.header.links>.customer-welcome+.authorization-link
display: none;
add a comment |
Add this to your css file:
.header.panel>.header.links>.customer-welcome+.authorization-link
display: none;
Add this to your css file:
.header.panel>.header.links>.customer-welcome+.authorization-link
display: none;
answered 3 mins ago
Frank007Frank007
163
163
add a comment |
add a comment |
Thanks for contributing an answer to Magento Stack Exchange!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fmagento.stackexchange.com%2fquestions%2f212665%2fmagento-2-2-2-display-customer-account-header-dropdown-and-remove-sign-out-lin%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
have the same issue. Also, how to add the styling for the dropdown? in the tutorial they just say "the last touch is adding styles". But i can't find the correct styles in the luma directory devdocs.magento.com/guides/v2.0/frontend-dev-guide/layouts/…
– fogx
Mar 29 '18 at 15:21