Tribal6 Posted August 26, 2022 Share Posted August 26, 2022 (edited) Hi all The ordering of products in a category is set to 'ordering'. That works as it should. But if the category has subcategories, the products should be grouped by its categories: cat1 cat2 product c2-o1 (orderingNr 1) product c2-o2 (orderingNr 2) product c2-o3 (orderingNr 3) cat3 product c3-o1 (orderingNr 1) product c3-o2 (orderingNr 2) product c3-o3 (orderingNr 3) Products listing when viewing category 1: [c2-o1] [c3-o1] [c2-o2] [c3-o2] [c2-o3] [c3-o3] But client want [c2-o1] [c2-o2] [c2-o3] [c3-o1] [c2-o2] [c3-o3] In other words now the products are not grouped by category, just all (subcategories-)products sorted by ordering. (SQL: ...ORDER BY product.ordering ASC Instead of (SQL: ...ORDER BY cat.ordering ASC, product.ordering ASC) How can I achive this? I've tried to change the search query, but without success so far. Is there a option for that in the configuration that I've missed, or is there a module that can handle that? I am grateful for any hint. Thanks Roger Edited August 26, 2022 by Tribal6 (see edit history) Link to comment Share on other sites More sharing options...
musicmaster Posted August 28, 2022 Share Posted August 28, 2022 That is a puzzling and unclear question. You don't say what query you use. So I don't know which tables you have linked to and what "ordering" is defined as. In principle the second type of query you show should work. You could also use the product's id_category_default field or the category's nleft field. Link to comment Share on other sites More sharing options...
Tribal6 Posted September 1, 2022 Author Share Posted September 1, 2022 I don't understand what is puzzling or unclear about this question. What is missing? I have tried to find out which query is responsible for this result, respectively where an adjustment could be made, but I have not found the right place yet. And with the postet SQL ordering clause, I'm just trying to explain what I'm trying to accomplish. It is not from a existing query. Link to comment Share on other sites More sharing options...
musicmaster Posted September 1, 2022 Share Posted September 1, 2022 Did you try enabling profiling to see whether you can find the query there. It shows at the end of the line the location of a query. https://dh42.com/blog/prestashop-debug-profiling/ Link to comment Share on other sites More sharing options...
Tribal6 Posted September 2, 2022 Author Share Posted September 2, 2022 Thank you for this useful tip - I have not yet known this option. With profiling on I should be able to identify the responsible query. Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now