plugineria / product-shipping-price-magento2
在Magento2中显示产品运费
1.0.0
2021-02-21 05:48 UTC
Requires
- php: ~7.3.0||~7.4.0
- magento/framework: ^102.0||^103.0
- magento/module-catalog: ^103.0||^104.0
- magento/module-configurable-product: ^100
- magento/module-customer: ^102.0||^103.0
- magento/module-quote: ^101.1
- magento/module-shipping: ^100.3
- magento/module-store: ^101.0
- magento/module-webapi: ^100.0
- plugineria/product-shipping-price: ^0.2.2
Requires (Dev)
- magento/magento-coding-standard: ^6.0
- magento/magento2-base: ^2.3
- magento/module-dhl: ^100.3
- magento/module-eav: ^102.1
- magento/module-fedex: ^100.3
- magento/module-offline-shipping: ^100.3
- magento/module-ups: ^100.3
- magento/module-usps: ^100.3
- magento/theme-frontend-blank: ^100.3
- magepal/magento2-customshippingrate: ^1.6
- phpstan/phpstan: ^0.12.64
- phpunit/phpunit: ^9.5
- shipperhq/module-shipper: ^20.39
- slevomat/coding-standard: ^6.4
- squizlabs/php_codesniffer: ^3.5
- symfony/dom-crawler: ^4.4
- symfony/http-client: ^5.2
- tddwizard/magento2-fixtures: ^1.0
- webshopapps/module-matrixrate: ^20.1
Replaces
This package is auto-updated.
Last update: 2024-09-21 23:53:08 UTC
README
在产品页面上直接估算产品运费。
- 计算产品页面上可用的最低运费。
- 在将产品添加到购物车之前显示单个产品的所有可用运费选项。
- 提供REST API端点
- 可以配置默认的运费地址或使用注册用户的现有地址。
测试的运费方式
- 平邮费
- DHL
- UPS
- 美国邮政服务
- 联邦快递
- 免费运费
- 表格运费
测试的产品类型
- 简单
- 虚拟
- 可配置
架构
这是一个基于Magento2模块的实现,采用了六边形架构,由Yury Ksenevich创建。
源代码分为4层
- 领域/业务逻辑 - 在
plugineria/product-shipping-price
库中实现。 - 应用逻辑 - 在
plugineria/product-shipping-price
库中实现。 - 基础设施 - 针对业务逻辑的Magento特定适配器,位于
Magento2/Infrastructure/
- UI - API端点、前端控制器和路由器位于
Magento2/Ui/
系统要求
- 测试过的Magento版本:2.3.6+,2.4.1+
- PHP 7.3或7.4
作为Magento2模块安装
:warning: 请注意,您只能使用composer安装此扩展。
- 备份您的商店数据库和网页目录
打开终端并移动到Magento根目录
在控制台中运行以下命令
composer require plugineria/product-shipping-price-magento2
bin/magento module:enable Plugineria_ProductShippingPrice
在
admin
>Stores
>Configuration
>Plugineria
>Product Shipping Price
>Example Shipping Address
中配置示例运费地址刷新缓存
REST API
GET /V1/products/{sku}/shippingRates
获取产品的运费列表
请求参数
- sku - 字符串产品SKU
响应
[
{
"price": 0,
"code": "string",
"title": "string",
"description": "string",
"shipping_method": {
"id": "string",
"title": "string"
}
}
]
GET /V1/products/{sku}/shippingRates/minimal
获取产品的最低运费
请求参数
- sku - 字符串产品SKU
响应
如果找到运费
{
"price": 0,
"code": "string",
"title": "string",
"description": "string",
"shipping_method": {
"id": "string",
"title": "string"
}
}
如果没有找到运费
{}
用户界面
产品页
添加到购物车部分中的最低运费块
显示产品所有运费的弹出窗口
许可证
- OSL 3.0
- AFL 3.0
- 图标由Semantic UI提供
- 不提供任何明示或暗示的保证。
贡献
通过对此项目的贡献,您授予所有用户在全球范围内、免版税、永久、不可撤销、非独占、可转让的许可,许可条件与本项目分发的许可条款相同。