VirtueMart Forum

VirtueMart 2 + 3 + 4 => General Questions => Topic started by: VMRESLO on December 19, 2015, 11:42:30 AM

Title: Sort by modified date from descending to ascending
Post by: VMRESLO on December 19, 2015, 11:42:30 AM
Hello everyone!

Please help me with this issue. I would like to change the default value of sort by modified date from descending to ascending, since it makes no sense for users to see the oldest products first. All other sorting mechanisms should stay from ascending to descending (like alphabetical order).

I have found this in an older forum but I can not find the file to change this:

QuoteTo change the order of Latest Products to descending order, open \administrator\components\com_virtuemart\html\shop_browse_queries.php and change line 23:

$DescOrderBy = $vmInputFilter->safeSQL( $vm_mainframe->getUserStateFromRequest( "browse{$keyword}{$category_id}{$manufacturer_id}DescOrderBy", 'DescOrderBy', "ASC" ) );

to

$DescOrderBy = $vmInputFilter->safeSQL( $vm_mainframe->getUserStateFromRequest( "browse{$keyword}{$category_id}{$manufacturer_id}DescOrderBy", 'DescOrderBy', "DESC" ) );

In summary, just change the end of that line from ASC to DESC to achieve descending sorting on latest products.

Please help me find this file to change this in the newest Virtuemart and Joomla.

Thank you and best regards to all!