Hi,
at this moment if you change the list order on search result page to lowest price first the result is displaying the "check with seller" ads first. I want these to be displayed last so the results show first 'Free' and then 0,01cents and up and last the 'check with seller' items.
Now, the order itself is done on price so by adding the condition >= 0 the results are shown starting with Free ads but then there are no 'check with seller' ads in the result. So to overcome this I think I should add a virtual field that considers 'check with seller' as highest price possible in Osclass meaning they are used in result but always will end up last when ordering lowest price first.
HOWEVER, in case of highest price order first I want this to be the other way around ie. true high prices first then the free items and then the 'check with seller' ads. This is how it actually works so no change is needed here.
But afaik it does mean that the query change has to be dynamically set in case of lowest price order first.
I found some SQL that shows me how to create the virtual field:
http://stackoverflow.com/questions/455261/how-to-create-virtual-column-using-mysql-select Now I am wondering what would be the best approach to achieve this looking at the "order by" process and available search manipulation options.
Should I use javascript and an 'onchange' method of the 'order by' dropdown to manipulate the Query?
Should this be done using 'addcondition' or is there another / better approach?
Is there a way I can make only one query change related to the order by with the three order by options or do I have to make another 'revert' query in case of the two other order by options?
Regards,
Eric