Magento 2 : Remove Top Links When Customer Not Logged InRemove Specific Top LinksTop links only show all when customer is logged inChange Top Links Text after LoginChanging the link location in top linksHow to hide top links from customer groupsTop links when login or not loginMagento 2 remove My Account and Wishlist link from top linksMagento2: how to add remove header links conditionallyHow to Add/Remove Top Links for logged-in/logged-out Users in Magento 2.1Remove My Account top bar when user is not logged in
Has anyone in space seen or photographed a simple laser pointer from Earth?
Using Newton's shell theorem to accelerate a spaceship
Why isn't pressure filtration popular compared to vacuum filtration?
How to memorize multiple pieces?
Should disabled buttons give feedback when clicked?
If a non-friend comes across my Steam Wishlist, how easily can he gift me one of the games?
How would my creatures handle groups without a strong concept of numbers?
Why can a destructor change the state of a constant object?
Confirming the Identity of a (Friendly) Reviewer After the Reviews
What steps should I take to lawfully visit the United States as a tourist immediately after visiting on a B-1 visa?
Why are Hobbits so fond of mushrooms?
Are neural networks prone to catastrophic forgetting?
QGIS Zanzibar how to crop?
For a hashing function like MD5, how similar can two plaintext strings be and still generate the same hash?
Why queuable apex accepts sobjects where as future methods doesn't?
Is there a way to know which symbolic expression mathematica used
How to ask for a LinkedIn endorsement?
Why was hardware diversification an asset for the IBM PC ecosystem?
How to tell someone I'd like to become friends without letting them think I'm romantically interested in them?
How can I calculate the sum of 2 random dice out of a 3d6 pool in AnyDice?
What is a solution?
Was I subtly told to resign?
Do you know your 'KVZ's?
Can fluent English speakers distinguish “steel”, “still” and “steal”?
Magento 2 : Remove Top Links When Customer Not Logged In
Remove Specific Top LinksTop links only show all when customer is logged inChange Top Links Text after LoginChanging the link location in top linksHow to hide top links from customer groupsTop links when login or not loginMagento 2 remove My Account and Wishlist link from top linksMagento2: how to add remove header links conditionallyHow to Add/Remove Top Links for logged-in/logged-out Users in Magento 2.1Remove My Account top bar when user is not logged in
.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty margin-bottom:0;
I would like to remove My Account
link from top links, when customer is not logged in.
How do I achieve it via XML layout files?
magento2 layout customer toplinks link
add a comment |
I would like to remove My Account
link from top links, when customer is not logged in.
How do I achieve it via XML layout files?
magento2 layout customer toplinks link
add a comment |
I would like to remove My Account
link from top links, when customer is not logged in.
How do I achieve it via XML layout files?
magento2 layout customer toplinks link
I would like to remove My Account
link from top links, when customer is not logged in.
How do I achieve it via XML layout files?
magento2 layout customer toplinks link
magento2 layout customer toplinks link
edited Feb 8 '17 at 5:52
Khoa TruongDinh
23k6 gold badges45 silver badges92 bronze badges
23k6 gold badges45 silver badges92 bronze badges
asked Feb 7 '17 at 22:26
gianis6gianis6
73514 silver badges36 bronze badges
73514 silver badges36 bronze badges
add a comment |
add a comment |
2 Answers
2
active
oldest
votes
You can do it without xml file also which will be easier for your task.
First step that you have to do is override header part and once its done apply some simple logic like by checking cx is logged in or not.
$objectManager = MagentoFrameworkAppObjectManager::getInstance();
$customerSession = $objectManager->get('MagentoCustomerModelSession');
if($customerSession->isLoggedIn()) //apply logic here
add a comment |
You can remove via overriding theme layout or xml file.
app/design/frontend/Package/themename/Magento_Customer/layout/default.xml
<referenceBlock name="top.links">
<referenceBlock name="register-link" remove="true" /> <!--for Create Account Link-->
<referenceBlock name="my-account-link" remove="true" /> <!--for My Account Link-->
</referenceBlock>
I hope this will help you
This will always remove My Account link, I need to remove it only when the customer is logged out
– gianis6
Feb 8 '17 at 9:49
I need to display My Account link only for logged in customer
– gianis6
Feb 8 '17 at 9:53
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%2f158641%2fmagento-2-remove-top-links-when-customer-not-logged-in%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
2 Answers
2
active
oldest
votes
2 Answers
2
active
oldest
votes
active
oldest
votes
active
oldest
votes
You can do it without xml file also which will be easier for your task.
First step that you have to do is override header part and once its done apply some simple logic like by checking cx is logged in or not.
$objectManager = MagentoFrameworkAppObjectManager::getInstance();
$customerSession = $objectManager->get('MagentoCustomerModelSession');
if($customerSession->isLoggedIn()) //apply logic here
add a comment |
You can do it without xml file also which will be easier for your task.
First step that you have to do is override header part and once its done apply some simple logic like by checking cx is logged in or not.
$objectManager = MagentoFrameworkAppObjectManager::getInstance();
$customerSession = $objectManager->get('MagentoCustomerModelSession');
if($customerSession->isLoggedIn()) //apply logic here
add a comment |
You can do it without xml file also which will be easier for your task.
First step that you have to do is override header part and once its done apply some simple logic like by checking cx is logged in or not.
$objectManager = MagentoFrameworkAppObjectManager::getInstance();
$customerSession = $objectManager->get('MagentoCustomerModelSession');
if($customerSession->isLoggedIn()) //apply logic here
You can do it without xml file also which will be easier for your task.
First step that you have to do is override header part and once its done apply some simple logic like by checking cx is logged in or not.
$objectManager = MagentoFrameworkAppObjectManager::getInstance();
$customerSession = $objectManager->get('MagentoCustomerModelSession');
if($customerSession->isLoggedIn()) //apply logic here
answered Feb 8 '17 at 5:06
Faisal KazmiFaisal Kazmi
215 bronze badges
215 bronze badges
add a comment |
add a comment |
You can remove via overriding theme layout or xml file.
app/design/frontend/Package/themename/Magento_Customer/layout/default.xml
<referenceBlock name="top.links">
<referenceBlock name="register-link" remove="true" /> <!--for Create Account Link-->
<referenceBlock name="my-account-link" remove="true" /> <!--for My Account Link-->
</referenceBlock>
I hope this will help you
This will always remove My Account link, I need to remove it only when the customer is logged out
– gianis6
Feb 8 '17 at 9:49
I need to display My Account link only for logged in customer
– gianis6
Feb 8 '17 at 9:53
add a comment |
You can remove via overriding theme layout or xml file.
app/design/frontend/Package/themename/Magento_Customer/layout/default.xml
<referenceBlock name="top.links">
<referenceBlock name="register-link" remove="true" /> <!--for Create Account Link-->
<referenceBlock name="my-account-link" remove="true" /> <!--for My Account Link-->
</referenceBlock>
I hope this will help you
This will always remove My Account link, I need to remove it only when the customer is logged out
– gianis6
Feb 8 '17 at 9:49
I need to display My Account link only for logged in customer
– gianis6
Feb 8 '17 at 9:53
add a comment |
You can remove via overriding theme layout or xml file.
app/design/frontend/Package/themename/Magento_Customer/layout/default.xml
<referenceBlock name="top.links">
<referenceBlock name="register-link" remove="true" /> <!--for Create Account Link-->
<referenceBlock name="my-account-link" remove="true" /> <!--for My Account Link-->
</referenceBlock>
I hope this will help you
You can remove via overriding theme layout or xml file.
app/design/frontend/Package/themename/Magento_Customer/layout/default.xml
<referenceBlock name="top.links">
<referenceBlock name="register-link" remove="true" /> <!--for Create Account Link-->
<referenceBlock name="my-account-link" remove="true" /> <!--for My Account Link-->
</referenceBlock>
I hope this will help you
answered Feb 8 '17 at 9:35
NitsNits
1,2694 silver badges17 bronze badges
1,2694 silver badges17 bronze badges
This will always remove My Account link, I need to remove it only when the customer is logged out
– gianis6
Feb 8 '17 at 9:49
I need to display My Account link only for logged in customer
– gianis6
Feb 8 '17 at 9:53
add a comment |
This will always remove My Account link, I need to remove it only when the customer is logged out
– gianis6
Feb 8 '17 at 9:49
I need to display My Account link only for logged in customer
– gianis6
Feb 8 '17 at 9:53
This will always remove My Account link, I need to remove it only when the customer is logged out
– gianis6
Feb 8 '17 at 9:49
This will always remove My Account link, I need to remove it only when the customer is logged out
– gianis6
Feb 8 '17 at 9:49
I need to display My Account link only for logged in customer
– gianis6
Feb 8 '17 at 9:53
I need to display My Account link only for logged in customer
– gianis6
Feb 8 '17 at 9:53
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%2f158641%2fmagento-2-remove-top-links-when-customer-not-logged-in%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