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;








2















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,



enter image description here



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.










share|improve this question




























    2















    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,



    enter image description here



    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.










    share|improve this question
























      2












      2








      2








      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,



      enter image description here



      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.










      share|improve this question














      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,



      enter image description here



      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






      share|improve this question













      share|improve this question











      share|improve this question




      share|improve this question










      asked Jan 4 '17 at 13:10









      Dhiren VasoyaDhiren Vasoya

      4,75551946




      4,75551946




















          1 Answer
          1






          active

          oldest

          votes


















          0














          <?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>





          share|improve this answer























          • 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











          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
          );



          );













          draft saved

          draft discarded


















          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









          0














          <?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>





          share|improve this answer























          • 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















          0














          <?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>





          share|improve this answer























          • 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













          0












          0








          0







          <?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>





          share|improve this answer













          <?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>






          share|improve this answer












          share|improve this answer



          share|improve this answer










          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

















          • 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

















          draft saved

          draft discarded
















































          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.




          draft saved


          draft discarded














          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





















































          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







          Popular posts from this blog

          Category:9 (number) SubcategoriesMedia in category "9 (number)"Navigation menuUpload mediaGND ID: 4485639-8Library of Congress authority ID: sh85091979ReasonatorScholiaStatistics

          Circuit construction for execution of conditional statements using least significant bitHow are two different registers being used as “control”?How exactly is the stated composite state of the two registers being produced using the $R_zz$ controlled rotations?Efficiently performing controlled rotations in HHLWould this quantum algorithm implementation work?How to prepare a superposed states of odd integers from $1$ to $sqrtN$?Why is this implementation of the order finding algorithm not working?Circuit construction for Hamiltonian simulationHow can I invert the least significant bit of a certain term of a superposed state?Implementing an oracleImplementing a controlled sum operation

          Magento 2 “No Payment Methods” in Admin New OrderHow to integrate Paypal Express Checkout with the Magento APIMagento 1.5 - Sales > Order > edit order and shipping methods disappearAuto Invoice Check/Money Order Payment methodAdd more simple payment methods?Shipping methods not showingWhat should I do to change payment methods if changing the configuration has no effects?1.9 - No Payment Methods showing upMy Payment Methods not Showing for downloadable/virtual product when checkout?Magento2 API to access internal payment methodHow to call an existing payment methods in the registration form?