New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Search Results Cannot Be Sorted #1432
Comments
Fixing this issue brings to light once again #431 - neither 'Retail Price' nor 'Sale Price' from the admin settings page display the same sort order as the 'Price' selection in the dropdown, as they sort specifically by that single price column rather than the highest or lowest of the two. A result of this is that it is impossible for the admin to set the default search order to be by price, and choosing any sorting option in the admin menu that does not exist in the dropdown results in the dropdown displaying an erroneous selection. E.g. if the store setting is to sort by 'Sale Price DESC', the dropdown shows 'Name (Z-A)' as the sort order when the page first loads. It seems to me that it would be best if the same options that appear in the admin setting also appear in the dropdown, but I would suggest that a separate 'search order' setting be created for this as many if not most of the options for displaying a category would be either irrelevant (e.g. category id) or not suitable (e.g. cost price) for a customer to sort by. |
Thanks for this. |
Line numbers are for CC611 RTM:
Line 1616 creates the
$order_string
variable from earlier code.Line 1669 builds the
$query
for a fulltext search SQL statement. This$query
includes$order_string
.Line 1672 builds
$q2
for a count. This$q2
also includes$order_string
but it isn't necessary. (The Database class can be enhanced to useSQL_CALC_FOUND_ROWS
in the query() method.)Line 1714 builds
$query
for a LIKE or RLIKE SQL statement. This$query
does not include$order_string
.Suggest:
Line 1734 is the section of code that searches for Sale Items. The queries here uses it's own
$order_string
but due to two other factors, this parameter gets lost. May have been fixed in another issue.The text was updated successfully, but these errors were encountered: