• Germanized
  • Hooks

DHL

Hooks for the DHL package bundled in Germanized.

woocommerce_gzd_dhl_preferred_service_fields Action

add_action( "woocommerce_gzd_dhl_preferred_service_fields", function(  ) {
    // Do something
        
}, 10 );

woocommerce_gzd_dhl_enabled Filter

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

woocommerce_gzd_dhl_holidays Filter

Filter to adjust dates regarded as holidays for a certain country.

  1. $holidays array Array containing dates in Y-m-d format.
  2. $country string The country as ISO code.
add_filter( "woocommerce_gzd_dhl_holidays", function( $holidays, $country ) {
    // Do something
    return $holidays;    
}, 10, 2 );

woocommerce_gzd_dhl_retoure_receiver Filter

Returns the DHL retoure receiver id for a certain country.

  1. $receiver array The receiver to be used for the retoure.
  2. $country string The country code of the retoure.
add_filter( "woocommerce_gzd_dhl_retoure_receiver", function( $receiver, $country ) {
    // Do something
    return $receiver;    
}, 10, 2 );

woocommerce_gzd_dhl_upload_dir Filter

Filter to adjust the DHL label upload directory. By default DHL labels are stored in a custom directory under wp-content/uploads.

  1. $upload_dir array Array containing `wp_upload_dir` data.
add_filter( "woocommerce_gzd_dhl_upload_dir", function( $upload_dir ) {
    // Do something
    return $upload_dir;    
}, 10, 1 );

woocommerce_gzd_dhl_relative_upload_dir Filter

Filter to retrieve the DHL label relative upload path.

  1. $path array Relative path.
add_filter( "woocommerce_gzd_dhl_relative_upload_dir", function( $path ) {
    // Do something
    return $path;    
}, 10, 1 );

woocommerce_gzd_dhl_alternate_wsdl_file Filter

This filter may be used to force loading an alternate (local) WSDL file for a certain API endpoint. By default we are trying to locally store necessary files to reduce API calls. Transients/files are renewed once per day.

  1. $alternate_file bool|string In case an alternate file should be used this must be the absolute path.
  2. $wsdl_link string The link to the original WSDL file.
add_filter( "woocommerce_gzd_dhl_alternate_wsdl_file", function( $alternate_file, $wsdl_link ) {
    // Do something
    return $alternate_file;    
}, 10, 2 );

woocommerce_gzd_dhl_upload_path Filter

Filter to adjust the DHL label upload path. By default DHL labels are stored in a custom directory under wp-content/uploads.

  1. $path string Path to the upload directory.
add_filter( "woocommerce_gzd_dhl_upload_path", function( $path ) {
    // Do something
    return $path;    
}, 10, 1 );

woocommerce_gzd_dhl_upload_url Filter

Filter to adjust the DHL label upload URL. By default DHL labels are stored in a custom directory under wp-content/uploads.

  1. $url string URL to the upload directory.
add_filter( "woocommerce_gzd_dhl_upload_url", function( $url ) {
    // Do something
    return $url;    
}, 10, 1 );

woocommerce_gzd_dhl_enable_logging Filter

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

woocommerce_gzd_dhl_base_country Filter

Filter to adjust the DHL base country.

  1. $country string The country as ISO code.
add_filter( "woocommerce_gzd_dhl_base_country", function( $country ) {
    // Do something
    return $country;    
}, 10, 1 );

woocommerce_gzd_dhl_label_query_args Filter

Filter to adjust query paramaters for a DHL label query.

  1. $query_vars array The query arguments.
add_filter( "woocommerce_gzd_dhl_label_query_args", function( $query_vars ) {
    // Do something
    return $query_vars;    
}, 10, 1 );

woocommerce_gzd_dhl_label_query Filter

Filter to adjust query result data for a DHL label query.

  1. $results \Vendidero\Germanized\DHL\Label\Label[] The results.
  2. $args array The query arguments.
add_filter( "woocommerce_gzd_dhl_label_query", function( $results, $args ) {
    // Do something
    return $results;    
}, 10, 2 );

woocommerce_gzd_dhl_label_search_columns Filter

Filters the columns to search in a DHL LabelQuery search. The default columns depend on the search term, and include ‘label_id’, ‘label_shipment_id’, ‘label_path’ and ‘label_number’.

  1. $search_columns string[] Array of column names to be searched.
  2. $search string Text being searched.
  3. $this \Vendidero\Germanized\DHL\Legacy\LegacyLabelQuery The current LabelQuery instance.
add_filter( "woocommerce_gzd_dhl_label_search_columns", function( $search_columns, $search, $this ) {
    // Do something
    return $search_columns;    
}, 10, 3 );

woocommerce_gzd_dhl_{$hook_postfix}label_created Action

Action fires when a new DHL label has been created. The dynamic portion of this hook, `$hook_postfix` refers to the label type e.g. return in case it is not a simple label.

  1. $label_id int The label id.
  2. $label \Vendidero\Germanized\DHL\Legacy\DataStores\Label The label instance.

woocommerce_gzd_dhl_{$hook_postfix}label_updated Action

Action fires after a DHL label has been updated in the DB. The dynamic portion of this hook, `$hook_postfix` refers to the label type e.g. return in case it is not a simple label.

  1. $label_id int The label id.
  2. $label \Vendidero\Germanized\DHL\Legacy\DataStores\Label The label instance.
  3. $changed_props array Properties that have been changed.

woocommerce_gzd_dhl_{$hook_postfix}label_deleted Action

Action fires after a DHL label has been deleted from DB. The dynamic portion of this hook, `$hook_postfix` refers to the label type e.g. return in case it is not a simple label.

  1. $label_id int The label id.
  2. $label \Vendidero\Germanized\DHL\Legacy\Label The label object.

woocommerce_gzd_dhl_{$hook_postfix}label_loaded Action

Action fires after reading a DHL label from DB. The dynamic portion of this hook, `$hook_postfix` refers to the label type e.g. return in case it is not a simple label.

  1. $label \Vendidero\Germanized\DHL\Legacy\Label The label object.

woocommerce_gzd_dhl_label_object_updated_props Action

Action fires after DHL label meta properties have been updated.

  1. $label \Vendidero\Germanized\DHL\Legacy\Label The label object.
  2. $updated_props array The updated properties.
add_action( "woocommerce_gzd_dhl_label_object_updated_props", function( $label, $updated_props ) {
    // Do something
        
}, 10, 2 );

woocommerce_gzd_dhl_label_data_store_get_labels_query Filter

Filter to adjust the DHL label query args after parsing them.

  1. $wp_query_args array Parsed query arguments.
  2. $query_vars array Original query arguments.
  3. $data_store \Vendidero\Germanized\DHL\Legacy\DataStores\Label The label data store.
add_filter( "woocommerce_gzd_dhl_label_data_store_get_labels_query", function( $wp_query_args, $query_vars, $data_store ) {
    // Do something
    return $wp_query_args;    
}, 10, 3 );

woocommerce_gzd_dhl_order_supports_email_notification Filter

Filter to adjust whether customer data (email address) should be handed over to DHL to provide with services such as email notification or parcel outlet routing. By default this may only work if the customer has opted-in via checkbox during checkout.

  1. $has_email_notification bool Whether the order supports email notification (handing over customer data to DHL).
  2. $order \Vendidero\Germanized\DHL\Order The order instance.
add_filter( "woocommerce_gzd_dhl_order_supports_email_notification", function( $has_email_notification, $order ) {
    // Do something
    return $has_email_notification;    
}, 10, 2 );

woocommerce_gzd_dhl_order_needs_age_verificaton Filter

Filter to decide whether a DHL order needs age verification or not.

  1. $needs_verification bool Whether the order needs age verification or not.
  2. $order \Vendidero\Germanized\DHL\Order The order instance.
add_filter( "woocommerce_gzd_dhl_order_needs_age_verificaton", function( $needs_verification, $order ) {
    // Do something
    return $needs_verification;    
}, 10, 2 );

woocommerce_gzd_dhl_order_has_cod_payment Filter

Filter to decide whether a DHL order has cash on delivery payment enabled.

  1. $result bool Whether the order has COD payment or not.
  2. $order \Vendidero\Germanized\DHL\Order The order instance.
add_filter( "woocommerce_gzd_dhl_order_has_cod_payment", function( $result, $order ) {
    // Do something
    return $result;    
}, 10, 2 );

woocommerce_gzd_dhl_parcel_locator_countries Filter

Filter to enable DHL parcel shop delivery for certain countries.

  1. $country_codes array Array of country codes which support DHL parcel shop delivery.
add_filter( "woocommerce_gzd_dhl_parcel_locator_countries", function( $country_codes ) {
    // Do something
    return $country_codes;    
}, 10, 1 );

woocommerce_gzd_dhl_parcel_locator_excluded_gateways Filter

Filter to disable DHL parcel shop delivery for certain gateways.

  1. $gateways array Array of gateway IDs to exclude.
add_filter( "woocommerce_gzd_dhl_parcel_locator_excluded_gateways", function( $gateways ) {
    // Do something
    return $gateways;    
}, 10, 1 );

woocommerce_gzd_dhl_order_postnumber Filter

Filter to adjust the DHL postnumber for a certain order.

  1. $post_number string The post number.
  2. $order \WC_Order The order object.
add_filter( "woocommerce_gzd_dhl_order_postnumber", function( $post_number, $order ) {
    // Do something
    return $post_number;    
}, 10, 2 );

woocommerce_gzd_dhl_order_pickup_type Filter

Filter to adjust the DHL pickup type e.g. packstation for a certain order.

  1. $pickup_type string The pickup type.
  2. $order \WC_Order The order object.
add_filter( "woocommerce_gzd_dhl_order_pickup_type", function( $pickup_type, $order ) {
    // Do something
    return $pickup_type;    
}, 10, 2 );

woocommerce_gzd_dhl_user_postnumber Filter

Filter to adjust the DHL postnumber for a certain user.

  1. $post_number string The post number.
  2. $user \WP_User The user object.
add_filter( "woocommerce_gzd_dhl_user_postnumber", function( $post_number, $user ) {
    // Do something
    return $post_number;    
}, 10, 2 );

woocommerce_gzd_dhl_pickup_type_address_label Filter

Filter to adjust the pickup type address label added to the address field when a certain pickup type was chosen.

  1. $pickup_type_text string The pickup type text.
  2. $method bool|\Vendidero\Germanized\DHL\ShippingProvider\ShippingMethod The shipping method object if available.
add_filter( "woocommerce_gzd_dhl_pickup_type_address_label", function( $pickup_type_text, $method ) {
    // Do something
    return $pickup_type_text;    
}, 10, 2 );

woocommerce_gzd_dhl_pickup_type_address_placeholder Filter

Filter to adjust the pickup type address placeholder added to the address field when a certain pickup type was chosen.

  1. $pickup_type_text string The pickup type placeholder text.
  2. $method bool|\Vendidero\Germanized\DHL\ShippingProvider\ShippingMethod The shipping method object if available.
add_filter( "woocommerce_gzd_dhl_pickup_type_address_placeholder", function( $pickup_type_text, $method ) {
    // Do something
    return $pickup_type_text;    
}, 10, 2 );

woocommerce_gzd_dhl_return_label_api_sender_name3 Filter

By default the name3 parameter is used to transmit the additional address field to the DHL API. You may adjust the field value by using this filter.

  1. $value string The field value.
  2. $label \Vendidero\Germanized\DHL\Label\ReturnLabel The label instance.
add_filter( "woocommerce_gzd_dhl_return_label_api_sender_name3", function( $value, $label ) {
    // Do something
    return $value;    
}, 10, 2 );

woocommerce_gzd_dhl_retoure_customs_article_reference Filter

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

woocommerce_gzd_dhl_retoure_customs_data Filter

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

woocommerce_gzd_dhl_consider_saturday_as_working_day Filter

Filter to decide whether DHL should consider saturday as a working day for preferred day calculation or not.

  1. $is_working_day bool True if saturday should be considered a working day.
add_filter( "woocommerce_gzd_dhl_consider_saturday_as_working_day", function( $is_working_day ) {
    // Do something
    return $is_working_day;    
}, 10, 1 );

woocommerce_gzd_deutsche_post_exclude_page_format Filter

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

woocommerce_gzd_dhl_deutsche_post_label_api_before_delete Action

Action fires before deleting a Deutsche Post PDF label through an API call.

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

woocommerce_gzd_dhl_deutsche_post_label_api_deleted Action

Action fires after deleting a Deutsche Post PDF label through an API call.

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

woocommerce_gzd_deutsche_post_label_api_position_x Filter

Adjust the Deutsche Post (Internetmarke) label print X position.

  1. $x mixed The x axis position.
  2. $label \Vendidero\Germanized\DHL\Label\DeutschePost The label instance.
  3. $shipment \Vendidero\Germanized\Shipments\Shipment The shipment instance.
add_filter( "woocommerce_gzd_deutsche_post_label_api_position_x", function( $x, $label, $shipment ) {
    // Do something
    return $x;    
}, 10, 3 );

woocommerce_gzd_deutsche_post_label_api_position_y Filter

Adjust the Deutsche Post (Internetmarke) label print Y position.

  1. $y mixed The y axis position.
  2. $label \Vendidero\Germanized\DHL\Label\DeutschePost The label instance.
  3. $shipment \Vendidero\Germanized\Shipments\Shipment The shipment instance.
add_filter( "woocommerce_gzd_deutsche_post_label_api_position_y", function( $y, $label, $shipment ) {
    // Do something
    return $y;    
}, 10, 3 );

woocommerce_gzd_deutsche_post_label_api_page_number Filter

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

woocommerce_gzd_deutsche_post_label_api_customs_shipment_service_level Filter

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

woocommerce_gzd_deutsche_post_label_api_customs_shipment_nature_type Filter

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

woocommerce_gzd_deutsche_post_label_api_customs_transmit_communication_data Filter

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

woocommerce_gzd_deutsche_post_label_api_pdf_accept_header Filter

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

woocommerce_gzd_dhl_label_api_deleted Action

Action fires after deleting a DHL PDF label through an API call.

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

woocommerce_gzd_dhl_label_api_enable_notification Filter

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

woocommerce_gzd_dhl_label_api_receiver_name3 Filter

By default the name3 parameter is used to transmit the additional address field to the DHL API. You may adjust the field value by using this filter.

  1. $value string The field value.
  2. $label \Vendidero\Germanized\DHL\Label\DHL The label instance.
add_filter( "woocommerce_gzd_dhl_label_api_receiver_name3", function( $value, $label ) {
    // Do something
    return $value;    
}, 10, 2 );

woocommerce_gzd_dhl_label_api_communication_contact_person Filter

Choose whether to transmit the full name of the shipment receiver as contactPerson while creating a label.

  1. $name string The name of the shipmen receiver.
  2. $label \Vendidero\Germanized\DHL\Label\DHL The label instance.
add_filter( "woocommerce_gzd_dhl_label_api_communication_contact_person", function( $name, $label ) {
    // Do something
    return $name;    
}, 10, 2 );

woocommerce_gzd_dhl_label_api_communication_phone Filter

Choose whether to transfer the phone number to DHL on creating a label. By default the phone number is not transmitted.

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

woocommerce_gzd_dhl_label_api_communication_email Filter

Choose whether to transfer the email to DHL on creating a label. By default the email is only transmitted if the customer opted in. This email address is not used to notify the customer via DHL. It is only meant for communicaton purposes.

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