Magento Stack Exchange is a question and answer site for users of the Magento e-Commerce platform. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I used below function in admin controller to update multiple store status. Its working fine. why code ->setIsMassupdate(true) is used? What it does?

public function massStatusAction()
    //Get store ids from selected checkbox
    $storeIds = $this->getRequest()->getParam('storeIds');

    if (!is_array($storeIds)) {
        Mage::getSingleton('adminhtml/session')->addError($this->__('Please select store(s)'));
    } else {
        try {
            foreach ($storeIds as $storeId) {
                $this->__('Total of %d record(s) were successfully updated', count($storeIds))
        } catch (Exception $e) {
share|improve this question
up vote 4 down vote accepted

I guess in your own entity it doesn't make sense.
But for products is useful.
If you have some indexes set on 'Update on save' and you perform a mass update, there is no need to rebuild those indexes for each product that is updated in bulk. You can just rebuild the indexes when everything product is updated.

For example this piece of code from Mage_CatalogIndex_Model_Observer::processAfterSaveEvent uses that flag.

    if (!$eventProduct->getIsMassupdate()) {
    } else {
        $this->_productIdsMassupdate[] = $eventProduct->getId();

If the getIsMassupdate returns false, then it reindexes the product, If it's true then just marks it for reindex to process it when everything is done.

Same goes for Mage_CatalogRule_Model_Observer::applyAllRulesOnProduct()

    if ($product->getIsMassupdate()) {

It does not apply the catalog rules for each product when in mass update mode.

share|improve this answer
@ Marius thanks great answer – P B Jun 12 '14 at 11:51

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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