Magento 2 : Store Switcher In admin not workingCurrent store is 1 when running upgrade scriptsIs it necessary to override _isAllowed in your Admin controller?Default values is not fine, Default wide > English is perfectMagento2 Create Order in Backend always same storeHow to get current Website ID in the Admin Panel?Magento get store Name in a file which is in root directoryMagento 2 Multistore is not working with multi domainSwitch store programatically magento 2Form is not displayed on panel admin Magento 2My extension links not showing on custom roles on admin
Is the infant mortality rate among African-American babies in Youngstown, Ohio greater than that of babies in Iran?
Can a non-invertible function be inverted by returning a set of all possible solutions?
What are the mechanical differences between Adapt and Monstrosity?
Why is Skinner so awkward in Hot Fuzz?
How useful is the GRE Exam?
How did space travel spread through the galaxy?
Is swap gate equivalent to just exchanging the wire of the two qubits?
Explicit direct #include vs. Non-contractual transitive #include
How to avoid offending original culture when making conculture inspired from original
Why can't I craft scaffolding in Minecraft 1.14?
Basic power tool set for Home repair and simple projects
How can Caller ID be faked?
The instant an accelerating object has zero speed, is it speeding up, slowing down, or neither?
Is there any effect in D&D 5e that cannot be undone?
How did Avada Kedavra get its name?
Are their examples of rowers who also fought?
How to address players struggling with simple controls?
Lead the way to this Literary Knight to its final “DESTINATION”
What is "dot" sign in •NO?
Interview was just a one hour panel. Got an offer the next day; do I accept or is this a red flag?
Can you cover a cube with copies of this shape?
How to prevent cables getting intertwined
How to know whether to write accidentals as sharps or flats?
Do my partner and son need an SSN to be dependents on my taxes?
Magento 2 : Store Switcher In admin not working
Current store is 1 when running upgrade scriptsIs it necessary to override _isAllowed in your Admin controller?Default values is not fine, Default wide > English is perfectMagento2 Create Order in Backend always same storeHow to get current Website ID in the Admin Panel?Magento get store Name in a file which is in root directoryMagento 2 Multistore is not working with multi domainSwitch store programatically magento 2Form is not displayed on panel admin Magento 2My extension links not showing on custom roles on admin
.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty margin-bottom:0;
In Magento 2 admin side, I added store switcher in phtml file using this code.
protected function _prepareLayout()
$this->getToolbar()->addChild(
'store_switcher',
'MagentoBackendBlockStoreSwitcher'
);
return parent::_prepareLayout();
So above code show store selection in phtml file as below,
When I select diffrent store from the list, then admin URL is change,
but when I access store information in phtml like this $this->_storeManager->getStore()->getCode()
but it always return "default" not selected store code. Can Any one have idea.
magento2 adminhtml store-view
add a comment |
In Magento 2 admin side, I added store switcher in phtml file using this code.
protected function _prepareLayout()
$this->getToolbar()->addChild(
'store_switcher',
'MagentoBackendBlockStoreSwitcher'
);
return parent::_prepareLayout();
So above code show store selection in phtml file as below,
When I select diffrent store from the list, then admin URL is change,
but when I access store information in phtml like this $this->_storeManager->getStore()->getCode()
but it always return "default" not selected store code. Can Any one have idea.
magento2 adminhtml store-view
add a comment |
In Magento 2 admin side, I added store switcher in phtml file using this code.
protected function _prepareLayout()
$this->getToolbar()->addChild(
'store_switcher',
'MagentoBackendBlockStoreSwitcher'
);
return parent::_prepareLayout();
So above code show store selection in phtml file as below,
When I select diffrent store from the list, then admin URL is change,
but when I access store information in phtml like this $this->_storeManager->getStore()->getCode()
but it always return "default" not selected store code. Can Any one have idea.
magento2 adminhtml store-view
In Magento 2 admin side, I added store switcher in phtml file using this code.
protected function _prepareLayout()
$this->getToolbar()->addChild(
'store_switcher',
'MagentoBackendBlockStoreSwitcher'
);
return parent::_prepareLayout();
So above code show store selection in phtml file as below,
When I select diffrent store from the list, then admin URL is change,
but when I access store information in phtml like this $this->_storeManager->getStore()->getCode()
but it always return "default" not selected store code. Can Any one have idea.
magento2 adminhtml store-view
magento2 adminhtml store-view
asked Jan 4 '17 at 13:10
Dhiren VasoyaDhiren Vasoya
4,75551946
4,75551946
add a comment |
add a comment |
1 Answer
1
active
oldest
votes
<?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" layout="admin-2columns-left">
<body>
<referenceContainer name="page.main.actions">
<block class="MagentoBackendBlockStoreSwitcher" name="store_switcher">
<action method="setUseConfirm">
<argument name="params" xsi:type="string">1</argument>
</action>
</block>
</referenceContainer>
</body>
</page>
Thanks for the answer. But I already solve the problem.
– Dhiren Vasoya
May 2 '18 at 13:22
but you can accept answer) or publish yours ;)
– Slava Yurthev
May 6 '18 at 12:14
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%2f153116%2fmagento-2-store-switcher-in-admin-not-working%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
<?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" layout="admin-2columns-left">
<body>
<referenceContainer name="page.main.actions">
<block class="MagentoBackendBlockStoreSwitcher" name="store_switcher">
<action method="setUseConfirm">
<argument name="params" xsi:type="string">1</argument>
</action>
</block>
</referenceContainer>
</body>
</page>
Thanks for the answer. But I already solve the problem.
– Dhiren Vasoya
May 2 '18 at 13:22
but you can accept answer) or publish yours ;)
– Slava Yurthev
May 6 '18 at 12:14
add a comment |
<?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" layout="admin-2columns-left">
<body>
<referenceContainer name="page.main.actions">
<block class="MagentoBackendBlockStoreSwitcher" name="store_switcher">
<action method="setUseConfirm">
<argument name="params" xsi:type="string">1</argument>
</action>
</block>
</referenceContainer>
</body>
</page>
Thanks for the answer. But I already solve the problem.
– Dhiren Vasoya
May 2 '18 at 13:22
but you can accept answer) or publish yours ;)
– Slava Yurthev
May 6 '18 at 12:14
add a comment |
<?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" layout="admin-2columns-left">
<body>
<referenceContainer name="page.main.actions">
<block class="MagentoBackendBlockStoreSwitcher" name="store_switcher">
<action method="setUseConfirm">
<argument name="params" xsi:type="string">1</argument>
</action>
</block>
</referenceContainer>
</body>
</page>
<?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" layout="admin-2columns-left">
<body>
<referenceContainer name="page.main.actions">
<block class="MagentoBackendBlockStoreSwitcher" name="store_switcher">
<action method="setUseConfirm">
<argument name="params" xsi:type="string">1</argument>
</action>
</block>
</referenceContainer>
</body>
</page>
answered Apr 30 '18 at 14:51
Slava YurthevSlava Yurthev
628
628
Thanks for the answer. But I already solve the problem.
– Dhiren Vasoya
May 2 '18 at 13:22
but you can accept answer) or publish yours ;)
– Slava Yurthev
May 6 '18 at 12:14
add a comment |
Thanks for the answer. But I already solve the problem.
– Dhiren Vasoya
May 2 '18 at 13:22
but you can accept answer) or publish yours ;)
– Slava Yurthev
May 6 '18 at 12:14
Thanks for the answer. But I already solve the problem.
– Dhiren Vasoya
May 2 '18 at 13:22
Thanks for the answer. But I already solve the problem.
– Dhiren Vasoya
May 2 '18 at 13:22
but you can accept answer) or publish yours ;)
– Slava Yurthev
May 6 '18 at 12:14
but you can accept answer) or publish yours ;)
– Slava Yurthev
May 6 '18 at 12:14
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%2f153116%2fmagento-2-store-switcher-in-admin-not-working%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