Last active
June 4, 2021 08:05
-
-
Save webtoffee-git/0937e324685f30180c30ba3ee107ac02 to your computer and use it in GitHub Desktop.
Print orders in chronological order in Picklist-PDF Invoice/Packing Slip for WooCommerce
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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