Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Magento: Rebuilding Flat Catalog Programmatically

Tags:

I am using a cron to import inventory changes nightly. When I try to change a product's information (price, etc) I get the following error:

Column not found: 1054 Unknown column 'e.display_price_group_0' in 'field list'

I can fix this by clicking "Rebuild Flat Catalog Product" in the Cache Management panel. I setup a cron to do this programmatically using the following code:

Mage :: getResourceModel( 'catalog/product_flat_indexer' ) -> rebuild();

I don't get any errors when I run the script, but the "Column not found" error persists.

Does anyone know how I can rebuild the flat catalog other than through the admin interface?