Author Topic: URL of product with multiple categories  (Read 3386 times)

Studio 42

  • Contributing Developer
  • Sr. Member
  • *
  • Posts: 4022
  • Joomla & Virtuemart developper
    • Studio 42 - Virtuemart & Joomla extentions
  • VirtueMart Version: 2.6 & 3
Re: URL of product with multiple categories
« Reply #15 on: May 05, 2015, 18:59:40 pm »
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:
Code: [Select]
<?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

  • Jr. Member
  • **
  • Posts: 72
Re: URL of product with multiple categories
« Reply #16 on: May 05, 2015, 22:23:52 pm »
Great, I will try to use this. Thank you.  :D