magefan / module-geoip

Detect Country by IP in Magento 2
Open Software License 3.0
52 stars 10 forks source link
magefan magefan-extension magento magento-2 magento-2-extension magento-2-module magento-2extension-free magento-extension magento-extension-free magento-module magento-module-free magento-plugin magento2 magento2-extension magento2-extension-free magento2-free-extension magento2-module magento2-module-free magento2-plugin

Magento 2 GeoIP Database Extension by Magefan

Total Downloads Latest Stable Version

This Magento 2 GeoIP module provides you PHP methods for getting customer country by IP, without any additional plugin for PHP.

It is used for Magento 2 Currency Auto Switcher and Magento 2 Auto Language Switcher by Magefan

Requirements

Installation Method 1 - Installing via composer

Installation Method 2 - Installing using archive

How To Use

protected $ipToCountryRepository;

public function __construct(
    \Magefan\GeoIp\Model\IpToCountryRepository $ipToCountryRepository,
    ....//other code
) {
    $this->ipToCountryRepository = $ipToCountryRepository;
    ...//other code
}

public function example() {
    $visitorCountyCode = $this->ipToCountryRepository->getVisitorCountryCode();
    $someCountryCodeByIp = $this->ipToCountryRepository->getCountryCode('104.27.164.57');
    ...//other code
}

Support

If you have any issues, please contact us then if you still need help, open a bug report in GitHub's issue tracker.

Need More Features?

Please contact us to get a quote https://magefan.com/contact

License

The code is licensed under Open Software License ("OSL") v. 3.0.

This product includes GeoLite2 data created by MaxMind, available from https://www.maxmind.com.

Originaly use this databases:

https://www.maxmind.com

http://software77.net/geo-ip/

Magento 2 Extensions by Magefan

Magento 2 Google Extensions

Magento 2 SEO Extensions

Magento 2 Speed Optimization Extensions

Magento 2 Blog Extensions

Magento 2 Marketing Automation Extensions

Magento 2 Cart Extensions

Magento 2 Multi-Language Extensions

Developers Tools