Hi @janni1887,
Thank you for reaching out!
Yes, you can use the pr_shipping_dhl_label_args filter to automatically select a Warenpost label based on the order weight. Below is an example you can use:
add_filter( 'pr_shipping_dhl_label_args', 'set_dhl_product_per_weight', 10, 2 );
function set_dhl_product_per_weight( $args, $order_id ) {
if ( $args['order_details']['weight'] <= 200 ) { // 200 = 200 weight units (g, kg, etc.) depending on WooCommerce settings.
$args['order_details']['dhl_product'] = 'V62WP'; // Warenpost International or adjust based on your product code.
} else {
$args['order_details']['dhl_product'] = 'V01PAK'; // Standard Parcel Product Code.
}
return $args;
}
Make sure to adjust the product codes (V62WP for Warenpost, V01PAK for Parcel) to match your DHL account configuration.
This snippet will automatically select the appropriate DHL product based on the order weight during bulk label creation.
Let me know if you encounter any issues or need further assistance!
Thanks a lot. I´ll try it 🙂
You are welcome! @janni1887
Hello @janni1887,
We wanted to check in and see if the solution worked for you. Your feedback is important to us, and if everything is running smoothly, we’d be grateful if you could take a moment to share your experience by leaving a review here.
Thank you for choosing our plugin, and feel free to reach out if you need further assistance!
Best regards,
Hello,
I was only able to install it today because we have only been activated since February.
It works! THANK YOU!
Hi there,
where in the backend is it possible to adjust the IDs V62WP for Warenpost, V01PAK for Parcel ?
Best regards
Christian
Hi again,
Is V62WP still working ?
And if ( $args[‘order_details’][‘weight’] <= 200 ) { // 200 = 200 weight units (g, kg, etc.) depending on WooCommerce settings.
What if we have kg active and we want it below 0.05 ? Is it working like this:
if ( $args[‘order_details’][‘weight’] <= 0.05 ) {