Skip to content
View in the app

A better way to browse. Learn more.

thirty bees forum

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

How to sort products by reference in AdminOrders ?

Featured Replies

Good day guys, need help : how can i sort products in BO AdminOrders by reference or reference AND warehouseproductlocation (example :demo7, demo6, demo_5 and etc) Any comments are welcome ! Thanks 0_1546169091702_Screenshot (4).png

  • 2 weeks later...

I just remembered that I saw once a tutorial about adding sorting options. Maybe you can start here: http://nemops.com/sort-by-sales-prestashop/#.XDXOSlxKhPY

@piet thats probably not what he is lookin for. I believe he is talking about the BO. There you would need to change a controller, I guess. Maybe a tpl file could also work.

  • Author

Yes, i need hint, how to sort products list in BO...

@Domas search in file AdminOrdersController.php for the function "getProducts($order)"

And try to add this before the return:

array_multisort( array_column($products, "reference"), SORT_ASC, $products );

If it works, I would suggest to make an override afterwards...

  • Author

@wakabayashi Thanks, working. How can add another sort arraymultisort( arraycolumn($products, "reference"), SORTASC, $products, array_column($products, "location"), SORT_ASC, $products ); doesn't working. I want to sort products by reference(it's already working) and location (from table productwarehouse_location)

Not sure. In general this sounds a bit strange to me. You have multiple times the same reference? I have just googled. Maybe this works:

// get a list of sort columns and their data to pass to array_multisort $sort = array(); foreach($products as $k=>$v) { $sort['reference'][$k] = $v['reference']; $sort['location'][$k] = $v['location']; } // sort by event_type desc and then title asc array_multisort($sort['reference'], SORT_DESC, $sort['location'], SORT_ASC,$products);

  • Author

@wakabayashi not working this...

  • Author

@wakabayashi thanks anyway

Create an account or sign in to comment

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.