• Germanized
  • Hooks

Shipments

woocommerce_gzd_shipment_label_query Filter

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

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

woocommerce_gzd_shipment_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\Shipments\Labels\LabelQuery The current LabelQuery instance.
add_filter( "woocommerce_gzd_shipment_label_search_columns", function( $search_columns, $search, $this ) {
    // Do something
    return $search_columns;    
}, 10, 3 );

woocommerce_gzd_shipments_order_has_voucher Filter

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

woocommerce_gzd_shipments_customs_use_subtotal Filter

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

woocommerce_gzd_shipment_label_shipping_provider_name Filter

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

woocommerce_gzd_shipment_label_class Filter

Filter that allows adjusting the default DHL label classname.

  1. $classname string The classname to be used.
  2. $label_id int The label id.
  3. $label_type string The label type.
  4. $param_4 string
add_filter( "woocommerce_gzd_shipment_label_class", function( $classname, $label_id, $label_type, $param_4 ) {
    // Do something
    return $classname;    
}, 10, 4 );

woocommerce_gzd_return_shipment_customer_confirmed Action

Action that fires after a return request has been confirmed to the customer.

  1. $shipment_id int The return shipment id.
  2. $shipment \Vendidero\Germanized\Shipments\ReturnShipment The return shipment object.
add_action( "woocommerce_gzd_return_shipment_customer_confirmed", function( $shipment_id, $shipment ) {
    // Do something
        
}, 10, 2 );

woocommerce_gzd_return_shipment_sync_props Filter

Filter to allow adjusting the return shipment props synced from the corresponding order.

  1. $args mixed The properties in key => value pairs.
  2. $shipment \Vendidero\Germanized\Shipments\ReturnShipment The shipment object.
  3. $order_shipment \Vendidero\Germanized\Shipments\Order The shipment order object.
add_filter( "woocommerce_gzd_return_shipment_sync_props", function( $args, $shipment, $order_shipment ) {
    // Do something
    return $args;    
}, 10, 3 );

woocommerce_gzd_return_shipment_synced Action

Action that fires after a return shipment has been synced. Syncing is used to keep the shipment in sync with the corresponding parent shipment.

  1. $shipment \Vendidero\Germanized\Shipments\ReturnShipment The return shipment object.
  2. $order_shipment \Vendidero\Germanized\Shipments\Order The shipment order object.
  3. $args array Array containing properties in key => value pairs to be updated.
add_action( "woocommerce_gzd_return_shipment_synced", function( $shipment, $order_shipment, $args ) {
    // Do something
        
}, 10, 3 );

woocommerce_gzd_return_shipment_items_synced Action

Action that fires after items of a shipment have been synced.

  1. $shipment \Vendidero\Germanized\Shipments\SimpleShipment The shipment object.
  2. $order_shipment \Vendidero\Germanized\Shipments\Order The shipment order object.
  3. $args array Array containing additional data e.g. items.
add_action( "woocommerce_gzd_return_shipment_items_synced", function( $shipment, $order_shipment, $args ) {
    // Do something
        
}, 10, 3 );

woocommerce_gzd_shipment_has_status Filter

Filter to decide whether a Shipment has a certain status or not.

  1. $has_status bool Whether the Shipment has a status or not.
  2. $this \Vendidero\Germanized\Shipments\Shipment The shipment object.
  3. $status string The status to be checked against.
add_filter( "woocommerce_gzd_shipment_has_status", function( $has_status, $this, $status ) {
    // Do something
    return $has_status;    
}, 10, 3 );

woocommerce_gzd_get_shipment_address_street_number Filter

Filter to adjust the shipment address street number.

  1. $number string The shipment address street number.
  2. $shipment \Vendidero\Germanized\Shipments\Shipment The shipment object.
add_filter( "woocommerce_gzd_get_shipment_address_street_number", function( $number, $shipment ) {
    // Do something
    return $number;    
}, 10, 2 );

woocommerce_gzd_get_shipment_address_street Filter

Filter to adjust the shipment address street.

  1. $street string The shipment address street without street number.
  2. $shipment \Vendidero\Germanized\Shipments\Shipment The shipment object.
add_filter( "woocommerce_gzd_get_shipment_address_street", function( $street, $shipment ) {
    // Do something
    return $street;    
}, 10, 2 );

woocommerce_gzd_get_shipment_address_street_addition Filter

Filter to adjust the shipment address street addition.

  1. $addition string The shipment address street addition e.g. EG14.
  2. $shipment \Vendidero\Germanized\Shipments\Shipment The shipment object.
add_filter( "woocommerce_gzd_get_shipment_address_street_addition", function( $addition, $shipment ) {
    // Do something
    return $addition;    
}, 10, 2 );

woocommerce_gzd_get_shipment_address_street_addition_2 Filter

Filter to adjust the shipment address street addition.

  1. $addition string The shipment address street addition e.g. EG14.
  2. $shipment \Vendidero\Germanized\Shipments\Shipment The shipment object.
add_filter( "woocommerce_gzd_get_shipment_address_street_addition_2", function( $addition, $shipment ) {
    // Do something
    return $addition;    
}, 10, 2 );

woocommerce_gzd_shipment_send_to_external_pickup Filter

Filter to decide whether a Shipment is to be sent to a external pickup location e.g. packstation.

  1. $external bool True if the Shipment goes to a pickup location.
  2. $types array Array containing the types to be checked agains.
  3. $this \Vendidero\Germanized\Shipments\Shipment The shipment object.
add_filter( "woocommerce_gzd_shipment_send_to_external_pickup", function( $external, $types, $this ) {
    // Do something
    return $external;    
}, 10, 3 );

woocommerce_gzd_shipment_is_editable Filter

Filter to dedice whether the current Shipment is still editable or not.

  1. $is_editable bool Whether the Shipment is editable or not.
  2. $this \Vendidero\Germanized\Shipments\Shipment The shipment object.
add_filter( "woocommerce_gzd_shipment_is_editable", function( $is_editable, $this ) {
    // Do something
    return $is_editable;    
}, 10, 2 );

woocommerce_gzd_shipment_edit_status Action

Action that fires after a shipment bulk status update has been processed.

  1. $shipment_id int The shipment id.
  2. $new_status string The new shipment status.
add_action( "woocommerce_gzd_shipment_edit_status", function( $shipment_id, $new_status ) {
    // Do something
        
}, 10, 2 );

woocommerce_gzd_shipment_before_status_change Action

Action that fires before a shipment status transition happens.

  1. $shipment_id int The shipment id.
  2. $shipment \Vendidero\Germanized\Shipments\Shipment The shipment object.
  3. $status_transition array The status transition data.
add_action( "woocommerce_gzd_shipment_before_status_change", function( $shipment_id, $shipment, $status_transition ) {
    // Do something
        
}, 10, 3 );

woocommerce_gzd_shipment_status_changed Action

Action that indicates shipment status change.

  1. $shipment_id int The shipment id.
  2. $status_from string The old shipment status.
  3. $status_to string The new shipment status.
  4. $shipment \Vendidero\Germanized\Shipments\Shipment The shipment object.
add_action( "woocommerce_gzd_shipment_status_changed", function( $shipment_id, $status_from, $status_to, $shipment ) {
    // Do something
        
}, 10, 4 );

woocommerce_gzd_shipment_contains_order_item Filter

Filter to adjust whether a Shipment contains a specific order item or not.

  1. $contains bool Whether the Shipment contains the order item or not.
  2. $order_item_id int[] The order item id(s).
  3. $this \Vendidero\Germanized\Shipments\Shipment The shipment object.
add_filter( "woocommerce_gzd_shipment_contains_order_item", function( $contains, $order_item_id, $this ) {
    // Do something
    return $contains;    
}, 10, 3 );

woocommerce_gzd_{$hook_postfix}shipment_after_save Action

Trigger action after saving shipment to the DB. The dynamic portion of this hook, `$hook_postfix` is used to construct a unique hook for a shipment type. Example hook name: woocommerce_gzd_shipment_after_save

  1. $shipment \Vendidero\Germanized\Shipments\Shipment The shipment object being saved.
  2. $is_new bool Indicator to determine whether this is a new shipment or not.

woocommerce_gzd_packaging_class Filter

Filter to adjust the classname used to construct a Packaging.

  1. $classname string The classname to be used.
  2. $packaging_id int The packaging id.
add_filter( "woocommerce_gzd_packaging_class", function( $classname, $packaging_id ) {
    // Do something
    return $classname;    
}, 10, 2 );

woocommerce_gzd_shipments_init Action

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

woocommerce_gzd_enable_rucksack_packaging Filter

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

woocommerce_gzd_shipping_provider_method_clean_settings Filter

Filter that returns shipping method settings cleaned from global shipping provider method settings. This filter might be useful to remove some default setting values from shipping provider method settings e.g. DHL settings.

  1. $p_settings array The settings
  2. $method \WC_Shipping_Method The shipping method instance
add_filter( "woocommerce_gzd_shipping_provider_method_clean_settings", function( $p_settings, $method ) {
    // Do something
    return $p_settings;    
}, 10, 2 );

woocommerce_gzd_shipment_base_country Filter

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

woocommerce_gzd_shipment_base_postcode Filter

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

woocommerce_gzd_country_belongs_to_eu_customs_area Filter

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

woocommerce_gzd_shipments_enable_logging Filter

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

woocommerce_gzd_shipments_upload_dir Filter

Filter to adjust the upload directory used to store shipment related files. By default files are stored in a custom directory under wp-content/uploads.

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

woocommerce_gzd_shipments_relative_upload_dir Filter

Filter to retrieve the relative upload path used for storing shipment related files.

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

woocommerce_gzd_shipments_upload_path Filter

Filter to adjust the upload path used to store shipment related files. By default files are stored in a custom directory under wp-content/uploads.

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

woocommerce_gzd_shipments_upload_url Filter

Filter to adjust the upload URL used to retrieve shipment related files. By default files are stored in a custom directory under wp-content/uploads.

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

woocommerce_gzd_shipments_enabled Filter

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

woocommerce_gzd_shipments_registered_data_stores Action

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

woocommerce_gzd_packaging_inner_dimension_use_percentage_buffer Filter

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

woocommerce_gzd_packaging_inner_dimension_percentage_buffer Filter

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

woocommerce_gzd_packaging_inner_dimension_fixed_buffer_mm Filter

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

woocommerce_gzd_shipments_order_shipped Action

Action that fires as soon as an order has been shipped completely. That is the case when the order contains all relevant shipments and all the shipments are marked as shipped.

  1. $order_id string The order id.
add_action( "woocommerce_gzd_shipments_order_shipped", function( $order_id ) {
    // Do something
        
}, 10, 1 );

woocommerce_gzd_new_packaging Action

Action that indicates that a new Packaging has been created in the DB.

  1. $packaging_id int The packaging id.
  2. $packaging \Vendidero\Germanized\Shipments\Packaging The packaging instance.
add_action( "woocommerce_gzd_new_packaging", function( $packaging_id, $packaging ) {
    // Do something
        
}, 10, 2 );

woocommerce_gzd_packaging_updated Action

Action that indicates that a Packaging has been updated in the DB.

  1. $packaging_id int The packaging id.
  2. $packaging \Vendidero\Germanized\Shipments\Packaging The packaging instance.
add_action( "woocommerce_gzd_packaging_updated", function( $packaging_id, $packaging ) {
    // Do something
        
}, 10, 2 );

woocommerce_gzd_packaging_deleted Action

Action that indicates that a Packaging has been deleted from the DB.

  1. $packaging_id int The packaging id.
  2. $packaging \Vendidero\Germanized\Shipments\Packaging The packaging instance.
add_action( "woocommerce_gzd_packaging_deleted", function( $packaging_id, $packaging ) {
    // Do something
        
}, 10, 2 );

woocommerce_gzd_packaging_loaded Action

Action that indicates that a Packaging has been loaded from DB.

  1. $packaging \Vendidero\Germanized\Shipments\Packaging The Packaging object.
add_action( "woocommerce_gzd_packaging_loaded", function( $packaging ) {
    // Do something
        
}, 10, 1 );

woocommerce_gzd_packaging_object_updated_props Action

Action that fires after updating a Packaging’s properties.

  1. $packaging \Vendidero\Germanized\Shipments\Packaging The Packaging object.
  2. $changed_props array The updated properties.
add_action( "woocommerce_gzd_packaging_object_updated_props", function( $packaging, $changed_props ) {
    // Do something
        
}, 10, 2 );

woocommerce_gzd_packaging_data_store_get_shipments_query Filter

Filter to adjust Packaging query arguments after parsing.

  1. $wp_query_args array Array containing parsed query arguments.
  2. $query_vars array The original query arguments.
  3. $data_store \Vendidero\Germanized\Shipments\DataStores\Packaging The packaging data store object.
add_filter( "woocommerce_gzd_packaging_data_store_get_shipments_query", function( $wp_query_args, $query_vars, $data_store ) {
    // Do something
    return $wp_query_args;    
}, 10, 3 );

woocommerce_gzd_shipment_packaging_match_threshold Filter

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

woocommerce_gzd_find_available_packaging_for_shipment Filter

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

woocommerce_gzd_find_best_matching_packaging_for_shipment Filter

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

woocommerce_gzd_new_{$hook_postfix}shipment Action

Action that indicates that a new Shipment has been created in the DB. The dynamic portion of this hook, `$hook_postfix` refers to the shipment type in case it is not a simple shipment.

  1. $shipment_id int The shipment id.
  2. $shipment \Vendidero\Germanized\Shipments\DataStores\Shipment The shipment instance.

woocommerce_gzd_get_shipment_default_status Filter

This filter is documented in src/Shipment.php

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