ACSD-68356: GraphQL cart query returns incorrect discount amount for virtual quotes
The ACSD-68356 patch fixes the issue where GraphQL cart query returns incorrect discount amount for virtual quotes. This patch is available when the Quality Patches Tool (QPT) 1.1.73 is installed. The patch ID is ACSD-68356. Please note that this issue is scheduled to be fixed in Adobe Commerce 2.4.9.
Affected products and versions
The patch is created for Adobe Commerce version:
- Adobe Commerce (all deployment methods) 2.4.8-p2
Compatible with Adobe Commerce versions:
- Adobe Commerce (all deployment methods) 2.4.8 - 2.4.8-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
GraphQL cart queries return incorrect discount amounts for virtual quotes, applying discounts to ineligible virtual products.
Steps to reproduce:
-
Create two virtual products:
virtual1SKUvirtual2SKU
-
Create a cart price rule:
- Set to apply automatically, without a coupon.
- Actions:
- Percent of product price discount - 20%.
- Applies only to cart items where SKU is
virtual2.
-
Add products to a fresh empty quote through storefront:
- Add
virtual1SKU first. - Add
virtual2SKU second.
- Add
-
Get cart details using the following GraphQL query:
code language-none { cart(cart_id: "cart_id") { email itemsV2 { total_count items { uid prices { total_item_discount { value } price { value } discounts { label amount { value } } } product { name sku } quantity }, page_info { page_size current_page total_pages } } applied_coupons { code } prices { discounts { amount { value } applied_to label } grand_total { value } } } } -
Check cart > items > prices > discounts.
Expected results:
virtual1SKU has no discount listed in GraphQLvirtual2SKU has discount listed in GraphQL
Actual results:
virtual1andvirtual2incorrectly show the same discount amount in the GraphQL response.
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: A self-service tool for quality patches in the Tools guide.