photo credit: elviskennedy via photopin cc

Why are my Magento attributes missing when using a flat catalog?

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.0 out of 5.

How would you rate this article?

4 thoughts on “Why are my Magento attributes missing when using a flat catalog?”

  1. VinhT says:

    This really save my day. Thanks for sharing!

  2. James Sims says:

    Worked for me too, thanks!

  3. bm says:

    Saved my day! Thanks!

Leave a Reply