Ejemplo n.º 1
0
 /**
  * Retrieve translated template file
  * Try current design package first
  *
  * @param string $file
  * @param string $type
  * @param string $localeCode
  * @return string
  */
 public function getTemplateFile($file, $type, $localeCode = null)
 {
     if (is_null($localeCode) || preg_match('/[^a-zA-Z_]/', $localeCode)) {
         $localeCode = $this->getLocale();
     }
     $filePath = $this->getLocaleOverrideFile($localeCode, 'template' . DS . $type . DS . $file);
     if (empty($filePath) || !file_exists($filePath)) {
         return parent::getTemplateFile($file, $type, $localeCode);
     }
     $ioAdapter = new Varien_Io_File();
     $ioAdapter->open(array('path' => Mage::getBaseDir('locale')));
     return (string) $ioAdapter->read($filePath);
 }