News:

Support the VirtueMart project and become a member

Main Menu

how many templates for order mails?

Started by adriespo, October 01, 2014, 16:32:51 PM

Previous topic - Next topic

adriespo

I customized the mail sent by VM when a user do an order.

The main file is, you know, mail_html.php and it calls others php file.

BUT this file is not called when the VM administrator CONFIRM a PENDING order. The mail sent is get from another template. But what template? I cant get it.

I thought was invoice.php but it is not. My adjustments do not appear...

Any idea?

EDIT: Sorry for posting in the wrong forum

adriespo

Oh! I noticed that it seems my override works just for the pending order... Why?! =:-O

adriespo


adriespo

#3
The problem is:

$view->addTemplatePath( JPATH_ROOT.DS . 'templates' . DS . $template . DS . 'html' . DS . 'com_virtuemart' . DS . $viewName);

in  \components\com_virtuemart\helpers\shopfunctionsf.php

add this path:

\templates\bluestork\html\com_virtuemart\invoice

BUT bluestork is the template of the back end. So if VM really wanted the path of that one it should be \administrator\templates\bluestork\html\com_virtuemart\invoice

I am missing something?

adriespo

Weel, checked what is the problem now I am doubtful.

Should I modify the core (sigh) adding the folder "administrator" to the path in renderMail() of \components\com_virtuemart\helpers\shopfunctionsf.php

$view->addTemplatePath(JPATH_ROOT . DS . 'templates' . DS . $template . DS . 'html' . DS . 'com_virtuemart' . DS . $viewName);

to be

$view->addTemplatePath(JPATH_ROOT . DS . 'administrator/templates' . DS . $template . DS . 'html' . DS . 'com_virtuemart' . DS . $viewName);



Dont know...


adriespo

Eventually I managed modifying renderMail()...

if($template){
$view->addTemplatePath(JPATH_ROOT . DS . 'templates' . DS . $template . DS . 'html' . DS . 'com_virtuemart' . DS . $viewName);
}


become

$app =& JFactory::getApplication();

if($template){
if($app->isSite() == 1){
$view->addTemplatePath(JPATH_ROOT . DS . 'templates' . DS . $template . DS . 'html' . DS . 'com_virtuemart' . DS . $viewName);
vmdebug("template path", JPATH_ROOT . DS . 'templates' . DS . $template . DS . 'html' . DS . 'com_virtuemart' . DS . $viewName);
}elseif($app->isAdmin() == 1){
$view->addTemplatePath(JPATH_ROOT . DS . 'administrator/templates' . DS . $template . DS . 'html' . DS . 'com_virtuemart' . DS . $viewName);
vmdebug("template path", JPATH_ROOT . DS . 'administrator/templates' . DS . $template . DS . 'html' . DS . 'com_virtuemart' . DS . $viewName);
}
}

      
Now I add an override in my BE template and done.

Any better idea appreciated...