tete2soja/magento2-geoip

基于IP地址查找客户所在国家

安装: 138

依赖项: 0

建议者: 0

安全性: 0

星级: 0

关注者: 0

分支: 9

开放性问题: 0

类型:magento2-module

1.1.5 2024-03-26 08:50 UTC

This package is auto-updated.

Last update: 2024-09-26 09:46:42 UTC


README

Magento Extension Provider

MagePal的Magento2 GeoIp扩展

在Magento2中自动检测访客的国家代码,基于其IP地址。

基础模块:

  • MagePal的GeoIp Country Redirect with Varnish Support
  • MagePal的Quick Checkout。

使用方法

    public function __construct(
        ...
        \MagePal\GeoIp\Service\GeoIpService $geoIpService,
        ....
    ) {
        ...
        $this->geoIpService = $geoIpService;
    }
    
    
    $countryCode = $this->geoIpService->getCountryByIpAddress('128.0.0.101');
    //or
    $countryCode = $this->geoIpService->getCountry();
    

步骤1

使用Composer(推荐)
composer require magepal/magento2-geoip
手动(不推荐)
  • 下载扩展
  • 解压文件
  • 在{Magento 2根目录}/app/code/MagePal/GeoIp创建一个文件夹
  • 从解压文件夹中复制内容
  • 安装GeoIP2包 composer require geoip2/geoip2:~2.0

步骤2 - 启用扩展 ("cd" 到{Magento根目录}文件夹)

  php -f bin/magento module:enable --clear-static-content MagePal_GeoIp
  php -f bin/magento setup:upgrade

贡献

想要为这个扩展做出贡献?最快的方式是向GitHub提交pull request

支持

如果在安装或使用过程中遇到任何问题或错误,请在GitHub上创建一个问题。

需要帮助设置或想定制这个扩展以满足您的业务需求?请发送电子邮件至support@magepal.com,如果我们的想法被采纳,我们将免费或以折扣价添加此功能。

Magento 2 扩展

© MagePal LLC. | www.magepal.com