I know this might be a very old topic for Joomla developers, so to call Joomla module in virtuemart category page or any other component template file, but I am just posting this topic as I recently get to know about it and I recently implemented in one of my Joomla project.

Here in this post I am going to share the way to call Joomla module in category page so the one particular module get visible only when browsing categories and subcategories pages. So this will be something like including {loadposition module} inside Virtuemart template file

So let open the file to add the code – /components/com_virtuemart/views/category/tmpl/default.php and place the below code in to it.

<?php
      /*   Calling Joomla Module in Virtuemart category page */
           $modules =&  JModuleHelper::getModules('your-module-position');
           foreach ($modules as $module)
           {
              echo JModuleHelper::renderModule($module);
           }
  ?>

Just don’t forget to update the “your-module-position” with your actual module position that you have mentioned in templateDetails.xml

Related posts:

avatar

Author: 


  • Dave

    version above needs correction missing ; see below correct version.

  • Dave