Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
add_filter('pr_shipping_dhl_label_args', 'modify_post_number', 10, 2);
function modify_post_number($args, $order_id) {
if( $order_id == 12345 ){
$args['shipping_address']['dhl_postnum'] = 54321;
}
return $args;
}
@Nex4rius
Copy link

Nex4rius commented Aug 3, 2021

Your solution has the hardcoded order_id and postnumber which obviously only works on this one order. I made it generalized for all orders. It's just strange that the DHL plugin adds the postnumber field but somehow still complains that the postnumber is missing.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment