Set Magento website template, skin and layout programmatically

Standard
$groups['theme']['fields']['template']['value'] = 'template_name';
$groups['theme']['fields']['skin']['value'] = 'skin_name';
$groups['theme']['fields']['layout']['value'] = 'layout_name';
$groups['theme']['fields']['default']['value'] = 'template_name';
Mage::getModel('adminhtml/config_data')  
      ->setSection('design')  
      ->setWebsite('your_website')  
      ->setGroups($groups)  
      ->save(); 

Alternate method:

$installer->setConfigData('design/theme/template', 'facebook', 'stores', $store->getId());
$installer->setConfigData('design/theme/skin', 'facebook', 'stores', $store->getId());
$installer->setConfigData('design/theme/layout', 'facebook', 'stores', $store->getId());
$installer->setConfigData('design/theme/default', 'facebook', 'stores', $store->getId());
Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: