Created
February 16, 2017 14:22
-
-
Save DevertNet/95d55bd6d44fcbdc025ce4bf142f82da to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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