Author Topic: query -> ascending to descending ordering direction in product overviews  (Read 3939 times)

slammy

  • Jr. Member
  • **
  • Posts: 169
  • vm supporter member
  • VirtueMart Version: vm 3.0.x and jml 3.4.5
Hi,

after migration from vm 1.1.x to vm2.0.3_g and Joomla 1.5.9 to 2.5.1, I am currently try to solve the following issue:

Products which I added last to my database should show up first in the category-product-overviews, I do not mean the Frontend-modules 'latest', 'featured' or 'top-ten' ... .
I found a fix in this forum to use product-ordering by case:created_on in /administrator/components/cpm_virtuemart/models/product.php .
Code: [Select]
                     case 'created_on';
                                $orderBy = ' ORDER BY p.`created_on` ';
                                //$this->filter_order_Dir = ' DESC';
                                break;

The filter_order 'created_on' works fine, but i want to switch the direction from asc to desc, because my oldest products showing up first.
I first thought to solve this with adding $this->filter_order_Dir = 'DESC' in case: created_on for getting the products sorted this direction - it works - but then the user-switching link doesn´t function any longer.
There are still some further ASC and DESC entries in product.php, but I can´t figure it out which ones I have to change in combination.

Would appreciate any help,  slam

sveibern

  • Beginner
  • *
  • Posts: 26
I have the same problem, the oldest products shows on top, but I want the newest first. Strange thing thats not the default.

slammy

  • Jr. Member
  • **
  • Posts: 169
  • vm supporter member
  • VirtueMart Version: vm 3.0.x and jml 3.4.5
I found the following information about an open feature for development here http://dev.virtuemart.net/projects/virtuemart/issues?set_filter=1&tracker_id=2
Does that mean the asc and desc issue (system wide filter ordering) will be solved within the next update(s)? Is this right? Maybe one of the developers can answer? Would appreciate any help or information, thx and best regards and nice eastern to u, slam

mjandia

  • Beginner
  • *
  • Posts: 13
I have the same problem. the order begins always by the old product