Author Topic: order by - reverse order  (Read 530 times)

jankoo

  • Jr. Member
  • **
  • Posts: 66
order by - reverse order
« on: November 19, 2017, 22:46:16 pm »
hi,
i have vm3 eshop.

in category layout there is option to sort products by.. for example by the "price".. (and i can choose in the backend if its ascending/descending)..

but how to let customers in fronted to reverse the order by ascending/descending ??
we use custom template override. but i dont see this also in vm core template layout code.

if its core function please let me know where i can find it. if its possible with the code please let me know the code.
thanks

jenkinhill

  • UK Web Developer & Consultant
  • Global Moderator
  • Super Hero
  • *
  • Posts: 27670
  • Always on vacation
    • Jenkin Hill Internet
Re: order by - reverse order
« Reply #1 on: November 20, 2017, 11:47:24 am »
The order change option is present in the default VM templates. See here in VM3.2.4



The code is in root/components/com_virtuemart/views/category/tmpl/default.php which I guess you are overriding.
Kelvyn

Jenkin Hill Internet,
Lowestoft, Suffolk, UK

Unsolicited PMs/emails will be ignored.

Please mention your VirtueMart, Joomla and PHP versions when asking a question in this forum

Currently using VM 3.6.11 10292 on Joomla 3.9.16 PHP 7.0.33

jankoo

  • Jr. Member
  • **
  • Posts: 66
Re: order by - reverse order
« Reply #2 on: November 23, 2017, 11:42:39 am »
hi.. thx for the answer..

ok. i found that code.. but only what i see in that file is 
Code: [Select]
<?php echo $this->orderByList['orderby']; ?>
and its working as you need to click on the same title of the orderby again.. its not very UX friendly.. i want to have icon next to the dropdown list. icon asc or dsc.. so where is the orderby layout code really happening? so i can try to play with it..


Ghost

  • Jr. Member
  • **
  • Posts: 419
Re: order by - reverse order
« Reply #3 on: November 23, 2017, 14:00:07 pm »
See getOrderByList function in product model (/administrator/components/com_virtuemart/models/product.php).