I am trying to sort an order collection (MagentoSalesModelResourceModelOrderCollectionFactory
) based on custom product attribute data for the product items in the order. It is ok just to sort based on the first product item row.
How can I achieve this?
I know I can add a custom column on the sales_order
table on order creation. But I am trying to avoid that.