Add custom attribute to Magento’s getLoadedProductCollection() on product grid and list view 2


You have a custom attribute that needs to be accessed from the grid or list view and for the life of you it just won’t load with the collection.  You’ve tried something like

 
$_productCollection = $this->getLoadedProductCollection()->addAttributeToSelect('my_attribute_key')->load();

and it just doesn’t work.  If you’re like me on this issue, you’re just working too hard for the solution.  The way to do it is simply go into the admin and edit the attribute and change the “Used in product listing” setting to “yes”.  That’s it.  Hopefully I’ll save somebody a couple hours 🙂


Leave a comment

Your email address will not be published. Required fields are marked *

2 thoughts on “Add custom attribute to Magento’s getLoadedProductCollection() on product grid and list view