Function sortSearchListQuery (Product Model): invariable behavior

Started by nrobert, September 23, 2013, 08:53:45 AM

Previous topic - Next topic

nrobert

I have started topic here with  false alarm. Problem is invariable behavior of function sortSearchListQuery (Product Model) when $virtuemart_category_id != FALSE and $group != FALSE. Seems that bug was found here:

case 'recent';
$rSession = JFactory::getSession();
$rIds = $rSession->get('vmlastvisitedproductids', array(), 'vm'); // get recent viewed from browser session
return $rIds;

In this case, function simply finishes, ignoring $virtuemart_category_id existence.
My suggestion:

case 'recent';
$rSession = JFactory::getSession();
$rIds = $rSession->get('vmlastvisitedproductids', array(), 'vm'); // get recent viewed from browser session
// return $rIds;
$where[] = 'p.`virtuemart_product_id` IN ('.implode(',',$rIds).')';