chapagain / magento2-autocurrency
Magento 2 自动货币切换扩展
2.1.2
2021-08-12 00:11 UTC
Requires
- php: ~7.0.13||~7.1.0||~7.2.0||~7.3.0
- magento/framework: ~100.1 || ~101.0 || ~102.0
- magento/module-config: *
- magento/module-store: *
This package is auto-updated.
Last update: 2024-09-12 06:50:16 UTC
README
自动将商店货币切换为访客的本地货币 - "Magento 2" 扩展
Auto Currency 扩展会跟踪访客的 IP 地址,并自动将商店货币更改为访客所在位置的货币。访客可以在任何时候切换到他们想要的货币。
此扩展使用 Webnet77的Ip2Country
IP 地址数据库进行 IP 地址查找。
先决条件
在您的 Magento 2 商店中启用多货币
- 登录到 Magento 2 管理员
- 转到
STORES -> Configuration -> GENERAL -> Currency Setup -> Currency Options
- 在
Allowed Currencies
框中,选择您要在网站/商店中启用的货币 - 现在,转到
STORES -> Currency Rates
- 点击导入按钮导入货币汇率,或手动添加汇率
- 然后,点击
Save Currency Rates
按钮
安装
手动安装
- 模块的文件应放置在文件夹中:
app/code/Chapagain/AutoCurrency
- 打开终端/命令提示符
- 使用以下命令转到您的 Magento 网站根目录
cd /path/to/your/magento/root/directory
- 使用以下命令启用模块并清除静态内容
php bin/magento module:enable Chapagain_AutoCurrency –clear-static-content
- 使用以下命令进行设置升级
php bin/magento setup:upgrade
Composer 安装
- 使用以下命令转到您的 Magento 网站根目录
cd /path/to/your/magento/root/directory
- 运行以下命令
composer require chapagain/magento2-autocurrency
- 使用以下命令启用模块并清除静态内容
php bin/magento module:enable Chapagain_AutoCurrency –clear-static-content
- 使用以下命令进行设置升级
php bin/magento setup:upgrade
配置设置
- 登录到您的 Magento 网站管理员
- 转到
STORES → Settings → Configuration
页面 - 在左侧边栏中,点击
CHAPAGAIN EXTENSIONS → Auto Currency
菜单 - 从那里,您可以启用/禁用模块。模块默认启用。
更新 GeoIP 数据库
为了使此扩展准确工作,应定期更新 GeoIP 数据库。
- 下载 IPV4 CSV 文件
- 解压缩文件。这将解压缩
IPtoCountry.csv
文件。 - 使用 Ip2Country 查找类 PHP 创建 csv 文件的二进制优化版本。
- 将二进制文件(
.dat
文件)上传到您的[Module Folder]/geoip/ip2country/
文件夹。