1

I trying to move the language switcher on mobile devices to be in the main website menu instead of the settings tab (screenshot below):

enter image description here

I found some instructions on how to do that from the layout.xml file using

<move element="name.of.an.element" destination="name.of.destination.element"/>

However, I couldn't find the values for element and destination attributes.

Magento V. 2.3.5

2 Answers 2

1

Here is the code which might help you.

Add default.xml file at following path

app/design/frontend/ThemeVendor/ThemeName/Magento_Theme/layout/default.xml

<?xml version="1.0"?>
<!--
/**
 * Copyright © Magento, Inc. All rights reserved.
 * See COPYING.txt for license details.
 */
-->
<page layout="3columns" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd">
    <update handle="default_head_blocks"/>
    <body>
        <referenceBlock name="store.menu">
            <block class="Magento\Store\Block\Switcher" name="store_language_mobile" as="store_language_mobile" template="Magento_Store::switch/languages.phtml">
                <arguments>
                    <argument name="view_model" xsi:type="object">Magento\Store\ViewModel\SwitcherUrlProvider</argument>
                </arguments>
            </block>
        </referenceBlock>
        <!-- <referenceBlock name="store.settings" remove="true" /> -->
    </body>
</page>

If you don't want to keep settings menu in mobile then uncomment

<referenceBlock name="store.settings" remove="true" />

Mobile Menu

0

Add the below code in your default.xml file

Path :

app/design/frontend/YourTheme/Package/Magento_Theme/layout/default.xml

<referenceBlock name="store.menu">
    <arguments>
        <argument name="title" translate="true" xsi:type="string">Change Here</argument>
        </arguments>
</referenceBlock>

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.