/AutoWebsiteSwitcher

Magento 2 Auto Website Switcher based on GEO IP

Primary LanguagePHP

AutoWebsiteSwitcher

Magento 2 Auto Website Switcher based on GEO IP

To configure Multiple Website Based on GEO Ip please follow below steps.

step #1: Created multi websites, stores and store views from magento admin panel. Don't forget to change the base url and secure url for new website/store.

step #2: Install Darsh_WebsiteSwitch module, with extract provided zip file.
=> In the zip file "app/code/Darsh" folder contains the multi website switcher code.
=> "canada", "in", "mexico", "uk", and "usa" folder is created for multiwebsite switcher. Based on your requirement and create website code create folder on magento 2 root. Each module will require "index.php" and ".htaccess".
=> In magento 2 need to set "Simlinks" to newly created website folder. To set simlinks go to new created folder using SSH and run below commands.

  1. ln -s /var/www/html/XXXX/app/ app

2) ln -s /var/www/html/XXXX/lib/ lib
3) ln -s /var/www/html/XXXX/pub/ pub
4) ln -s /var/www/html/XXXX/var/ var

step #3: Dont forgot to upload "var/geoip/ip2country/ip2country.dat" to your project var folder.
step #4:Now Run below commands. To make multi site working correctly.
php bin/magento setup:upgrade
php bin/magento setup:static-content:deploy -f