Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Code Block
composer require "creativestyle/magesuite-geolocation" ^1.0.0

This extension requires a custom second extension that contains MaxMind GeoIP2 Country Database file.

We’re not able to provide such an extension because of the file licensing.

Such extension must implement \MageSuite\Geolocation\Model\Asset\DatabasePathResolverInterface interface that returns absolute file path to mmdb file, an example implementation below:

etc/di.xml:

Code Block
languagexml
<?xml version="1.0"?>
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:ObjectManager/etc/config.xsd">
    <preference for="MageSuite\Geolocation\Model\Asset\DatabasePathResolverInterface"
                type="MageSuite\GeolocationDatabase\Model\Asset\DatabasePathResolver" />
</config>
Code Block
languagephp
<?php

namespace MageSuite\GeolocationDatabase\Model\Asset;

class DatabasePathResolver implements \MageSuite\Geolocation\Model\Asset\DatabasePathResolverInterface
{
    /**
     * @inheritDoc
     */
    public function getPath() {
        return realpath(__DIR__ . '/GeoLite2-Country.mmdb');
    }
}

Admin settings

There are no admin settings, the module is active when installed.

...