варианты
<?php
$catArr = array(1, 2, 5);
$catId = JFactory::getApplication()->input->getInt('virtuemart_category_id',0);
if (!in_array($catId, $catArr)):?>
<jdoc:include type="modules" name="right" style="xhtml" />
<?php endif; ?>
не выводить модуль в категории, включая и все дочерние (не проверено)
$db=JFactory::getDbo();
$query=$db->getQuery(true);
$query->select('category_child_id')->from('#__virtuemart_category_categories')->where('category_parent_id=0');
$db->setQuery($query);
$catArr=$db->loadResultArray();
$catId = JFactory::getApplication()->input->getInt('virtuemart_category_id',0);
if (in_array($catId, $catArr)):?>
<jdoc:include type="modules" name="right" style="xhtml" />
<?php endif; ?>