TransWikia.com

How can I hide the store switcher

Magento Asked by Núria on February 4, 2021

I want to hide the store switcher of the top of my page.
I’m using Magento 2.1.9
How can I do this?
enter image description here

4 Answers

For me, using the Ultimo theme for Magento 2, after I added a new Store View this dropdown appeared on the frontend with an ID of "switcher-language". To remove it, I made the following changes to this file:

  • app/design/frontend/THEME/CHILD/Magento_Theme/layout/default.xml
  1. Added to bottom: <referenceBlock name="store_language" remove="true"/>

  2. Commented out this section: <block class="MagentoStoreBlockSwitcher" name="store_language.mobile" template="switch/languages.phtml"> <arguments><argument name="id_modifier" xsi:type="string">mobile</argument?</arguments></block>

Answered by Mike Dubs on February 4, 2021

For Magento 2, you can hide the store switcher by removing the store_switcher block. To remove the store_switcher block, extend the Magento_Theme default.xml file by creating the default.xml in your theme: app/design/frontend/your_vendor_name/your_theme_name/Magento_Theme/layout/default.xml

In the default.xml file:

<body>    
   <referenceBlock name="store_switcher" remove="true"/>
</body>

Then clear cache: bin/magento cache:clean

Answered by Emamuzo on February 4, 2021

For Magento 2 you can disable it via your customer theme folder. In your file app/design/frontend///Magento_Theme/layout/default.xml you can add the line between the tag

...
<body>
    <referenceBlock name="store_switcher" remove="true"/>
...

Flush the cache afterwards.

Answered by medina on February 4, 2021

Under

/public_html/app/design/frontend/vendor/theme/Magento_Theme/web/css/source

you create a file called:_extend.less

add this code in it:

.switcher select
{
display:none
}

Clear your cache afterwards and it should works. If it doesn't, maybe the CSS Selector is wrong, so you have to find the correct one.

The effect of this addition is that the Language switcher will not be rendered, it will still get loaded by your Magento.

Answered by Thomas Meier on February 4, 2021

Add your own answers!

Ask a Question

Get help from others!

© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP