VirtueMart Forum

VirtueMart 2 + 3 + 4 => Templating & Layouts => Topic started by: clickonlogic on December 17, 2015, 21:44:06 PM

Title: select joomla template for product-view page ?
Post by: clickonlogic on December 17, 2015, 21:44:06 PM
Hi,
In the VM 3 configuration I see that I can choose default joomla template for Category : "Category Template"
Is there any way to do that for the Product View page ?
I mean I need "Joomla template A" for category view and "Joomla template B" for product view.

Thank you
Title: Re: select joomla template for product-view page ?
Post by: GJC Web Design on December 17, 2015, 23:20:34 PM
if you choose template A for cat does that cascade down to the details?

Title: Re: select joomla template for product-view page ?
Post by: clickonlogic on December 18, 2015, 07:28:23 AM
Thank you for your answer.

If i choose Template A in cat then I will have the same template in the product details.
The problem is that I need a different template in product details.
And I am talking about Joomla system template not a VM template.

Thank you
Title: Re: select joomla template for product-view page ?
Post by: GJC Web Design on December 18, 2015, 12:00:28 PM
If the config can't do what you want I  guess you need to do something in components\com_virtuemart\views\productdetails\view.html.php

around

shopFunctionsF::setVmTemplate($this, $category->category_template, $product->product_template, $category->category_product_layout, $product->layout);

isn't swapping joomla templates a bit radical?

Can't u just achieve what u want with over rides , css etc ?

Title: Re: select joomla template for product-view page ?
Post by: jenkinhill on December 18, 2015, 12:10:26 PM
The only manageable way to switch Joomla templates rather that a hack is to assign menu items to each template. A Joomla menu link to each category of product would do it - but who would want to bother with that.......
Title: Re: select joomla template for product-view page ?
Post by: GJC Web Design on December 18, 2015, 12:25:28 PM
but he wants worse than this.. catA->templateA
products of catA->templateB

would mean a menu to every product..  ;)
Title: Re: select joomla template for product-view page ?
Post by: clickonlogic on December 18, 2015, 12:31:18 PM
Maybe I cannot explain correctly what I need.

If I assign  a template to category,
when I click a product it will be loaded in the parent category's template bur I need a different joomla template.
The only solution is to assign a menu item for every product, which is impossible.

Now in the configuration there is already a template chooser for the category and loads the template in /components/com_virtuemart/views/category/view.html.php in the following lines :
if(empty($category->category_template)){
$category->category_template = VmConfig::get('categorytemplate');
}


So I need the same functionality for the product view I guess.

The reason I need that is that I work with gantry framework.
So in gantry I have the possibility to load JS, css and have different template structure, layout, modules, positions etc in my template override.
So in product page ONLY I need to load some JS and CSS, I also need to have different layout in page and finally I need some extra modules to be displayed.
And to achieve all the above I need to be able to set a Joomla template to the product views.
Title: Re: select joomla template for product-view page ?
Post by: jenkinhill on December 18, 2015, 12:32:40 PM
That changes the category view template, not the Joomla template.
Title: Re: select joomla template for product-view page ?
Post by: clickonlogic on December 18, 2015, 12:40:00 PM
Then I haven't found where this is being set :
http://prntscr.com/9fmr9d
which is in Virtuemart Configuration -> Shopfront Settings
Title: Re: select joomla template for product-view page ?
Post by: GJC Web Design on December 18, 2015, 13:18:25 PM
it must be related to the core joomla menu setting of which template...  not VM