I've been trying lots of methods to achieve but none worked. Please give me a 开发者_运维问答hint how to to this.
I need to use a sort by sku on products that appear on an order print.
$order = Mage::getModel('sales/order')->load($order)
this is $order collection and a few lines below I have:
foreach ($order->getAllItems() as $item) { ... }
I need the sort to be applied on getAllItems before showing, obviously.
I hope I was clear enough, if not ask.
you might have already solved, but I will answer this for people having the same problem:
$oItems = $oOrder->getItemsCollection()->addAttributeToSort('price_incl_tax', 'DESC');
  $aItems = array();
  foreach ($oItems as $oItem) {
      if (!$oItem->isDeleted()) {
          $aItems[] =  $oItem;
      }
  }
Hope this helps anyone.
 
         
                                         
                                         
                                         
                                        ![Interactive visualization of a graph in python [closed]](https://www.devze.com/res/2023/04-10/09/92d32fe8c0d22fb96bd6f6e8b7d1f457.gif) 
                                         
                                         
                                         
                                         加载中,请稍侯......
 加载中,请稍侯......
      
精彩评论