Closed
Description
Steps to reproduce:
- 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
- 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) - Add the custom attribute to attribute set
- Create a product and assign it to a category
- 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
}
]
}
>