Magento 排序顺序项目
我已经尝试了很多方法来实现这个目标,但是没有一个有效。 请给我一个提示如何去做这个 我需要对订单打印上显示的产品使用sku排序Magento 排序顺序项目,magento,magento-1.5,Magento,Magento 1.5,我已经尝试了很多方法来实现这个目标,但是没有一个有效。 请给我一个提示如何去做这个 我需要对订单打印上显示的产品使用sku排序 $order = Mage::getModel('sales/order')->load($order) 这是$order集合,下面有几行: foreach ($order->getAllItems() as $item) { ... } 显然,在显示之前,我需要在getAllItems上应用排序 如果不是问,我希望我说得够清楚。你可能已经解决了,但我会
$order = Mage::getModel('sales/order')->load($order)
这是$order集合,下面有几行:
foreach ($order->getAllItems() as $item) { ... }
显然,在显示之前,我需要在getAllItems上应用排序
如果不是问,我希望我说得够清楚。你可能已经解决了,但我会为有同样问题的人回答这个问题:
$oItems = $oOrder->getItemsCollection()->addAttributeToSort('price_incl_tax', 'DESC');
$aItems = array();
foreach ($oItems as $oItem) {
if (!$oItem->isDeleted()) {
$aItems[] = $oItem;
}
}
希望这对任何人都有帮助