0

I am newbie in Magento 2, I configured the Magento 2 layered Navigation and did everything to set layered navigation for categories and size and color.

Layered Navigation is working perfect for color but not for categories and size. When i select any size in Magento 2 layered navigation it shows no product but at side it shows number of products in that category.

I think this is Magento 2 bug, because i tried every settings and looked at every overriding file to check if there's any file causing error.

Here is what it seems like enter image description here

enter image description here

For size it is showing only first and last size but not all sizes in siz attributes.

0

I also think that it's a bug. However, you can fix it temporarily. Replace these codes in vendor/magento/module-catalog/Model/ResourceModel/Product/Collection.php:

)->join(                                                                                                                                                                     
    ['cpa' => $attribute->getBackend()->getTable()],                                                                                                                         
    'cpe.' . $aiField . ' = cpa.' . $aiField,                                                                                                                                
    ['store_id', 'value'] 

with these lines:

)->join(                                                                                                                                                                     
    ['cpa' => $attribute->getBackend()->getTable()],                                                                                                                         
    'cpe.' . $aiField . ' = cpa.' . 'row_id' //$aiField,                                                                                                                                
    ['store_id', 'value']

Your Answer

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Not the answer you're looking for? Browse other questions tagged or ask your own question.