Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
Hi,
I like to sort the order view on the weight of a line item.
Now when I change the weight of a line item at in the order edit screen, the weight of the line item is properly saved but it doesn't affect the sorting of the line items at the order view screen.
When I edit the view of the order view screen, I cannot add the weight field as a sorting field.
Is it possible to sort a view on the actual weight of a line item?
Thanks!
Comment | File | Size | Author |
---|---|---|---|
order_view.png | 25.31 KB | maxplus | |
order_edit.png | 29.6 KB | maxplus |
Comments
Comment #1
maxplus CreditAttribution: maxplus commentedComment #2
maxplus CreditAttribution: maxplus commentedI have managed to sort using this technique: https://www.drupal.org/node/2332391 but inside the Commerce line items view, I cannot manage to solve the duplicate results issue after adding the relationship to commerce order (to get the delta field to sort on)
Comment #3
vincentdemers CreditAttribution: vincentdemers commentedThe easiest way that I have found to accomplish this is by implementing hook_views_query_alter in a custom module.