Does anybody know, how may I use a “order by if” statement, in my products list view to sort them by a custom way?
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
You can use all sorts of SQL statements in the order clause – here is an example with
RAND(). AnIF()could be used in the same way.If you’re working with
getLoadedProductCollection()in product lists then you should also consider this method for manipulating it. It’s not perfect (read the comments too for a discussion) but I find it good enough in most cases.