Update Static block magento

function createBlock($blockData) { $block = Mage::getModel(‘cms/block’)->load($blockData[‘identifier’]); if ($block->isObjectNew()) { $block->setIdentifier($blockData[‘identifier’]); } $block->setTitle($blockData[‘title’]); $block->setStores(array($blockData[‘storeId’])); $block->setIsActive($blockData[‘active’]); $block->setContent($blockData[‘content’]); $block->save(); }

function createBlock($blockData) {

    $block = Mage::getModel('cms/block')->load($blockData['identifier']);
    if ($block->isObjectNew()) {
        $block->setIdentifier($blockData['identifier']);
    }
    $block->setTitle($blockData['title']);
    $block->setStores(array($blockData['storeId']));
    $block->setIsActive($blockData['active']);
    $block->setContent($blockData['content']);
    $block->save();
}

Share this Tutorial