When you run into the issue that in Magento:
- Your product filters are not working when using addAttributeToFilter() .
- Your product attributes aren’t showing up when using addAttributeToSelect(‘*’) .
- All of this is only happening when you are using a flat catalog.
… chances are that you can fix this by just setting Used in product listing to Yes when editing your attribute. Did that help? Nice!
Why is that?
The usage of ‘flat products listings’ is nothing more than Magento wrapping all the products’ attributes in a single table, instead of using the EAV-model to get all different attributes. You can see this in the database with the catalog_product_flat_(store id) -tables.
Sometimes, when you have custom attributes, you need to change your code so that Magento can correctly process them when creating the flat table. Otherwise, results might get a bit … quirky.
So I hope this little heads-up saved you some time pulling your hair.
Visitors give this article an average rating of 3.1 out of 5.
How would you rate this article?
★ ★ ★ ★ ★