I still haven't been able to find a fix so I've added a bit of code in my template override to set the 'prev' and 'next' links according to "product ordering" which is what my customer wants. This goes above Product Navigation section and sets new values for $this->product->neighbours.
Yes, yes all very naughty because it breaks the MVC model, bolts in the language, has my quirky indenting, etc but it works.
// Ben's Product Navigation
function cbProductName ($id)
{
// get the name for a product.
// Alert: languare is bolted in!!
$cbDB = JFactory::getDBO() ;
$cbQuery = $cbDB->getQuery(true) ;
$cbQuery = "select product_name from #__virtuemart_products_en_gb where virtuemart_product_id = ".$id ;
$cbDB->setQuery((string)$cbQuery) ;
$cbName = $cbDB->loadResult() ;
return $cbName ;
}
// get the info
$cbProduct = $this->product->virtuemart_product_id ;
$cbCategory = $this->product->virtuemart_category_id ;
// query the database for the product ids in order (fallback order is product id)
$cbDB = JFactory::getDBO() ;
$cbQuery = $cbDB->getQuery(true) ;
$cbQuery = "select virtuemart_product_id from #__virtuemart_product_categories where virtuemart_category_id = ".$cbCategory." order by ordering,virtuemart_product_id" ;
$cbDB->setQuery((string)$cbQuery) ;
$cbList = $cbDB->loadResultArray() ;
// get prev & next from the list
$cbPosition = array_search ($cbProduct,$cbList) ;
if ($cbPosition === false)
{
$this->product->neighbours ['previous'][0] = '' ;
$this->product->neighbours ['next'][0] = '' ;
}
else
{
$cbPrev = ($cbPosition - 1 + count($cbList)) % count($cbList) ;
$cbNext = ($cbPosition + 1 + count($cbList)) % count($cbList) ;
// insert the results into $this
$this->product->neighbours ['previous'][0]['virtuemart_product_id'] = $cbList[$cbPrev] ;
$this->product->neighbours ['next'][0]['virtuemart_product_id'] = $cbList[$cbNext] ;
$this->product->neighbours ['previous'][0]['product_name'] = cbProductName($cbList[$cbPrev]) ;
$this->product->neighbours ['next'][0]['product_name'] = cbProductName($cbList[$cbNext]);
}
BTW, I'm on VM 2.0.22c and now see there is a 2.00.24. Will the ordering have been fixed in that release? Maybe somebody can answer. If it has you can ignore the above.
Also Joomla 2.5.14 and PHP 5.3.10