Skip to content
Allows country switcher action on the storefront.
PHP HTML JavaScript CSS
Branch: master
Clone or download

Latest commit

Fetching latest commit…
Cannot retrieve the latest commit at this time.

Files

Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
Controller/Country
CustomerData
Model
Test/Unit
ViewModel
etc
view/frontend
LICENSE
README.md
composer.json
registration.php

README.md

Country Switcher Module for Magento 2

Latest Stable Version License: MIT Packagist Packagist

This extension for Magento 2 allows the customers to switch of country instead of store views.

Setup

Magento 2 Open Source or Commerce edition is required.

Composer installation

Run the following composer command:

composer require opengento/module-country-switcher

Setup the module

Run the following magento command:

bin/magento setup:upgrade

If you are in production mode, do not forget to recompile and redeploy the static resources.

Features

Country Switcher

The country to store mapping should be configured first, please refer to the country redirect module features.

Select which countries to be in forehead in the switcher action, and which ones in the background.

Settings

The configuration for this module is available in 'Stores > Configuration > General > Country Redirect'.

Documentation

Legacy Country Store Switcher

Some of the Magento versions have a known issue and the store switcher does not work as intended. In that specific case you have to edit the redirect route path to stores/country/legacyredirect in the file Vendor/Theme/Opengento_CountrySwitcher/layout/default.xml:

<referenceBlock name="store_language">
    <arguments>
        <argument name="urlAction" xsi:type="url" path="stores/country/legacyredirect"/>
    </arguments>
</referenceBlock>
<referenceBlock name="store_language_more">
    <arguments>
        <argument name="urlAction" xsi:type="url" path="stores/country/legacyredirect"/>
    </arguments>
</referenceBlock>
<referenceBlock name="store.settings.language">
    <arguments>
        <argument name="urlAction" xsi:type="url" path="stores/country/legacyredirect"/>
    </arguments>
</referenceBlock>
<referenceBlock name="store.settings.language.more">
    <arguments>
        <argument name="urlAction" xsi:type="url" path="stores/country/legacyredirect"/>
    </arguments>
</referenceBlock>

Support

Raise a new request to the issue tracker.

Authors

  • Opengento Community - Lead - Twitter Follow
  • Thomas Klein - Maintainer - GitHub followers
  • Contributors - Contributor - GitHub contributors

License

This project is licensed under the MIT License - see the LICENSE details.

That's all folks!

You can’t perform that action at this time.