zloeloshadko Posted March 16, 2014 Share Posted March 16, 2014 Hi! I use prestashop 1.5.6.1 I have in my store about 15,000 goods and when a customer makes an order for maybe 400 items it is difficult for him to verify the order in the cart (i mean shopping-cart.tpl) because the products are sorted by id. How to sort products in cart by name? Is it possible maybe to use standart product-sort.tpl in the cart summary? Thank you for any answers! Link to comment Share on other sites More sharing options...
vekia Posted March 16, 2014 Share Posted March 16, 2014 change order by clause in $sql->orderBy('p.id_product, cp.id_product_attribute, cp.date_add ASC'); to $sql->orderBy('pl.name ASC, cp.id_product_attribute, cp.date_add ASC'); your list will be sortted by product name ASCENDING (pl.name ASC) it's a part of classes/Cart.php (getProducts()) funciton 2 Link to comment Share on other sites More sharing options...
zloeloshadko Posted March 17, 2014 Author Share Posted March 17, 2014 Thank you again and again! It works, but after that the customer asked me to make order by 'last added from top' so i make this: $sql->orderBy('cp.date_add DESC'); It works too, but is it okay to leave it like that? --------- Solved Link to comment Share on other sites More sharing options...
vekia Posted March 17, 2014 Share Posted March 17, 2014 yes everything is fine with your code you don't have to worry topic marked as solved. with regards, Milos 1 Link to comment Share on other sites More sharing options...
gabiatti Posted October 28, 2014 Share Posted October 28, 2014 (edited) Is that possible to use a solution like this to order the products in cart, order and invoice by REFERENCE number (SKU), instead of PRODUCT_ID or NAME (pl.name)? It works with: 466 $sql->orderBy('p.reference, cp.id_product_attribute, p.id_product, cp.date_add ASC'); PS vs. 1.5.5.0 Edited October 28, 2014 by gabiatti (see edit history) Link to comment Share on other sites More sharing options...
itzbilly Posted January 9, 2015 Share Posted January 9, 2015 Is that possible to use a solution like this to order the products in cart, order and invoice by REFERENCE number (SKU), instead of PRODUCT_ID or NAME (pl.name)? It works with: 466 $sql->orderBy('p.reference, cp.id_product_attribute, p.id_product, cp.date_add ASC'); PS vs. 1.5.5.0 use unique_id instead of pl.name Link to comment Share on other sites More sharing options...
EdEichman Posted October 30, 2015 Share Posted October 30, 2015 change order by clause in $sql->orderBy('p.id_product, cp.id_product_attribute, cp.date_add ASC'); to $sql->orderBy('pl.name ASC, cp.id_product_attribute, cp.date_add ASC'); your list will be sortted by product name ASCENDING (pl.name ASC) it's a part of classes/Cart.php (getProducts()) funciton That is by far the simplest solution, but of course changing the core code can give you problems when updating PrestaShop. Overriding, of course, can also give you problems, but the chances are not as great, my post on how to sort by original date add can be modified to do the same without changing the core code. 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...
lovemyseo Posted July 29, 2016 Share Posted July 29, 2016 change order by clause in $sql->orderBy('p.id_product, cp.id_product_attribute, cp.date_add ASC'); to $sql->orderBy('pl.name ASC, cp.id_product_attribute, cp.date_add ASC'); your list will be sortted by product name ASCENDING (pl.name ASC) it's a part of classes/Cart.php (getProducts()) funciton will this work with ps 1.6.1.6 as well? Link to comment Share on other sites More sharing options...
millien Posted January 12, 2017 Share Posted January 12, 2017 how about when adding products to the cart it ads the product to the bottom of the cart and the coustomer needs to scroll to se the last added product. can i add the latest on the på in the ajax cart animation. our cartblock is alwas open. ? 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