ACSD-66963: estimateTotals mutation returns null for discounts on virtual products
The ACSD-66963 patch fixes the issue where estimateTotals returns null for discounts when a discount code is applied to a cart with only virtual products. This patch is available when the Quality Patches Tool (QPT) 1.1.68 is installed. The patch ID is ACSD-66963. Please note that this issue was fixed in Adobe Commerce 2.4.8.
Affected products and versions
The patch is created for Adobe Commerce version:
- Adobe Commerce (all deployment methods) 2.4.7-p4
Compatible with Adobe Commerce versions:
- Adobe Commerce (all deployment methods) 2.4.7 - 2.4.7-p6
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 estimateTotals mutation returns null for discounts when a discount code is applied to a cart containing only virtual products.
Steps to reproduce:
-
Create a cart containing only virtual products.
-
Apply a discount code:
code language-none mutation { estimateTotals( input: { cart_id: "cart_id", address: { country_code: US, postcode: "78732", region: { region_code: "TX" } }, shipping_method: { carrier_code: "{$shipping}", method_code: "{$shipping}" } } ) { cart { prices { discounts { amount { value currency } label coupon { code } applied_to type } } } } }
Expected results:
Discount information is included for carts containing only virtual products.
{
"data": {
"estimateTotals": {
"cart": {
"prices": {
"discounts": [
{
"amount": {
"value": 100.5,
"currency": "USD"
},
"label": "A second discount code for testing",
"coupon": {
"code": "z3r0c00l"
},
"applied_to": "ITEM",
"type": null
}
]
}
}
}
},
"extensions": {}
}
Actual results:
Discount information returns as null for carts with only virtual products.
{
"data": {
"estimateTotals": {
"cart": {
"prices": {
"discounts": null
}
}
}
},
"extensions": {}
}
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.