BUG in the sorting of products. A large load on the server.

Started by serapol, April 05, 2012, 17:43:15 PM

Previous topic - Next topic

serapol

Error in vmModel Product with list of products for the module in the "Latest". There is a big load on MSQL server and incorrectly showing the last products

you must add the file product.php  $orderBy = 'ORDER BY p.`virtuemart_product_id'; in case 'latest':

if($group){

$groupBy = 'group by p.`virtuemart_product_id`';
switch ($group) {
case 'featured':
$where[] = 'p.`product_special`="1" ';
$orderBy = 'ORDER BY RAND()';
break;
case 'latest':
$date = JFactory::getDate( time()-(60*60*24*7) );
$dateSql = $date->toMySQL();
$where[] = 'p.`modified_on` > "'.$dateSql.'" ';
$this->filter_order_Dir = 'DESC';
$orderBy = ' ORDER BY p.`virtuemart_product_id`'; // <<<--------------------  ADD THIS CODE
break;
case 'random':
$orderBy = ' ORDER BY RAND() ';
break;
case 'topten';
$orderBy = ' ORDER BY product_sales ';
$this->filter_order_Dir = 'DESC';
}
$joinPrice = true ;
$this->searchplugin = false ;
}
}

Milbo

Should I fix your bug, please support the VirtueMart project and become a member
______________________________________
Extensions approved by the core team: http://extensions.virtuemart.net/


Milbo

Should I fix your bug, please support the VirtueMart project and become a member
______________________________________
Extensions approved by the core team: http://extensions.virtuemart.net/