X

Добавить CMS страницу в Magento из install скрипта

Для того, чтобы создать cms страницу с помощью install скрипта, воспользуйтесь таким кодом..

<?php
/* @var $installer Mage_Core_Model_Resource_Setup */$installer = $this;
 
$installer->startSetup();
 
/* @var $connection Varien_Db_Adapter_Pdo_Mysql */$connection = $installer->getConnection();
 
$installer->startSetup();
 
$connection->insert($installer->getTable('cms/page'), array(
    'title'             => 'Terms and Conditions',
    'root_template'     => 'one_column',
    'identifier'        => 'terms-and-conditions',
    'content'           => "<div></div>",
    'creation_time'     => now(),
    'update_time'       => now(),
));
 
$connection->insert($installer->getTable('cms/page_store'), array(
    'page_id'   => $connection->lastInsertId(),
    'store_id'  => 0
));
 
$installer->endSetup();

 

Категории: Magento