News:

Support the VirtueMart project and become a member

Main Menu

URL of product with multiple categories

Started by ExSpirit, May 04, 2015, 08:17:52 AM

Previous topic - Next topic

Studio 42

If you need to add modules, then you have to assign categories as menu links.
To know if you are in a product or category, you can check for the view in your template:

<?php
// check if we are in productdetails
$input JFactory::getApplication()->input;
$view $input->get('view''''cmd');
if (
$view == 'productdetails') { ?>

<jdoc:include type="modules" name="position-2" style="none" />
<?php ?>

<?php
// check if we are in category
$input JFactory::getApplication()->input;
$view $input->get('view''''cmd');
$extension $input->get('option''''cmd');
if (
$view == 'category' && $extension == 'com_virtuemart') { ?>

<jdoc:include type="modules" name="position-2" style="none" />
<?php ?>


This code is for modules in template position-2 and to add in the templates/YOURTEMPLATE/index.php file

ExSpirit

Great, I will try to use this. Thank you.  :D