#StackBounty: #magento2 #php #api #curl #index.php Change Magento 2 website based on IP

Bounty: 50

I have 3 websites in my current Magento installation and are as follows website1 Code: base, website2 Code: au, website3 Code: ca. Each website has one store and one store_view except for website3 which has 2 store-views.

I want the users to be automatically navigated to a specific website based on their country. For example, all users with the country code US to be navigated to website1.

I have checked that ipinfo.io provides country code through an API call as follow

# Get country ISO code as plaintext
$ curl ipinfo.io/$TOKEN

Can anyone help with its implementation for my Magento 2.2.6 instance?

Get this bounty!!!

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.