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

          Get product attribute by attribute group code in magento 2get product attribute by product attribute group in magento 2Magento 2 Log Bundle Product Data in List Page?How to get all product attribute of a attribute group of Default attribute set?Magento 2.1 Create a filter in the product grid by new attributeMagento 2 : Get Product Attribute values By GroupMagento 2 How to get all existing values for one attributeMagento 2 get custom attribute of a single product inside a pluginMagento 2.3 How to get all the Multi Source Inventory (MSI) locations collection in custom module?Magento2: how to develop rest API to get new productsGet product attribute by attribute group code ( [attribute_group_code] ) in magento 2

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

          Magento 2.3: How do i solve this, Not registered handle, on custom form?How 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?Magento 2.2.5: Overriding Admin Controller sales/orderMagento 2.2.5: Add, Update and Delete existing products Custom OptionsMagento 2.3 : File Upload issue in UI Component FormMagento2 Not registered handleHow to configured Form Builder Js in my custom magento 2.3.0 module?Magento 2.3. How to create image upload field in an admin form