• Resolved janni1887

    (@janni1887)


    Hello,

    I create the DHL labels in the order overview via “Bulk”. Is it possible that if the order weighs less than (for example) 200gr. that a Warenpost label is automatically created? Currently, parcel is always selected. All my products have a weight entered.

    Is there a hook for this? I couldn’t find one in the settings.

    It would be inconvenient to do this manually for every order.

    Greetings Jan

Viewing 7 replies - 1 through 7 (of 7 total)
  • Plugin Author Saleem Summour

    (@sal4sup)

    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!

    Thread Starter janni1887

    (@janni1887)

    Thanks a lot. I′ll try it ??

    Plugin Author Abdalsalaam Halawa

    (@abdalsalaam)

    You are welcome! @janni1887

    Plugin Author Saleem Summour

    (@sal4sup)

    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,

    Thread Starter janni1887

    (@janni1887)

    Hello,

    I was only able to install it today because we have only been activated since February.
    It works! THANK YOU!

    dervonz

    (@dervonz)

    Hi there,

    where in the backend is it possible to adjust the IDs V62WP?for Warenpost,?V01PAK?for Parcel ?

    Best regards

    Christian

    dervonz

    (@dervonz)

    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 ) {

Viewing 7 replies - 1 through 7 (of 7 total)
  • You must be logged in to reply to this topic.