Skip to content

Instantly share code, notes, and snippets.

@shadimanna
Created November 15, 2019 08:56
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save shadimanna/c740e22fd27d9c4ffa164225f7017b30 to your computer and use it in GitHub Desktop.
Save shadimanna/c740e22fd27d9c4ffa164225f7017b30 to your computer and use it in GitHub Desktop.
add_filter('pr_shipping_dhl_label_args', 'modify_item_price', 10, 2);
function modify_item_price($args, $order_id) {
if( isset( $args['items'] ) ) {
foreach ($args['items'] as $item_key => $item_value) {
if( isset( $item_value['item_value'] ) ) {
$args['items'][ $item_key ]['item_value'] = round( floatval( $item_value['item_value'] ), 2);
}
}
}
return $args;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment