• Hello,

    I am using this plugin and my project requires some label customizations that I currently cannot achieve.

    For example:

    1. Kleinpaket labels: I would like to display the product names on the label, so that the contents can be read from outside the package.
    2. International Warenpost (CN22/CN23): I need to be able to uncheck “Sale of goods” and select options like “Other” or “Sample”, or override the declared values.

    I could not find any settings in the plugin to make these changes. Could you advise if these customizations are possible, or if there is a way to achieve them?

    Thank you for your help.

    • This topic was modified 7 months, 2 weeks ago by majd948.
Viewing 1 replies (of 1 total)
  • Plugin Author Saleem Summour

    (@sal4sup)

    Hi @majd948,

    The label layout is generated by DHL, not by the plugin. You can only populate the fields DHL exposes; you can’t redesign the label or inject free text (like a full product list) into “Kleinpaket” labels.

    1) “Kleinpaket: print product names on the label”

    Not possible on the shipping label template itself.

    2) CN22/CN23: change “Sale of goods” and override values

    This part is customizable via filters:

    Change the export type (e.g., “Other”, “Sample”)

    // Set the CN22/CN23 export type (REST).
    add_filter( 'pr_shipping_dhl_paket_label_shipment_export_type', function( $type ) {
    // Valid examples include: 'COMMERCIAL_GOODS', 'OTHER', 'COMMERCIAL_SAMPLE', 'GIFT', 'DOCUMENTS'
    return 'OTHER'; // or 'COMMERCIAL_SAMPLE'
    }, 10, 1 );

    Override customs line items (description/values/HS codes)

    // Override CN22/CN23 item lines before the REST request is sent.
    add_filter( 'pr_shipping_dhl_label_args', function( $args, $order_id ) {

    if ( isset( $args['items'] ) && is_array( $args['items'] ) ) {
    foreach ( $args['items'] as $i => $item ) {
    // Example: rename item
    $args['items'][$i]['itemDescription'] = 'Sample product';

    // Example: force declared value (amount) & currency
    if ( isset( $args['items'][$i]['itemValue'] ) ) {
    $args['items'][$i]['itemValue']['amount'] = 1.00; // numeric
    $args['items'][$i]['itemValue']['currency'] = 'EUR'; // use your currency
    }

    // (Optional) set HS code / origin if needed
    // $args['items'][$i]['hsCode'] = '12345678';
    // $args['items'][$i]['countryOfOrigin'] = 'DEU';
    }
    }

    return $args;
    }, 10, 2 );

    Notes

    • These filters affect what DHL prints on CN22/CN23 (within their template).
    • Some fields have strict length/format limits enforced by DHL.
    • For REST, the reference number (refNo) must be 8–35 characters. If you change its prefix/format, keep that in mind.
Viewing 1 replies (of 1 total)

The topic ‘Label Customization’ is closed to new replies.