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.