Skip to content

Instantly share code, notes, and snippets.

@toh82
Created July 30, 2015 08:55
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save toh82/1c24d82316ed74966bbc to your computer and use it in GitHub Desktop.
Save toh82/1c24d82316ed74966bbc to your computer and use it in GitHub Desktop.
Updating Magento CMS Pages
/** @var Mage_Cms_Model_Page $oMagePageModel */
$oMagePageModel = Mage::getModel('cms/page');
foreach ($aHomePageTeaserContent as $iStoreId => $sHomePageTeaserContent) {
$iPageId = $oMagePageModel->checkIdentifier('home', $iStoreId);
$oPage = $oMagePageModel->load($iPageId);
$sPagePrevContent = $oPage->getContent();
$oPage->setData('stores', array($iStoreId));
$oPage->setContent($sPagePrevContent . $sHomePageTeaserContent)->save();
$oPage->clearInstance();
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment