How to Add an Order number on shipment label in ELEX WooCommerce DHL Shipping plugin? (Code Snippet)

You are here:

The following code facilitates you to add an order number on shipment label.
Add the following code to your functions.php, or anywhere relevant.

function wf_dhl_add_customer_reference($shipment_details, $order_id) {
//Add customer reference to the shipment request
$shipment_details['customerReference'] = 'Order Number : '.$order_id;
return $shipment_details;
add_filter('woocommerce_dhl_paket_request', 'wf_dhl_add_customer_reference', 10, 2);

In the above code, $order_id with ‘Order Number :’ is stored in $shipment_details and function returns $shipment_details for printing it on label.





    Leave a Reply

    WordPress Image Lightbox Plugin