Jump to content

Cart products order


Recommended Posts

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 by YuccaOne (see edit history)
Link to comment
Share on other sites

 

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

  • 2 months later...

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

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

  • 3 weeks later...

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...