Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Print orders in chronological order in Picklist-PDF Invoice/Packing Slip for WooCommerce
<?php
add_filter('wf_pklist_alter_package_grouped_order_items','wt_pklist_sort_items_asc_in_picklist',10,5);
function wt_pklist_sort_items_asc_in_picklist($item_arr, $grouping_config, $order_package, $template_type, $order)
{
if($template_type=='picklist')
{
$id_arr=array();
foreach ($item_arr as $id => $item)
{
$id_arr[]=$id;
}
array_multisort($id_arr, SORT_DESC, $item_arr);
}
return $item_arr;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment