Created
October 5, 2018 10:45
-
-
Save shadimanna/45cf9640f51c90e1d03241cd951bd52d to your computer and use it in GitHub Desktop.
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
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; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.