Skip to content

[GraphQl] Custom attribute aggregations should return store specific option values #28572

Closed
@magento-engcom-team

Description

@magento-engcom-team

Steps to reproduce:

  1. Create multiple stores with multiple store views ( for example: english and arabic storeviews) and choose either the English or the luma default store as the store view
  2. create a custom attribute that is visible in search and layered navigation. ( For test purpose, a drop down custom attribute " brand" with atleast couple options for different storeviews.
    For example: defaultBrand, englishBrand, arabicBrand etc)
  3. Add the custom attribute to attribute set
  4. Create a product and assign it to a category
  5. Use the below query to query for the product and aggregrations.
{
    products(filter: {
      		category_id: {eq: {$categoryId}},
    },
      pageSize:1,
      sort:{name:DESC})
  {
    items{
      id
      sku
      name
    }
    aggregations{
      label
      attribute_code
      count
      options{
        label
        value
        count
      }
    }
  }
}
{code}
Make sure no store code is passed in through the header.
Notice that the option value returned is the "arabicBrand"
Now remove this option from the attrribute form and re-run the query, you will see that the next option value : "englishBrand" now shows up and so on

Expected:
1. Since no store code is specified, the attribute option value for the default store should be returned( if store_code is passed in, appropriate option value should be returned)

Actual:
The last eav*attribute_option_value is always returned, since store*code is not honored.
{code:php}
"aggregations" :<
{...}
{...}
    {
          "label": "brand",
          "attribute_code": "brand",
          "count": 1,
          "options": [
            {
              "label": "arabicBrand2",
              "value": "44",
              "count": 1
            }
          ]
        }
>

Metadata

Metadata

Assignees

Labels

Fixed in 2.4.xThe issue has been fixed in 2.4-develop branchIssue: Format is not validGate 1 Failed. Automatic verification of issue format is failedPAPPartners acceleration programPriority: P1Once P0 defects have been fixed, a defect having this priority is the next candidate for fixing.Project: GraphQLReproduced on 2.3.xThe issue has been reproduced on latest 2.3 release

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions