VirtueMart Forum

VirtueMart 2 + 3 + 4 => Templating & Layouts => Topic started by: adriespo on October 01, 2014, 16:32:51 PM

Title: how many templates for order mails?
Post by: adriespo on October 01, 2014, 16:32:51 PM
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
Title: Re: how many templates for order mails?
Post by: adriespo on October 01, 2014, 16:39:20 PM
Oh! I noticed that it seems my override works just for the pending order... Why?! =:-O
Title: Re: how many templates for order mails?
Post by: adriespo on October 01, 2014, 17:00:41 PM
It seems I have this problem http://forum.virtuemart.net/index.php?topic=98841.msg328726#msg328726 but I am using VirtueMart 2.6.10... Really strange...
Title: Re: how many templates for order mails?
Post by: adriespo on October 01, 2014, 17:26:18 PM
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?
Title: Re: how many templates for order mails?
Post by: adriespo on October 01, 2014, 18:19:40 PM
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...

Title: Re: how many templates for order mails?
Post by: adriespo on October 01, 2014, 18:42:15 PM
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...