Skip to content

Instantly share code, notes, and snippets.

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/6751305c06a852b972247af0e595d145 to your computer and use it in GitHub Desktop.
Save shadimanna/6751305c06a852b972247af0e595d145 to your computer and use it in GitHub Desktop.
Add weight to new orders
add_filter('pr_shipping_dhl_order_weight', 'custom_add_weight', 10, 2);
function custom_add_weight($total_weight, $order_id) {
$total_weight += 1; // Add any weight needed, units of measure will be whatever is set in WooCommerce
return $total_weight;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment