View Issue Details

IDProjectCategoryView StatusLast Update
0002088OXID eShop (all versions)2. ----- eShop backend (admin) -----public2010-09-29 17:09
Reporteraggrosoft Assigned To 
PriorityhighSeverityminorReproducibilityalways
Status resolvedResolutionno change required 
Product Version4.4.2 revision 29492 
Summary0002088: oxUtilsView::getTemplateDirs does not work correct in admin area
DescriptionWhile developing a special extension for backend orders a problem arises. When the E-Mail processor parses the mail template he will always use the template stored in the "basic" folder even if the shop runs a special sThisTemplate. I don't see any reason why the following if condition exists in oxUtilsView::getTemplateDirs()

if ( !$this->isAdmin() ) {
            $this->setTemplateDir( $myConfig->getOutDir( true ) . $myConfig->getConfigParam( 'sTheme' ) . "/tpl/" );
        }

The if condition could be removed as far as I see this to overcome this limitation. Or is there any reason why this doesn't search for templates in the backend?
TagsNo tags attached.
Theme
BrowserAll
PHP Versionany
Database Versionany

Activities

aggrosoft

2010-09-08 16:32

reporter   ~0003491

Workaround would be to do the following before sending the mails:

//Dodge 0002088
            $myConfig = oxConfig::getInstance();
            if($myConfig->getConfigParam( 'sTheme' ) != ''){
                $oUtilsView = oxUtilsView::getInstance();
                $oUtilsView->setTemplateDir( $myConfig->getOutDir( true ) . $myConfig->getConfigParam( 'sTheme' ) . "/tpl/" );
            }

dainius.bigelis

2010-09-09 17:26

reporter   ~0003492

@Developers: please check from the source code side if this is the case as described and fix if so.

rimvydas_paskevicius

2010-09-29 17:09

reporter   ~0003555

When sending emails from admin (e.g. order email to shop owner), oxemail class uses

$this->setBody( $oSmarty->fetch( $myConfig->getTemplatePath( $this->_sOrderOwnerTemplate, false ) ) );

for getting email body.

$myConfig->getTemplatePath() returns path which includes custom theme dir name (which you set in config.inc.php: $this->sTheme). So for getting emails from custom theme in admin, use $myConfig->getTemplatePath( template_name, false )