[仅限PaaS]{class="badge informative" title="仅适用于云项目(Adobe管理的PaaS基础架构)和内部部署项目上的Adobe Commerce 。"}

ACSD-56158:对购物车应用多个税则时,GraphQL响应中的税值错误

ACSD-56158修补程序修复了将多个税则应用于购物车时,GraphQL响应中的税值呈现不正确的问题。 安装Quality Patches Tool (QPT) 1.1.44时,此修补程序可用。 修补程序ID为ACSD-56158。 请注意,该问题计划在Adobe Commerce 2.4.7中修复。

受影响的产品和版本

为Adobe Commerce版本创建了修补程序:

  • Adobe Commerce(所有部署方法) 2.4.5-p5

与Adobe Commerce版本兼容:

  • Adobe Commerce(所有部署方法) 2.4.5-p5 - 2.4.6-p3
NOTE
该修补程序可能适用于具有新Quality Patches Tool发行版本的其他版本。 要检查修补程序是否与您的Adobe Commerce版本兼容,请将magento/quality-patches包更新到最新版本,并在Quality Patches Tool:搜索修补程序页面上检查兼容性。 使用修补程序ID作为搜索关键字来查找修补程序。

问题

将多个税则应用于购物车时,GraphQL响应中的税值呈现不正确。

重现步骤

  1. 创建具有美国地址的客户。

  2. 导航到管理面板。

  3. 创建价格为$100的产品。

  4. 为美国地址制定两种税率:一种为10%,另一种为5%。

  5. 从​ Stores > Taxes > Tax Rule ​为USA配置两个税则。

  6. 将一个税率分配给一个规则。

  7. 从前端,以具有美国地址的客户身份登录,然后将产品添加到购物车。

  8. 通过GraphQL生成客户令牌。

  9. 通过GraphQL生成购物车ID。

  10. 通过GraphQL获取客户的购物车,检查所申请的税款是否正确:

    code language-graphql
    {
        cart(cart_id: "o3Yqt6zkn8ncOzFxGnR1IWdT..") {
            id
            email
            billing_address {
                city
                country {
                    code
                    label
                }
                firstname
                lastname
                company
                postcode
                vat_id
                region {
                    code
                    label
                }
                street
                telephone
            }
            shipping_addresses {
                firstname
                lastname
                company
                street
                city
                postcode
                vat_id
                region {
                    code
                    label
                }
                country {
                    code
                    label
                }
                telephone
                available_shipping_methods {
                    amount {
                        currency
                        value
                    }
                    available
                    carrier_code
                    carrier_title
                    error_message
                    method_code
                    method_title
                    price_excl_tax {
                        value
                        currency
                    }
                    price_incl_tax {
                        value
                        currency
                    }
                }
                selected_shipping_method {
                    amount {
                        value
                        currency
                    }
                    carrier_code
                    carrier_title
                    method_code
                    method_title
                }
            }
            available_payment_methods {
                code
                title
            }
            selected_payment_method {
                code
                title
            }
            applied_coupons {
                code
            }
            prices {
                grand_total {
                    value
                    currency
                }
                subtotal_excluding_tax {
                    value
                    currency
                }
                subtotal_including_tax {
                    value
                    currency
                }
                applied_taxes {
                    label
                    amount {
                        currency
                        value
                    }
                }
            }
        }
    }
    

预期的结果

各税率显示其自身的税额:

"applied_taxes": [
    {
        "label": "US-CA-*-Rate 1",
        "amount": {
            "currency": "USD",
            "value": 10
        }
    },
    {
        "label": "US-CA-*-Rate 2",
        "amount": {
            "currency": "USD",
            "value": 5
        }
    }
]

实际结果

每个规则退回的总税额:

"applied_taxes": [
    {
        "label": "US-CA-*-Rate 1",
        "amount": {
            "currency": "USD",
            "value": 15
        }
    },
    {
        "label": "US-CA-*-Rate 2",
        "amount": {
            "currency": "USD",
            "value": 15
        }
    }
]

应用修补程序

要应用单独的修补程序,请根据您的部署方法使用以下链接:

相关阅读

要了解有关Quality Patches Tool的更多信息,请参阅:

有关QPT中其他可用修补程序的信息,请参阅Quality Patches Tool指南中的:搜索修补程序Quality Patches Tool。

recommendation-more-help
c2d96e17-5179-455c-ad3a-e1697bb4e8c3