Skip to content

Instantly share code, notes, and snippets.

@jreinke
Last active November 16, 2017 00:28
Show Gist options
  • Save jreinke/537f01774f90ce4e1eef to your computer and use it in GitHub Desktop.
Save jreinke/537f01774f90ce4e1eef to your computer and use it in GitHub Desktop.
Magento: Disable flat catalog product on the fly
<?php
/** @var Mage_Catalog_Helper_Product_Flat $helper */
$process = Mage::helper('catalog/product_flat')->getProcess();
$status = $process->getStatus();
$process->setStatus(Mage_Index_Model_Process::STATUS_RUNNING);
/** @var $collection Mage_Catalog_Model_Resource_Product_Collection */
$collection = Mage::getResourceModel('catalog/product_collection'); // Use EAV tables
// ... custom stuff
$process->setStatus($status);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment