tags:

views:

464

answers:

2

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?

A: 

See this script. I personally had some trouble with it, but others seem to be quite happy with it.
If you don't want the whole thing, you can easily pull out the part that rebuilds the flat catalog product and point a cron job at it.

Laizer
This is the script that I got the above code from. It doesn't seem to be working for me.
karnage
Laizer, was your trouble that you got the error "exception 'Zend_Db_Statement_Exception' with message 'SQLSTATE[42S22]: Column not found: 1054 Unknown column 'e.display_price_group_0' in 'field list'' in /var/www/releases/20101019/lib/Zend/Db/Statement/Pdo.php:238" when updating products after having rebuilt the flat catalog? If so, how did you fix it? Thanks!
fdierre
A: 

I also can't get it to work correctly.

When I rebuild the Rebuild Flat Catalog Product from the Admin it works fine and I don't get the SQL column error, but when I do it programmatically it doesn't work via:

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

Tegan Snyder
I'm glad to know I am not the only one, I thought I was losing my mind.
karnage