Stable
v1.1.2
39,127
Downloads
Below average
5
GitHub Stars
Below average
6mo ago
Last Release
0
Open Issues
Build Passing
Ready to install
Build Tests
Composer Install
DI Compile
Templates
Code Quality
Release Discipline
Release history audited up to v1.1.2
Tested on Magento 2.4.9
Recent Test History
Each release is tested against the latest Magento version at that time.
v1.1.2
on Magento 2.4.9
v1.1.2
on Magento 2.4.8-p4
v1.1.2
on Magento 2.4.8-p3
v1.1.1
on Magento 2.4.8-p3
GitHub Repository
Source code & docs
Packagist
Version history
Issues & Support
Get help or report bugs
Top Contributors
View LeaderboardShare This Module's Status
README
Loaded from GitHubMagento 2 GeoIp
Magento 2 module providing basic Geo IP detection.
API
REST
$ curl https://<magento site>/rest/V1/countryCode
"NL"
PHP
<?php
namespace Acme\Component;
use Mooore\GeoIp\Api\CountryCodeInterface;
class SomeComponent
{
/**
* @var \Mooore\GeoIp\Api\CountryCodeInterface
*/
private $countryCode;
public function __construct(CountryCodeInterface $countryCode)
{
$this->countryCode = $countryCode;
}
public function execute(): void
{
//output: Country is NL
echo sprintf('Country is %s', $this->countryCode->get());
}
}
Installation
composer require mooore/magento2-module-geoip
bin/magento setup:upgrade
Configuration
This module has a fallback reliance on several inputs:
- GeoIP variable
GEOIP_COUNTRY_CODE. - GeoIP2 variable
COUNTRY_CODE. - Cloudflare header
CF-IPCountry. - IpInfo.io API.
To be able to fall back on IpInfo.io, follow these steps:
- Have an account at ipinfo.io (usage is free for 50k requests per month).
- Have the ipinfo.io API key.
- Configure it in the Magento 2 backend (Advanced -> System -> GeoIP):

This content is fetched directly from the module's GitHub repository. We are not the authors of this content and take no responsibility for its accuracy, completeness, or any consequences arising from its use.