Page 1 of 1

How to order products in Category listing to be both Ascending (A to Z) and Price (low to high) at the same time

Posted: Wed Apr 10, 2019 9:42 pm
by TomSut
Currently have Ascending (A to Z) as the default. Is it possible to have both Ascending (A to Z) and Price (low to high) at the same time?
It could just be an extra line in product.php.

Thanks
Tom

Opencart 3.0.2.0
Journal 3 theme

Re: How to order products in Category listing to be both Ascending (A to Z) and Price (low to high) at the same time

Posted: Wed Apr 10, 2019 10:22 pm
by D3MO
You need to change SQL to :

ORDER BY name, price


that is to pass 2 sort fields instead of one.

Re: How to order products in Category listing to be both Ascending (A to Z) and Price (low to high) at the same time

Posted: Thu Apr 11, 2019 2:58 am
by thekrotek
Same way you can order by multiple table fields. Just separate them with comma.

Re: How to order products in Category listing to be both Ascending (A to Z) and Price (low to high) at the same time

Posted: Thu Apr 11, 2019 9:05 am
by letxobnav
you can have that but not dynamic without changing some code.

Re: How to order products in Category listing to be both Ascending (A to Z) and Price (low to high) at the same time

Posted: Fri Apr 12, 2019 4:02 pm
by D3MO
can be dinamic:) with ocmod:)) installed with changes :)