• Germanized
  • Hooks

DHL

woocommerce_gzd_dhl_label_api_shipper_reference Filter

This filter allows using a ShipperReference configured in the GKP instead of transmitting the shipper data from the DHL settings. Use this filter carefully and make sure that the reference exists.

  1. $shipper_reference string The shipper reference from the GKP.
  2. $label \Vendidero\Germanized\DHL\Label\DHL The label instance.
add_filter( "woocommerce_gzd_dhl_label_api_shipper_reference", function( $shipper_reference, $label ) {
    // Do something
    return $shipper_reference;    
}, 10, 2 );

woocommerce_gzd_dhl_label_api_shipper_name1 Filter

  1. $param_1 string
  2. $param_2 string
add_filter( "woocommerce_gzd_dhl_label_api_shipper_name1", function( $param_1, $param_2 ) {
    // Do something
    return $param_1;    
}, 10, 2 );

woocommerce_gzd_dhl_label_api_shipper_name2 Filter

  1. $param_1 string
  2. $param_2 string
add_filter( "woocommerce_gzd_dhl_label_api_shipper_name2", function( $param_1, $param_2 ) {
    // Do something
    return $param_1;    
}, 10, 2 );

woocommerce_gzd_dhl_label_api_shipper_street_number Filter

  1. $param_1 string
  2. $param_2 string
add_filter( "woocommerce_gzd_dhl_label_api_shipper_street_number", function( $param_1, $param_2 ) {
    // Do something
    return $param_1;    
}, 10, 2 );

woocommerce_gzd_dhl_label_api_shipper_street_name Filter

  1. $param_1 string
  2. $param_2 string
add_filter( "woocommerce_gzd_dhl_label_api_shipper_street_name", function( $param_1, $param_2 ) {
    // Do something
    return $param_1;    
}, 10, 2 );

woocommerce_gzd_dhl_label_api_shipper_zip Filter

  1. $param_1 string
  2. $param_2 string
add_filter( "woocommerce_gzd_dhl_label_api_shipper_zip", function( $param_1, $param_2 ) {
    // Do something
    return $param_1;    
}, 10, 2 );

woocommerce_gzd_dhl_label_api_shipper_city Filter

  1. $param_1 string
  2. $param_2 string
add_filter( "woocommerce_gzd_dhl_label_api_shipper_city", function( $param_1, $param_2 ) {
    // Do something
    return $param_1;    
}, 10, 2 );

woocommerce_gzd_dhl_label_api_shipper_phone Filter

  1. $param_1 string
  2. $param_2 string
add_filter( "woocommerce_gzd_dhl_label_api_shipper_phone", function( $param_1, $param_2 ) {
    // Do something
    return $param_1;    
}, 10, 2 );

woocommerce_gzd_dhl_label_api_shipper_email Filter

  1. $param_1 string
  2. $param_2 string
add_filter( "woocommerce_gzd_dhl_label_api_shipper_email", function( $param_1, $param_2 ) {
    // Do something
    return $param_1;    
}, 10, 2 );

woocommerce_gzd_dhl_label_api_shipper_country Filter

  1. $param_1 string
  2. $param_2 string
add_filter( "woocommerce_gzd_dhl_label_api_shipper_country", function( $param_1, $param_2 ) {
    // Do something
    return $param_1;    
}, 10, 2 );

woocommerce_gzd_dhl_label_api_shipper_state Filter

  1. $param_1 string
  2. $param_2 string
add_filter( "woocommerce_gzd_dhl_label_api_shipper_state", function( $param_1, $param_2 ) {
    // Do something
    return $param_1;    
}, 10, 2 );

woocommerce_gzd_dhl_label_api_export_type Filter

  1. $param_1 string
  2. $param_2 string
add_filter( "woocommerce_gzd_dhl_label_api_export_type", function( $param_1, $param_2 ) {
    // Do something
    return $param_1;    
}, 10, 2 );

woocommerce_gzd_dhl_label_api_export_invoice_number Filter

Filter to allow adjusting the export invoice number.

  1. $invoice_number string The invoice number.
  2. $label \Vendidero\Germanized\DHL\Label\Label The label instance.
add_filter( "woocommerce_gzd_dhl_label_api_export_invoice_number", function( $invoice_number, $label ) {
    // Do something
    return $invoice_number;    
}, 10, 2 );

woocommerce_gzd_dhl_shipment_needs_label Filter

Filter to determine whether a shipment needs a DHL label or not.

  1. $needs_label bool Whether the shipment needs a DHL label or not.
  2. $shipment \Vendidero\Germanized\Shipments\Shipment The shipment object.
add_filter( "woocommerce_gzd_dhl_shipment_needs_label", function( $needs_label, $shipment ) {
    // Do something
    return $needs_label;    
}, 10, 2 );

woocommerce_gzd_dhl_after_create_label Action

Action fires after creating a DHL label. The dynamic portion of this hook, `$hook_prefix` refers to the label type e.g. return. Example hook name: woocommerce_gzd_dhl_after_create_return_label

  1. $label \Vendidero\Germanized\DHL\Label\Label The label object.
add_action( "woocommerce_gzd_dhl_after_create_label", function( $label ) {
    // Do something
        
}, 10, 1 );

woocommerce_gzd_dhl_customs_item_description Filter

Apply legacy filters

  1. $param_1 string
  2. $param_2 string
  3. $param_3 string
  4. $param_4 string
add_filter( "woocommerce_gzd_dhl_customs_item_description", function( $param_1, $param_2, $param_3, $param_4 ) {
    // Do something
    return $param_1;    
}, 10, 4 );

woocommerce_gzd_dhl_customs_item_category Filter

  1. $param_1 string
  2. $param_2 string
  3. $param_3 string
  4. $param_4 string
add_filter( "woocommerce_gzd_dhl_customs_item_category", function( $param_1, $param_2, $param_3, $param_4 ) {
    // Do something
    return $param_1;    
}, 10, 4 );

woocommerce_gzd_dhl_customs_item Filter

  1. $param_1 string
  2. $param_2 string
  3. $param_3 string
  4. $param_4 string
add_filter( "woocommerce_gzd_dhl_customs_item", function( $param_1, $param_2, $param_3, $param_4 ) {
    // Do something
    return $param_1;    
}, 10, 4 );

woocommerce_gzd_dhl_customs_data Filter

  1. $param_1 string
  2. $param_2 string
  3. $param_3 string
add_filter( "woocommerce_gzd_dhl_customs_data", function( $param_1, $param_2, $param_3 ) {
    // Do something
    return $param_1;    
}, 10, 3 );

woocommerce_gzd_dhl_label_payment_ref_placeholder Filter

  1. $param array
add_filter( "woocommerce_gzd_dhl_label_payment_ref_placeholder", function( $param ) {
    // Do something
    return $param;    
}, 10, 1 );

woocommerce_gzd_dhl_label_customer_reference Filter

Filter to adjust the customer reference field placed on the DHL label. Maximum characeter length: 35.

  1. $text string The customer reference text.
  2. $label \Vendidero\Germanized\DHL\Label\Label The label instance.
  3. $shipment \Vendidero\Germanized\Shipments\SimpleShipment The shipment instance.
add_filter( "woocommerce_gzd_dhl_label_customer_reference", function( $text, $label, $shipment ) {
    // Do something
    return $text;    
}, 10, 3 );

woocommerce_gzd_dhl_label_endorsement_type Filter

  1. $param_1 string
  2. $param_2 string
  3. $param_3 string
add_filter( "woocommerce_gzd_dhl_label_endorsement_type", function( $param_1, $param_2, $param_3 ) {
    // Do something
    return $param_1;    
}, 10, 3 );

woocommerce_gzd_dhl_return_label_customer_reference Filter

Filter to adjust the customer reference field placed on the DHL return label. Maximum characeter length: 30.

  1. $text string The customer reference text.
  2. $label \Vendidero\Germanized\DHL\Label\Label The label instance.
  3. $shipment \Vendidero\Germanized\Shipments\ReturnShipment The shipment instance.
add_filter( "woocommerce_gzd_dhl_return_label_customer_reference", function( $text, $label, $shipment ) {
    // Do something
    return $text;    
}, 10, 3 );

woocommerce_gzd_dhl_inlay_return_label_reference Filter

Filter to adjust the inlay return reference field placed on the DHL label. Maximum characeter length: 35.

  1. $text string The customer reference text.
  2. $label \Vendidero\Germanized\DHL\Label\Label The label instance.
  3. $shipment \Vendidero\Germanized\Shipments\SimpleShipment The shipment instance.
add_filter( "woocommerce_gzd_dhl_inlay_return_label_reference", function( $text, $label, $shipment ) {
    // Do something
    return $text;    
}, 10, 3 );

woocommerce_gzd_dhl_label_shipment_street_number_placeholder Filter

This filter is documented in includes/wc-gzd-dhl-core-functions.php

  1. $param string
add_filter( "woocommerce_gzd_dhl_label_shipment_street_number_placeholder", function( $param ) {
    // Do something
    return $param;    
}, 10, 1 );

woocommerce_gzd_dhl_label_custom_format Filter

This filter allows adjusting the default label format (GUI) to a custom format e.g. 910-300-700. The following formats are available:

  • A4
  • 910-300-700
  • 910-300-700-oZ
  • 910-300-600
  • 910-300-610
  • 910-300-710
  • 100x70mm (Warenpost only)

  1. $format string The label format.
  2. $label \Vendidero\Germanized\DHL\Label\DHL The label instance.
  3. $type string The type e.g. inlay_return.
add_filter( "woocommerce_gzd_dhl_label_custom_format", function( $format, $label, $type ) {
    // Do something
    return $format;    
}, 10, 3 );