ACSD-49574: Can’t update gift card product in shopping cart via GraphQL

The ACSD-49574 patch fixes the issue where a gift card product cannot be updated in the shopping cart via GraphQL. This patch is available when the Quality Patches Tool (QPT) 1.1.28 is installed. The patch ID is ACSD-49574. 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-p1

Compatible with Adobe Commerce versions:

  • Adobe Commerce (all deployment methods) 2.4.4 - 2.4.6
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

A gift card product cannot be updated in the shopping cart via GraphQL.

Steps to reproduce:

  1. Create a gift card product.

  2. Add the gift card product to the cart via GraphQL.

  3. Try to update gift card product fields in the cart via GraphQL using updateCartItems mutation.

    Example of GraphQL usage:

    code language-graphql
    mutation ($cartId: String!, $cartItems: [CartItemUpdateInput!]!){
        updateCartItems(
            input: {
                cart_id: $cartId,
                cart_items: $cartItems
            }
        )   {
            cart {
                id
                items {
                    uid
                    quantity
                    product {
                        sku
                    }
                    ... on GiftCardCartItem {
                        sender_name
                        sender_email
                        recipient_name
                        recipient_email
                        message
                        amount {
                            value
                            currency
                        }
                    }
                }
            }
        }
    }
    
    variables
    {
        "cartId": "sDrOu06VYlGejhDivQMcnmcNPSxTMUDd",
        "cartItems": [
            {
                "cart_item_id": 113,
                "quantity": 1,
                "customizable_options": [{
                        "uid": "Z2lmdGNhcmQvZ2lmdGNhcmRfc2VuZGVyX25hbWU=",
                        "value_string": "sender_name"
                    },
                    {
                        "uid": "Z2lmdGNhcmQvZ2lmdGNhcmRfc2VuZGVyX2VtYWls",
                        "value_string": "sender_email"
                    },
                    {
                        "uid": "Z2lmdGNhcmQvZ2lmdGNhcmRfcmVjaXBpZW50X25hbWU=",
                        "value_string": "recipient name"
                    },
                    {
                        "uid": "Z2lmdGNhcmQvZ2lmdGNhcmRfcmVjaXBpZW50X2VtYWls",
                        "value_string": "recipient_email"
                    },
                    {
                        "uid": "Z2lmdGNhcmQvZ2lmdGNhcmRfbWVzc2FnZQ==",
                        "value_string": "message"
                    },
                    {
                        "uid": "Z2lmdGNhcmQvY3VzdG9tX2dpZnRjYXJkX2Ftb3VudA==",
                        "value_string": "10"
                    }
                ]
            }]
    }
    

Expected results:

All the gift card product fields (sender_name, sender_email, recipient_name, recipient_email, message, amount) are updated using updateCartItems mutation.

Actual results:

Only the amount is updated.

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:

For info about other patches available in QPT, refer to Quality Patches Tool: Search for patches in the Quality Patches Tool guide.

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