ACSD-56158: Wrong tax value in GraphQL response when multiple tax rules applied to cart
The ACSD-56158 patch fixes the issue where the tax value rendering in the GraphQL response is incorrect when multiple tax rules are applied to the cart. This patch is available when the Quality Patches Tool (QPT) 1.1.44 is installed. The patch ID is ACSD-56158. Please note that the issue is scheduled to be fixed in Adobe Commerce 2.4.7.
Affected products and versions
The patch is created for Adobe Commerce version:
- Adobe Commerce (all deployment methods) 2.4.5-p5
Compatible with Adobe Commerce versions:
- Adobe Commerce (all deployment methods) 2.4.5-p5 - 2.4.6-p3
magento/quality-patches
package to the latest version and check the compatibility on the Quality Patches Tool: Search for patches page. Use the patch ID as a search keyword to locate the patch.Issue
The tax value rendering in the GraphQL response is incorrect when multiple tax rules are applied to the cart.
Steps to reproduce:
-
Create a customer with a US address.
-
Navigate to the Admin Panel.
-
Create a product with a price of $100.
-
Create two tax rates for the US address: one for 10% and the other for 5%.
-
Configure two tax rules for USA from Stores > Taxes > Tax Rule.
-
Assign one tax rate to one rule.
-
From the frontend, log in as the customer with the US address, and add the product to the cart.
-
Generate a customer token via GraphQL.
-
Generate a cart ID via GraphQL.
-
Check that the tax applied is correct by getting the customer’s cart via 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 } } } } }
Expected results:
Each tax rate shows its own tax amount:
"applied_taxes": [
{
"label": "US-CA-*-Rate 1",
"amount": {
"currency": "USD",
"value": 10
}
},
{
"label": "US-CA-*-Rate 2",
"amount": {
"currency": "USD",
"value": 5
}
}
]
Actual results:
Total tax amount returned for each rule:
"applied_taxes": [
{
"label": "US-CA-*-Rate 1",
"amount": {
"currency": "USD",
"value": 15
}
},
{
"label": "US-CA-*-Rate 2",
"amount": {
"currency": "USD",
"value": 15
}
}
]
Apply the patch
To apply individual patches, use the following links depending on your deployment method:
- Adobe Commerce or Magento Open Source on-premises: Quality Patches Tool > Usage in the Quality Patches Tool guide.
- Adobe Commerce on cloud infrastructure: Upgrades and Patches > Apply Patches in the Commerce on Cloud Infrastructure guide.
Related reading
To learn more about Quality Patches Tool, refer to:
- Quality Patches Tool released: a new tool to self-serve quality patches in the support knowledge base.
- Check if patch is available for your Adobe Commerce issue using Quality Patches Tool in the Quality Patches Tool guide.
For info about other patches available in QPT, refer to Quality Patches Tool: Search for patches in the Quality Patches Tool guide.