Skip to content

Magento 2.3.4 graphql Notice: Undefined index: option_value in /var/www/html/mg234/vendor/magento/module-configurable-product-graph-ql/Model/Resolver/ConfigurableCartItemOptions.php on line 62 #28860

Closed
@prabhakaran777

Description

@prabhakaran777

Preconditions (*)

  1. Magento 2.3.4
  2. Config product with custom options

Steps to reproduce (*)

  1. Create config product with custom options
  2. Add product to cart (addConfigurableProductsToCart) using this mutation
mutation {
  addConfigurableProductsToCart(
    input: {
      cart_id: "IkzvsoUeXwvb6g2jrdqVNmuXPqmznAqI"
      cart_items: [
        {
          parent_sku: "config-sku"
          data: {
            quantity: 1
            sku: "config-sku-White"
          }
        customizable_options:[	
          {
            id:2
            value_string:"4"
          }
        ]        }      ]
    }
  ) {
    cart {
      items {
        id
        quantity
        product {
          name
          sku
        }
        ... on ConfigurableCartItem {
          configurable_options {
            option_label
            value_label
            value_id
          }
         customizable_options {
            label
            values {
              value
            }
          }        }      }
    }
  }
}

Expected result (*)

  1. Configurable product will add to cart

Actual result (*)

{
  "errors": [
    {
      "debugMessage": "Notice: Undefined index: option_value in /var/www/html/oxygen/vendor/magento/module-configurable-product-graph-ql/Model/Resolver/ConfigurableCartItemOptions.php on line 62",
      "message": "Internal server error",
      "extensions": {
        "category": "internal"
      },
      "locations": [
        {
          "line": 36,
          "column": 11
        }
      ],
      "path": [
        "addConfigurableProductsToCart",
        "cart",
        "items",
        0,
        "configurable_options"
      ]
    }
  ],
  "data": {
    "addConfigurableProductsToCart": {
      "cart": {
        "items": [
          null
        ]
      }
    }
  }
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    Area: APIsIssue: ConfirmedGate 3 Passed. Manual verification of the issue completed. Issue is confirmedPriority: P1Once P0 defects have been fixed, a defect having this priority is the next candidate for fixing.Progress: doneProject: GraphQLReported on 2.3.4Indicates original Magento version for the Issue report.Reproduced on 2.4.xThe issue has been reproduced on latest 2.4-develop branchSeverity: S1Affects critical data or functionality and forces users to employ a workaround.

    Type

    No type

    Projects

    Status

    Done

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions