[仅限PaaS]{class="badge informative" title="仅适用于云项目(Adobe管理的PaaS基础架构)和内部部署项目上的Adobe Commerce 。"}
ACSD-66120:当目录价格包含税时,GraphQL显示不正确的折扣百分比和基本价格
ACSD-66120修补程序修复了在将目录价格配置为含税时,GraphQL错误地显示折扣百分比和基本价格的问题。 此问题导致舍入误差,例如显示19.99%的折扣,而不是预期的20%。 安装Quality Patches Tool (QPT) 1.1.70时,此修补程序可用。 修补程序ID为ACSD-66120。 请注意,此问题计划在Adobe Commerce 2.4.9中修复。
受影响的产品和版本
为Adobe Commerce版本创建了修补程序:
- Adobe Commerce(所有部署方法) 2.4.6-p9
与Adobe Commerce版本兼容:
- Adobe Commerce(所有部署方法) 2.4.4 - 2.4.8-p2
magento/quality-patches包更新到最新版本,并在Quality Patches Tool:搜索修补程序页面上检查兼容性。 使用修补程序ID作为搜索关键字来查找修补程序。问题
将目录价格配置为包含税时,GraphQL错误地显示折扣百分比和基本价格。 由于舍入错误,折扣百分比显示为19.99%,而不是配置的20%。
重现步骤:
-
转到 Stores > Settings > Configuration > Catalog > Catalog > Price。
-
将 Catalog Price Scope 设置为 网站。
-
转到 Stores > Settings > Configuration > Sales > Tax > Calculation Settings。
- 将 Tax Calculation Method Based On 设置为 单价。
- 将 Catalog Prices 设置为 含税。
- 将 Apply Discount On Prices 设置为 含税。
-
转到 Stores > Settings > Configuration > Sales > Tax > Default Tax Destination Calculation。
- 将 Default Country 设置为 法国。
-
转到 Stores > Tax Zones and Rates > Add new Tax Rate。
- 在 Tax Identifier 字段中输入任意名称。
- 在 Zip/Post Code 字段中输入星号(*)。
- 将 Country 设置为 法国。
- 在 字段中输入 20.000000 Rate Percent。
- 单击 Save。
-
转到 Stores > Tax Rules > Add New Tax Rule。
- 在 Name 字段中输入任意名称。
- 将 Tax Rate 设置为在上一步中添加的速率。
-
转到 Catalog > Products > Add Product。
- 在 字段中输入 test Product Name。
- 在 字段中输入 test SKU。
- 在 字段中输入 82.65 Price。
- 将 Tax Class 设置为 应纳税商品。
- 在 字段中输入 100 Quantity。
- 单击 Save。
-
将范围更改为 默认存储视图。
- 取消设置 Use Default Value 价格。
- 将 Price 设置为 68.87。
- 在税类上取消设置 Use Default Value。
- 将 Tax Class 设置为 应纳税商品。
- 单击 Save。
-
转到 Marketing > Promotions > Catalog Price Rule > Add New Rule。
- 在 Rule Name 字段中输入任意名称。
- 将 Active 设置为 是。
- 将 Website 设置为 主网站。
- 将 Customer Groups 设置为 所有
- 在 Actions 下,将 Apply 设置为 应用为原始 的百分比。
- 在 字段中输入 20.000000 Discount Amount。
- 单击 Save。
-
执行完全重新索引:
$ bin/magento index:reindex
- 使用标头中设置的GraphQL执行以下 Store 查询: default:
query{
products(filter: {sku: {eq: "test"}}, sort: {name: ASC}) {
items {
name
sku
price_range {
minimum_price {
regular_price {
value
currency
}
final_price {
value
currency
}
discount {
amount_off
percent_off
}
}
maximum_price {
regular_price {
value
currency
}
final_price {
value
currency
}
discount {
amount_off
percent_off
}
}
}
}
}
}
预期的结果:
折扣百分比应符合目录规则:20%。
实际结果:
折扣百分比显示为19.99%有误。
应用修补程序
要应用单独的修补程序,请根据您的部署方法使用以下链接:
- Adobe Commerce或Magento Open Source内部部署: Quality Patches Tool 指南中的>使用情况Quality Patches Tool。
- 云基础架构上的Adobe Commerce:云基础架构上的Commerce指南中的升级和修补程序>应用修补程序。
相关阅读
要了解有关Quality Patches Tool的更多信息,请参阅: