Is there any way to ordering items by SKU on the invoice?
I created the invoice_items.php override but I don“t know how to ordering.
Thanks.
the items are in any multi dimensional array - research 'array ordering php'
e.g.
usort($myArray, function($a, $b) {
return $a['product_sku'] - $b['product_sku'];
});
Quote from: GJC Web Design on August 19, 2014, 01:11:23 AM
the items are in any multi dimensional array - research 'array ordering php'
e.g.
usort($myArray, function($a, $b) {
return $a['product_sku'] - $b['product_sku'];
});
Thanks!
The solution:
$list = $this->orderDetails['items'];
function order_by_sku($a, $b)
{
return ($a->order_item_sku > $b->order_item_sku);
}
usort($list, 'order_by_sku');