Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Custom attributes not filterable by option value instead of option label #3031

Closed
eVo93 opened this issue Aug 23, 2023 · 3 comments
Closed

Comments

@eVo93
Copy link

eVo93 commented Aug 23, 2023

Hello, I have the following problem:
all custom attributes are not filterable,
even if these are set accordingly in the backend
is filterable in search -> yes

but as soon as this attribute is added as a filter in graphql, the number of products found is always 0.

if i just filter by the category_id i get corresponding products delivered. I also checked that there are products with the custom attribute and also maintained the corresponding value

Preconditions

Docker Container
magento/magento-cloud-docker-elasticsearch:7.7-1.3.2

Magento Version :
Adobe Commerce ver. 2.4.5-p1

ElasticSuite Version :
ElasticSuite Open Source ver. 2.10.17.2

Environment :
developer

Third party modules :

Steps to reproduce

  1. graphql query with custom attributes
    query {
    products(

    sort: { name: ASC }

    filter: {

         rated_frequencies: {eq: "1061"}
    
    
    
         category_id: {eq: "100"}
    
    
     },
    
     
     pageSize: 20,
     currentPage: 1
    

    ) {...

Expected result

{
"data": {
"products": {
"page_info": {
"total_pages": 38,
"current_page": 1
},
"total_count": 747,
"items":[...]
}
}
}

Actual result

{
"data": {
"products": {
"page_info": {
"total_pages": 0,
"current_page": 1
},
"total_count": 0,
"items": []
}
}
}

if I filter with several "default" attributes it works without problems

@eVo93
Copy link
Author

eVo93 commented Aug 24, 2023

Update:

I found out the following about my problem, since the installation of the extension, custom attributes that are of the type FilterEqualTypeInput, for example, can no longer be filtered against the value but against the title/string behind it

Example:

Attributes test_dropdown -> type select
options:
abc -> value 800
def -> value 801

Before the extension, you could use graphql to filter against the value, e.g.:
test_dropdown: {eq: "800"} has returned corresponding results.
with the extension only works
test_dropdown: {eq: "abc"}

can you set that at any point that the attribute should be filtered according to the value?

@rbayet rbayet changed the title Custom attributes not filterable Custom attributes not filterable by option value instead of option label Sep 1, 2023
@romainruaud
Copy link
Collaborator

Hi @eVo93

that should not be an issue because you're supposed to build your filters according the graphql aggregations responses. So you have the labels and you can build the proper filter URL with them.

We do no plan to change this.

Regards

@vinothweb
Copy link

I think this feature is necessary. When we have multi-lingual website and we filter apply in one language(arabic) and change the store view to english the products won't be available. This also creates an issue with SEO as well, the URL with filter applied will lead to duplicate page in other language.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants