<?php | |
$dir = dirname(__FILE__); | |
chdir($dir); | |
require $dir.'/app/Mage.php'; | |
Mage::app()->setCurrentStore(Mage_Core_Model_App::ADMIN_STORE_ID); | |
$configSections = Mage::getSingleton('adminhtml/config')->getSections(); | |
// look for node entries in all system.xml that use source_model=adminhtml/system_config_source_email_template | |
// they are will be templates, what we try find | |
$sysCfgNodes = $configSections->xpath(Mage_Adminhtml_Model_Email_Template::XML_PATH_TEMPLATE_EMAIL); | |
if (!is_array($sysCfgNodes)) { | |
return array(); | |
} | |
foreach ($sysCfgNodes as $fieldNode) { | |
$groupNode = $fieldNode->getParent()->getParent(); | |
$sectionNode = $groupNode->getParent()->getParent(); | |
// create email template path in system.xml | |
$sectionName = $sectionNode->getName(); | |
$groupName = $groupNode->getName(); | |
$fieldName = $fieldNode->getName(); | |
$paths[] = implode('/', array($sectionName, $groupName, $fieldName)); | |
} | |
$change = array(); | |
foreach ($paths as $path) | |
{ | |
$val = Mage::getStoreConfig($path, 2); | |
Zend_Debug::dump($path); | |
Zend_Debug::dump($val); | |
if($val){ | |
$tmpl = Mage::getModel('core/email_template')->load($val); | |
Zend_Debug::dump($tmpl->getTemplateCode()); | |
//Zend_Debug::dump($tmpl->getTemplateText()); | |
} | |
echo ('<hr />'); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment