承接 mooore/magento2-module-geoip 相关项目开发

从需求分析到上线部署,全程专人跟进,保证项目质量与交付效率

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

mooore/magento2-module-geoip

最新稳定版本:1.1.1

Composer 安装命令:

composer require mooore/magento2-module-geoip

包简介

Magento 2 module providing basic Geo IP detection.

README 文档

README

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:

  1. GeoIP variable GEOIP_COUNTRY_CODE.
  2. GeoIP2 variable COUNTRY_CODE.
  3. Cloudflare header CF-IPCountry.
  4. IpInfo.io API.

To be able to fall back on IpInfo.io, follow these steps:

  1. Have an account at ipinfo.io (usage is free for 50k requests per month).
  2. Have the ipinfo.io API key.
  3. Configure it in the Magento 2 backend (Advanced -> System -> GeoIP): Configuration

统计信息

  • 总下载量: 37.99k
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 5
  • 点击次数: 1
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 5
  • Watchers: 4
  • Forks: 1
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2019-09-23