I have a similar problem but I am using mod_product_list rather than the categories module.
This is available from
i-onepage.com/freesoft/
It is a very,very useful module but if you have SEF enabled all URLs still have the standard VM junk.
Basically, Artio SEF is not generated for any URL that this module generates. I think this is because the developer has bypassed the standard VM method of generating the URL instead going for a hard-coded version of the same.
If anyone has any ideas as how to make it SEF friendly then please let me know. A donation will be forthcoming for the correct answer. I'be been in touch with Ken Wong, the developer but no response so far.
I have pasted the whole code here. The module is a small one.
<?php
/**
* Module Name : Products List Module
* Create By : Ken Wong (designer@i-onepage.com)
* Create Date : Dec 2007
* @version $Id: mod_login.php 7211 2007-04-29 02:26:51Z robs $
* @package Joomla
* @copyright Copyright (C) 2005 Open Source Matters. All rights reserved.
* @license
www.gnu.org/copyleft/gpl.html GNU/GPL, see LICENSE.php
* Joomla! is free software. This version may have been modified pursuant
* to the GNU General Public License, and as distributed it includes or
* is derivative of works licensed under the GNU General Public License or
* other free or open source software licenses.
* See COPYRIGHT.php for copyright notices and details.
*/
// no direct access
defined( '_VALID_MOS' ) or die( 'Restricted access' );
//Get configurable parameters
echo "<form name='product_list_form' id='product_list_form' method='post' action='index.php'>\n";
$categoryOrder = $params->get('category_order',0);
$categoryOrderDirection=$params->get('category_order_direction',0);
$productOrder=$params->get('product_order',0);
$productOrderDirection=$params->get('product_order_direction',0);
$showProduct=$params->get('show_product',0);
$fromDate=$params->get('from_date',null);
$toDate=$params->get('to_date',null);
$arrFromDate=explode('-',$fromDate);
$arrToDate=explode('-',$toDate);
if($showProduct==2)
{
$fromDateTimeStamp=mktime(0,0,0,$arrFromDate[0],$arrFromDate[1],$arrFromDate[2]);
$toDateTimeStamp=mktime(0,0,0,$arrToDate[0],$arrToDate[1],$arrToDate[2]);
}
//Get category list
$sql="Select
a.category_id as id,
a.category_name As name,
b.category_parent_id As parent
From #__vm_category As a
Inner Join #__vm_category_xref As b
On a.category_id=b.category_child_id
Where a.category_publish='Y'
";
if($categoryOrder==0)
{
$sql.=" Order by a.category_name ";
}
else
{
$sql.=" Order by a.list_order ";
}
if($categoryOrderDirection==0)
{
$sql.=" ASC ";
}
else
{
$sql.=" DESC ";
}
$where=array();
if($showProduct!=0)
{
$where[]="a.product_publish='Y'";
}
if($showProduct==2)
{
$where[]=" (a.cdate >=$fromDateTimeStamp And a.cdate <= $toDateTimeStamp )";
}
$database->setQuery($sql);
$rowProductCategories=$database->loadObjectList();
$sql="Select a.product_id+10000 as id,a.product_name As name,b.category_id as parent
From #__vm_product As a
Inner Join #__vm_product_category_xref As b
On a.product_id=b.product_id
";
if(count($where))
$sql.=" Where ".implode(" AND ",$where);
if($productOrder==0)
{
$sql.=" Order By product_name ";
}
elseif ($productOrder==1)
{
$sql.=" Order By product_sku ";
}
else
{
$sql.=" Order By cdate ";
}
if($productOrderDirection==0)
{
$sql.=" ASC ";
}
else
{
$sql.=" DESC ";
}
$database->setQuery($sql);
$rowproducts=$database->loadObjectList();
$rowproducts=array_merge($rowProductCategories,$rowproducts);
$cid=mosGetParam($_REQUEST,'cid',0);
$preload=array();
$preload[]=mosHTML::makeOption(0,"Select item");
echo mosHTML::treeSelectList(&$rowproducts,0,$preload,'cid','onchange="gotoVMPage();"','value','text',$cid);
echo "</form>";
/**
* DAEB - 10th October 2008 changed the URL code below. The item ID now points to the item 35 which is what the shop actually uses when Artio SEF tool is off.
* when the item id was set to 1 it caused the pathway to be missing the 'home' link. Set the URL to be exactly what is normally generated by VM
* and it now shows the pathway correctly
*/
?>
<script language="javascript">
function gotoVMPage()
{
var id=document.product_list_form.cid.value;
cid=id;
if(id>10000)
{
//productpage
id=id-10000;
url='index.php?page=shop.product_details&flypage=shop.flypage&product_id='+id+'&manufacturer_id=0&option=com_virtuemart&Itemid=53&cid='+cid;
}
else
{
url='index.php?page=shop.browse&category_id='+id+'&option=com_virtuemart&Itemid=1&cid='+cid;
}
location.href=url;
}
</script>