tete2soja / magento2-geoip
基于IP地址查找客户所在国家
1.1.5
2024-03-26 08:50 UTC
Requires
- php: ~5.6.0|7.0.2|7.0.4|~7.0.6|~7.1.0|~7.1.3|~7.2.0|~7.3.0|~7.4.0|~8.0.0|~8.1.0|~8.2.0
- geoip2/geoip2: ~2.0
- magento/framework: 100.0.*|100.1.*|101.0.*|102.0.*|103.0.*
- magento/module-backend: 100.0.*|100.1.*|100.2.*|101.0.*|102.0.*
This package is auto-updated.
Last update: 2024-09-26 09:46:42 UTC
README
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 扩展
- 自定义SMTP
- Magento的目录悬停图像
- Magento 2增强的成功页面
- Magento 2增强的交易电子邮件
- Google Tag Manager
- 增强型电子商务
- 重新索引
- 自定义配送方式
- 预览订单确认
- 访客到客户
- 管理员表单字段管理器
- 客户仪表板链接管理器
- 懒加载
- 订单确认页面杂项脚本
- Magento2的HTML压缩器
© MagePal LLC. | www.magepal.com