1

We've recently discovered (after an upgrade) that Magento EE 1.14.1 no longer keeps the catalog_product_flat tables updated unless you have Use Flat Catalog Product in System->Config->Catalog->Frontend enabled.

Even manually re-indexing through the shell does not populate catalog_product_flat_1 like it used to in previous versions. I believe this change was made sometime on or after 1.13.

All previous versions would keep catalog_product_flat_1 up to date regardless of this Use Flat Catalog Product setting.

We do not wish to enable Use Flat Catalog Product on the front-end, but somehow we need to keep catalog_product_flat_1 updated as we have various extensions and feeds that use this table.

Does anyone have any ideas?

1
  • the best option will be to contact your account manager and take his/her advice
    – Dexter
    Nov 25 '15 at 7:56
2

You can use the below code to update the flat data table.

   <?php

    define('MAGENTO', realpath(dirname(__FILE__)));
    require_once MAGENTO . '/app/Mage.php';
    Mage::app()->setCurrentStore(Mage::getModel('core/store')->load(Mage_Core_Model_App::ADMIN_STORE_ID));
    $collection = Mage::getModel('catalog/product')->getCollection();
    foreach($collection as $product){
        try{
            Mage::getModel('catalog/product_flat_indexer')->updateProduct($product->getId(), null);
            echo "Successfully reindex product with id ". $product->getId();
        }
        catch(exception $ex){
            print_r($ex);
        }
    }

you can set the code in the php file and run that file as a cron job.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.