Jump to content

Sort productlist in cart/BO


Recommended Posts

Hi!

 

I have over the 1000 products in my shop, and i've multiple suppliers.

My products are sort by supplier in the shop en in my warehouse.

But when i put the products in the shopping cart, or when i get an new order, the products are sort by ID.

 

But that is annoying when i make the order ready.

I must scroll through the whole order in the BO because i get the products by supplier..

Can anyone help me to sort the productlist in the cart by manufactur?
Or maybe, if that is not possible by category?

The best is by supplier.

Edited by Lucif (see edit history)
Link to comment
Share on other sites

Prestashop version? You have to change the orderby clause in the Cart class, getProducts method

 

Here is on 1.5.4 for example 

 

// Build ORDER BY
$sql->orderBy('p.id_product, cp.id_product_attribute, cp.date_add ASC');
 
DO you want to order by manufacturer name or id? If you need the name you have to join the supplier_lang table too
  • Like 1
Link to comment
Share on other sites

Thank you for your repley!

 

The sort in the cart is now fine:

        $sql->orderBy('p.id_supplier, cp.id_product_attribute, cp.date_add ASC');

 

Thankyou!

 

But when people place the order, is the sequence in the BO->orderdetail also alright now?

Thankyou!

Edited by Lucif (see edit history)
Link to comment
Share on other sites

Its better! Thankyou!

 

Is the sequence i see in the card in the FO also the sequence when the order is placed? So what i see in the BO?

 

Haha, just got an order, put the custumer choose 3 products, all from another supplier.. so i can't check it! :)

Edited by Lucif (see edit history)
Link to comment
Share on other sites

I have one question..

This is how the products are in the card:

 

Supplier ID

Product ID

 

Works just fine!
But i want now edit the supplier ID.
So the leading supplier in our warehouse with number 1, then supplier 2 enz.

Can I edit the supplier ID in the database without any problems?

Link to comment
Share on other sites

  • 2 years 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

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...