[PaaS only]{class="badge informative" title="Applies to Adobe Commerce on Cloud projects (Adobe-managed PaaS infrastructure) and on-premises projects only."}

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
NOTE
The patch might become applicable to other versions with new Quality Patches Tool releases. To check if the patch is compatible with your Adobe Commerce version, update the 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:

  1. Create two virtual products:

    1. virtual1 SKU
    2. virtual2 SKU
  2. Create a cart price rule:

    1. Set to apply automatically, without a coupon.
    2. Actions:
    3. Percent of product price discount - 20%.
    4. Applies only to cart items where SKU is virtual2.
  3. Add products to a fresh empty quote through storefront:

    1. Add virtual1 SKU first.
    2. Add virtual2 SKU second.
  4. 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
          }
        }
      }
    }
    
  5. Check cart > items > prices > discounts.

Expected results:

  • virtual1 SKU has no discount listed in GraphQL
  • virtual2 SKU has discount listed in GraphQL

Actual results:

  • virtual1 and virtual2 incorrectly 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:

To learn more about Quality Patches Tool, refer to:

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