ProductLoadAllPaged stored procedure returns too many filterable specification options

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.
2 года назад
I found this in an older version of nop, but it looks like the stored procedure hasn't changed regarding specification attribute option filtering.  

When filtering products with ProductService.SearchProducts, the output list of "FilterableSpecificationAttributeOptionIds" contains all options when filtering by specification option, even when selection would yield 0 results.

Repro: Use product service SearchProducts and include as an argument "filteredSpecs" that should eliminate certain options as selectable.  

Expected result: A limited list of FilterableSpecificationAttributeOptionIds based on your specification filter.

Actual result: FilterableSpecificationAttributeOptionIds never changes regardless of which  filteredSpecs are included in the product lookup.

I see correct FilterableSpecificationAttributeOptionIds when I change any other arguments for SearchProducts.

The fix:
In the standard "ProductLoadAllPaged" stored procedure, it "loads" the filterable specifications prior to filtering by them, thus the result we're seeing.  I just flipped those two blocks (filter by spec and then load available filterable specs) and now we see correct output results for FilterableSpecificationAttributeOptionIds !
2 года назад
Hi Adam,

We've changed this behavior in version 4.40 when implementing AJAX filters. But the "filteredSpecOptions" parameter works fine in the "ProductService.SearchProductsAsync()" method. Could you please clarify a list of steps to reproduce the issue?

You've also mentioned the "FilterableSpecificationAttributeOptionIds" parameter.  But there's no such parameter in the latest version anymore. Now they are loaded using "SpecificationAttributeService.GetFiltrableSpecificationAttributeOptionsByCategoryIdAsync()" method
This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.