Angar Posted March 15 Share Posted March 15 Hello, In backoffice in product edition in the "combination" tab here: https://prnt.sc/tRzXV-kYL6Ad attributes are sorted by ID: https://prnt.sc/uQ526mPzymRk I want to sort these attributes by position, it is possible to change this? Link to comment Share on other sites More sharing options...
Daresh Posted March 15 Share Posted March 15 You are mixing two things here. Combination is not attribute, it does not have position in the database. Link to comment Share on other sites More sharing options...
Prestashop Addict Posted March 17 Share Posted March 17 Le 15/03/2024 à 3:37 PM, Angar a dit : I want to sort these attributes by position, it is possible to change this? You want to sort it in backoffice or front? Link to comment Share on other sites More sharing options...
Angar Posted March 18 Author Share Posted March 18 On 3/15/2024 at 7:08 PM, Daresh said: You are mixing two things here. Combination is not attribute, it does not have position in the database. You're right, I mean combinations. Is there any solution to change the order of combinations in the back office? I tried editing /classes/Product.php but it doesn't change anything. On 3/17/2024 at 1:14 PM, Prestashop Addict said: You want to sort it in backoffice or front? I want to change this in backoffice. One of my customers exports products to eBay and he said that he needs to have "color" on the first position, because without this he can't export products to eBay. Link to comment Share on other sites More sharing options...
ZHSoft Posted March 19 Share Posted March 19 After careful investigation, I found that the sorting order depends on: admin/index.php/sell/catalog/products/combinations/form/1-2-3-4-5-6-7-8 Where did 1-2-3-4-5-6-7-8 come from? I have been troubleshooting for a long time and still can't figure it out. PrestaShop is getting more and more complicated. Link to comment Share on other sites More sharing options...
ZHSoft Posted March 19 Share Posted March 19 Oh, after the final efforts, I found the sorting BUG and the solution: classes/Product.php Replace ORDER BY pa.`id_product_attribute`' with ORDER BY ag.`position`' in the getAttributeCombinationsById method. At present, we see that it has been displayed according to the attribute group sorting. If there are other places where the sorting is incorrect, please repeat the above method to replace the sorting rules. 1 Link to comment Share on other sites More sharing options...
Angar Posted March 23 Author Share Posted March 23 Thank you ZHSoft, your solution working correctly 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