MP-zoho Posted November 10, 2015 Share Posted November 10, 2015 (edited) Hi all, I have 3 categories in my shop. The category A has few items (about 10 items) and the category B and C has many (more 50). So, when customers add items to their cart, I would like to sort the list of products in their cart by category : how can I do that ? EDIT : I use prestashop 1.6.0.9. Thanks Edited November 10, 2015 by YuccaOne (see edit history) Link to comment Share on other sites More sharing options...
NemoPS Posted November 11, 2015 Share Posted November 11, 2015 You can try editing Cart::getProducts $sql->orderBy('cp.`date_add`, cp.`id_product`, cp.`id_product_attribute` ASC'); You might try to order by cl.name Link to comment Share on other sites More sharing options...
MP-zoho Posted November 12, 2015 Author Share Posted November 12, 2015 You can try editing Cart::getProducts $sql->orderBy('cp.`date_add`, cp.`id_product`, cp.`id_product_attribute` ASC'); You might try to order by cl.name Hi Nemo1, That exactly what I need (in my case : $sql->orderBy('cl.`id_category`','cp.`date_add`, p.`id_product`, cp.`id_product_attribute` ASC'); ). Thanks Link to comment Share on other sites More sharing options...
Welele Posted February 8, 2016 Share Posted February 8, 2016 Hello everyone. It is possible sort the products order by EAN-13 or UPC field?? I dont use this fields and I would like sort the orders invoice because my store and stock is too big. Reference numbers and another fields are disordered. I need a new field to sort. Thanks and regards Link to comment Share on other sites More sharing options...
Welele Posted February 9, 2016 Share Posted February 9, 2016 Please. I need help. Is this possible? Best regards Link to comment Share on other sites More sharing options...
NemoPS Posted February 10, 2016 Share Posted February 10, 2016 Yes, you can just use the same condition mentioned above on p.ean13 for example Link to comment Share on other sites More sharing options...
Welele Posted February 12, 2016 Share Posted February 12, 2016 Thanks for you comment! I will tray and respond in this post. Thnks angain! Link to comment Share on other sites More sharing options...
Welele Posted February 16, 2016 Share Posted February 16, 2016 I tried modify the file "classes/cart.php", in line 515: // Build ORDER BY $sql->orderBy('cp.`date_add`, p.`ean13`, cp.`id_product_attribute` ASC'); As well, I tried this: //Build ORDER BY $sql->orderBy('p.`ean13` ASC'); But doesn´t work. The item position is always by user put into the cart. What is exactly the condition that I need?? Thanks and best regards Link to comment Share on other sites More sharing options...
Welele Posted February 16, 2016 Share Posted February 16, 2016 PLease. I need help Please Thanks Link to comment Share on other sites More sharing options...
NemoPS Posted February 17, 2016 Share Posted February 17, 2016 It might be shuffled somewhere else in the code, like with javascript, hard to tell. Are you using a custom template? Link to comment Share on other sites More sharing options...
Welele Posted February 17, 2016 Share Posted February 17, 2016 Yes. This one: http://eggthemes.com/prestashop-homefurniture.html But we never had problems applying any customization in the code. We have another shop with native theme. I will try in this and respond you later. Thanks and regards Link to comment Share on other sites More sharing options...
Welele Posted February 19, 2016 Share Posted February 19, 2016 I tried in my other shop (with default template) and doesnt work netiher. I tried this: //Build ORDER BY $sql->orderBy('p.`ean13` ASC'); Any help? Link to comment Share on other sites More sharing options...
Welele Posted March 8, 2016 Share Posted March 8, 2016 I found solution!! ean13 is a varchar, dont sort by number if you dont put data like this: 01 02 03 04 05 06 07 08 09 10 . . . . 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