• Germanized
  • Hooks

Shipments

Hooks available in the Shipment package bundled in Germanized.

woocommerce_gzd_return_request_form_start Action

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

woocommerce_gzd_return_request_form Action

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

woocommerce_gzd_return_request_form_end Action

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

woocommerce_gzd_shipment_item_visible Filter

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

woocommerce_gzd_shipment_item_class Filter

Filter to adjust the classname used to construct a ShipmentItem.

  1. $classname string The classname to be used.
  2. $item_id int The shipment item id.
  3. $item_type string The shipment item type.
add_filter( "woocommerce_gzd_shipment_item_class", function( $classname, $item_id, $item_type ) {
    // Do something
    return $classname;    
}, 10, 3 );

woocommerce_gzd_shipment_item_name Filter

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

woocommerce_gzd_shipment_item_quantity_html Filter

This filter may adjust the shipment item quantity HTML on the customer account page.

  1. $html string The HTML output.
  2. $item \Vendidero\Germanized\Shipments\ShipmentItem The shipment item instance.
add_filter( "woocommerce_gzd_shipment_item_quantity_html", function( $html, $item ) {
    // Do something
    return $html;    
}, 10, 2 );

woocommerce_gzd_shipment_details_after_tracking_details Action

This action is executed after printing the shipment tracking details on the customer account page.

  1. $shipment \Vendidero\Germanized\Shipments\Shipment The shipment instance.
add_action( "woocommerce_gzd_shipment_details_after_tracking_details", function( $shipment ) {
    // Do something
        
}, 10, 1 );

woocommerce_gzd_shipment_details_before_shipment_table Action

This action is executed before printing the shipment detail table on the customer account page.

  1. $shipment \Vendidero\Germanized\Shipments\Shipment The shipment instance.
add_action( "woocommerce_gzd_shipment_details_before_shipment_table", function( $shipment ) {
    // Do something
        
}, 10, 1 );

woocommerce_gzd_shipment_details_before_shipment_table_items Action

This action is executed before printing the shipment table items on the customer account page.

  1. $shipment \Vendidero\Germanized\Shipments\Shipment The shipment instance.
add_action( "woocommerce_gzd_shipment_details_before_shipment_table_items", function( $shipment ) {
    // Do something
        
}, 10, 1 );

woocommerce_gzd_shipment_details_after_shipment_table_items Action

This action is executed after printing the shipment table items on the customer account page.

  1. $shipment \Vendidero\Germanized\Shipments\Shipment The shipment instance.
add_action( "woocommerce_gzd_shipment_details_after_shipment_table_items", function( $shipment ) {
    // Do something
        
}, 10, 1 );

woocommerce_gzd_shipment_details_after_shipment_table Action

This action is executed after printing the shipment detail table on the customer account page.

  1. $shipment \Vendidero\Germanized\Shipments\Shipment The shipment instance.
add_action( "woocommerce_gzd_shipment_details_after_shipment_table", function( $shipment ) {
    // Do something
        
}, 10, 1 );

woocommerce_gzd_return_shipment_after_instructions Action

This action is executed after printing the return shipment instructions.

  1. $shipment \Vendidero\Germanized\Shipments\ReturnShipment The shipment instance.
add_action( "woocommerce_gzd_return_shipment_after_instructions", function( $shipment ) {
    // Do something
        
}, 10, 1 );

woocommerce_gzd_shipment_details_after_address_details Action

This action is executed after printing the shipment address details on the customer account page.

  1. $shipment \Vendidero\Germanized\Shipments\Shipment The shipment instance.
add_action( "woocommerce_gzd_shipment_details_after_address_details", function( $shipment ) {
    // Do something
        
}, 10, 1 );

woocommerce_gzd_before_account_shipments Action

  1. $param_1 string
  2. $param_2 string
add_action( "woocommerce_gzd_before_account_shipments", function( $param_1, $param_2 ) {
    // Do something
        
}, 10, 2 );

woocommerce_gzd_my_account_shipments_column_{$column_id} Action

  1. $param_1 string
  2. $param_2 string

woocommerce_gzd_after_account_shipments Action

This action is executed after listing all available shipments for an order on the customer account page.

  1. $shipments \Vendidero\Germanized\Shipments\Shipment[] Array of shipments.
add_action( "woocommerce_gzd_after_account_shipments", function( $shipments ) {
    // Do something
        
}, 10, 1 );

woocommerce_gzd_view_shipment Action

This action is executed after printing the shipment details on the customer account page.

  1. $shipment_id int The shipment id.
add_action( "woocommerce_gzd_view_shipment", function( $shipment_id ) {
    // Do something
        
}, 10, 1 );

woocommerce_gzd_add_return_shipment_details_before_shipment_table_items Action

This action is executed before printing the add return shipment table on the customer account page.

  1. $order \WC_Order The order instance.
add_action( "woocommerce_gzd_add_return_shipment_details_before_shipment_table_items", function( $order ) {
    // Do something
        
}, 10, 1 );

woocommerce_gzd_add_return_shipment_details_after_shipment_table_items Action

This action is executed after printing the add return shipment table on the customer account page.

  1. $order \WC_Order The order instance.
add_action( "woocommerce_gzd_add_return_shipment_details_after_shipment_table_items", function( $order ) {
    // Do something
        
}, 10, 1 );

woocommerce_gzd_add_return_shipment Action

This action is executed after printing the add return shipment form on the customer account page.

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

woocommerce_gzd_email_before_shipment_table Action

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

woocommerce_gzd_email_after_shipment_table Action

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

woocommerce_gzd_email_shipment_details Action

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

woocommerce_gzd_email_shipment_item_quantity Filter

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

woocommerce_gzd_shipment_item_meta Action

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

woocommerce_gzd_shipment_item_thumbnail Filter

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

woocommerce_gzd_customer_new_return_shipment_request_success_message Filter

This filter may be used to adjust the default success message returned to the customer after successfully adding a return shipment.

  1. $message string The success message.
  2. $needs_manual_confirmation bool Whether the request needs manual confirmation or not.
add_filter( "woocommerce_gzd_customer_new_return_shipment_request_success_message", function( $message, $needs_manual_confirmation ) {
    // Do something
    return $message;    
}, 10, 2 );

woocommerce_gzd_return_request_order_id_from_string Filter

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

woocommerce_gzd_return_request_order_query_args Filter

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

woocommerce_gzd_return_request_customer_order_number_meta_key Filter

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

woocommerce_gzd_return_request_successfull Action

  1. $param string
add_action( "woocommerce_gzd_return_request_successfull", function( $param ) {
    // Do something
        
}, 10, 1 );

woocommerce_gzd_return_request_failed Action

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

woocommerce_gzd_customer_new_return_shipment_request_status Filter

This filter may be used to adjust the default status of a return shipment added by a customer.

  1. $status string The default status.
  2. $order \WC_Order The order object.
add_filter( "woocommerce_gzd_customer_new_return_shipment_request_status", function( $status, $order ) {
    // Do something
    return $status;    
}, 10, 2 );

woocommerce_gzd_new_customer_return_shipment_request Action

This hook is fired after a customer has added a new return request for a specific shipment. The return shipment object has been added successfully.

  1. $shipment \Vendidero\Germanized\Shipments\ReturnShipment The return shipment object.
  2. $order \WC_Order The order object.
add_action( "woocommerce_gzd_new_customer_return_shipment_request", function( $shipment, $order ) {
    // Do something
        
}, 10, 2 );

woocommerce_gzd_customer_new_return_shipment_request_redirect Filter

This filter may be used to adjust the redirect of a customer after adding a new return shipment. In case the return request needs manual confirmation the customer will be redirected to the parent shipment.

  1. $url string The redirect URL.
  2. $shipment \Vendidero\Germanized\Shipments\ReturnShipment The return shipment object.
  3. $needs_manual_confirmation bool Whether the request needs manual confirmation or not.
add_filter( "woocommerce_gzd_customer_new_return_shipment_request_redirect", function( $url, $shipment, $needs_manual_confirmation ) {
    // Do something
    return $url;    
}, 10, 3 );

woocommerce_gzd_shipments_order_completed_status Filter

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

woocommerce_gzd_shipment_order_mark_as_completed Filter

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

woocommerce_gzd_shipment_order_completed_status Filter

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

woocommerce_gzd_auto_create_shipments_for_order Filter

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

woocommerce_gzd_auto_create_custom_shipments_for_order Filter

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

woocommerce_gzd_after_auto_create_shipments_for_order Action

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

woocommerce_gzd_shipments_rest_check_permissions Filter

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

woocommerce_gzd_rest_pre_insert_shipment_object Filter

Filters a shipment before it is inserted via the REST API.

  1. $shipment \Vendidero\Germanized\Shipments\Shipment Shipment object.
  2. $request \WP_REST_Request Request object.
add_filter( "woocommerce_gzd_rest_pre_insert_shipment_object", function( $shipment, $request ) {
    // Do something
    return $shipment;    
}, 10, 2 );

woocommerce_gzd_rest_set_shipment_item Action

  1. $param_1 string
  2. $param_2 string
add_action( "woocommerce_gzd_rest_set_shipment_item", function( $param_1, $param_2 ) {
    // Do something
        
}, 10, 2 );

woocommerce_gzd_rest_insert_shipment_object Action

Fires after a single shipment is created or updated via the REST API.

  1. $shipment \Vendidero\Germanized\Shipments\Shipment Inserted object.
  2. $request \WP_REST_Request Request object.
  3. $creating bool True when creating object, false when updating.
add_action( "woocommerce_gzd_rest_insert_shipment_object", function( $shipment, $request, $creating ) {
    // Do something
        
}, 10, 3 );

woocommerce_gzd_rest_prepare_shipment_object Filter

Filter the shipment data for a response.

  1. $response \WP_REST_Response The response object.
  2. $shipment \Vendidero\Germanized\Shipments\Shipment Object data.
  3. $request \WP_REST_Request Request object.
add_filter( "woocommerce_gzd_rest_prepare_shipment_object", function( $response, $shipment, $request ) {
    // Do something
    return $response;    
}, 10, 3 );

woocommerce_gzd_shipments_disable_label_auto_generate Filter

Filter that allows to disable automatically creating DHL labels for a certain shipment.

  1. $disable bool True if you want to disable automation.
  2. $shipment \Vendidero\Germanized\Shipments\Shipment The shipment object.
add_filter( "woocommerce_gzd_shipments_disable_label_auto_generate", function( $disable, $shipment ) {
    // Do something
    return $disable;    
}, 10, 2 );

woocommerce_gzd_shipment_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_shipment_label_query_args", function( $query_vars ) {
    // Do something
    return $query_vars;    
}, 10, 1 );