Hi everyone,
I use this code in a Joomla system plugin, in order to change the default Joomla template on the fly:
$app = JFactory::getApplication();
$app->setTemplate('mytemplate');
I works on all joomla and 3rd party extensions, but not on virtuemart pages.
Any idea why?
Thanks a lot
I can see in the vm configuration that there is a setting defining the Joomla template vm should use.
So, vm probably ignores the code above and sticks to the template set in the vm config.
I'm building a mobile template for my shop. Using the code above, I've managed to change the Joomla template to use if the device trying to connect to the site is a mobile.
So the question is: how do I ask virtuemart to use a specific template for a client, using php?
The answer is:
setTemplate() will work only if the vm config says "use default Joomla template" for the template parameter.
if this parameter is set to something else, virtuemart will ignore the setTemplate() function.
no, vm does not ignore it. and you are going to write programs?
Vm just calls the setTemplate function LATER ! that is all. Btw the function setTemplate does not correctly work for styles.