0

I want to move my store switcher from footer to top header bar like this

like show this is footer screen shoot enter image description here

enter image description here

at here right side of create account link in Magento 2.4

1 Answer 1

0

to move store switcher to top header so should out code in default.xml file

<move element="store_switcher" destination="header.panel" after="header.links" />

here my default.xml file is this

<?xml version="1.0"?>
<!--
/**
 * Copyright © Magento, Inc. All rights reserved.
 * See COPYING.txt for license details.
 */
-->
<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd">
    <body>
        <referenceContainer name="header.panel">
            <block class="Magento\Framework\View\Element\Html\Links" name="header.links">
                <arguments>
                    <argument name="css_class" xsi:type="string">header links</argument>
                </arguments>
            </block>
        </referenceContainer>
        <referenceContainer name="footer">
            <block class="Magento\Store\Block\Switcher" name="store_switcher" as="store_switcher" after="footer_links" template="Magento_Store::switch/stores.phtml"/>
        </referenceContainer>
        <referenceBlock name="report.bugs" remove="true"/>
        <move element="copyright" destination="before.body.end"/>
        <move element="store_switcher" destination="header.panel" after="header.links" />
        <referenceBlock name="custom-header-link" remove="true" />  
    </body>
</page>

from using this i successfully move the store switcher from footer to top header see the below screen shoot.

enter image description here

enter image description here

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.