• Germanized
  • Hooks

Shipments

Hooks available in the Shipment package bundled in Germanized.

woocommerce_gzd_shipments_shipping_label_zones Filter

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

woocommerce_gzd_shipments_shipping_label_zone_title Filter

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

woocommerce_gzd_shipments_shipping_shipments_label_zone_title Filter

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

woocommerce_gzd_shipment_type_data Filter

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

woocommerce_gzd_order_shipping_statuses Filter

Filter to adjust or add order shipping statuses. An order might retrieve a shipping status e.g. not shipped.

  1. $shipment_statuses array Available order shipping statuses.
add_filter( "woocommerce_gzd_order_shipping_statuses", function( $shipment_statuses ) {
    // Do something
    return $shipment_statuses;    
}, 10, 1 );

woocommerce_gzd_order_return_statuses Filter

Filter to adjust or add order return statuses. An order might retrieve a shipping status e.g. not shipped.

  1. $shipment_statuses array Available order return statuses.
add_filter( "woocommerce_gzd_order_return_statuses", function( $shipment_statuses ) {
    // Do something
    return $shipment_statuses;    
}, 10, 1 );

woocommerce_gzd_order_shipping_status_name Filter

Filter to adjust the status name for a certain order shipping status.

  1. $status_name string The status name.
  2. $status string The shipping status.
add_filter( "woocommerce_gzd_order_shipping_status_name", function( $status_name, $status ) {
    // Do something
    return $status_name;    
}, 10, 2 );

woocommerce_gzd_order_return_status_name Filter

Filter to adjust the status name for a certain order return status.

  1. $status_name string The status name.
  2. $status string The return status.
add_filter( "woocommerce_gzd_order_return_status_name", function( $status_name, $status ) {
    // Do something
    return $status_name;    
}, 10, 2 );

woocommerce_gzd_shipment_customer_visible_statuses Filter

Filter to decide which shipment statuses should be visible to customers e.g. whether a shipment of a certain status should be shown or not.

  1. $shipment_statuses array The available shipment statuses.
  2. $shipment_type string The shipment type.
add_filter( "woocommerce_gzd_shipment_customer_visible_statuses", function( $shipment_statuses, $shipment_type ) {
    // Do something
    return $shipment_statuses;    
}, 10, 2 );

woocommerce_gzd_shipment_statuses Filter

Add or adjust available Shipment statuses.

  1. $shipment_statuses array The available shipment statuses.
add_filter( "woocommerce_gzd_shipment_statuses", function( $shipment_statuses ) {
    // Do something
    return $shipment_statuses;    
}, 10, 1 );

woocommerce_gzd_shipment_selectable_statuses Filter

Add or remove selectable shipment statuses for a certain shipment and/or shipment type.

  1. $shipment_statuses array The available shipment statuses.
  2. $type string The shipment type e.g. return.
  3. $shipment \Vendidero\Germanized\Shipments\Shipment The shipment instance.
add_filter( "woocommerce_gzd_shipment_selectable_statuses", function( $shipment_statuses, $type, $shipment ) {
    // Do something
    return $shipment_statuses;    
}, 10, 3 );

woocommerce_gzd_allow_customer_return_empty_return_reason Filter

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

woocommerce_gzd_return_shipment_reasons_raw Filter

Filter that allows adjusting raw return reasons for a specific shipment (e.g. array containing reason data with code, reason and order).

  1. $reasons array Available return reasons.
  2. $order_item \WC_Order_Item|false The order item object if available to further filter reasons.
add_filter( "woocommerce_gzd_return_shipment_reasons_raw", function( $reasons, $order_item ) {
    // Do something
    return $reasons;    
}, 10, 2 );

woocommerce_gzd_return_shipment_reasons Filter

Filter that allows to adjust available return reasons for a specific shipment.

  1. $reasons \Vendidero\Germanized\Shipments\ReturnReason[] Available return reasons.
  2. $order_item \WC_Order_Item|false The order item object if available to further filter reasons.
add_filter( "woocommerce_gzd_return_shipment_reasons", function( $reasons, $order_item ) {
    // Do something
    return $reasons;    
}, 10, 2 );

woocommerce_gzd_shipment_editable_statuses Filter

Filter that allows to adjust Shipment statuses which decide upon whether a Shipment is editable or not.

  1. $statuses array Statuses which should be considered as editable.
add_filter( "woocommerce_gzd_shipment_editable_statuses", function( $statuses ) {
    // Do something
    return $statuses;    
}, 10, 1 );

woocommerce_gzd_default_shipping_provider Filter

Filter to adjust the default shipping provider used as a fallback for shipments for which no provider could be determined automatically (e.g. by the chosen shipping methid).

  1. $title string The shipping provider slug.
add_filter( "woocommerce_gzd_default_shipping_provider", function( $title ) {
    // Do something
    return $title;    
}, 10, 1 );

woocommerce_gzd_shipping_provider_title Filter

Filter to adjust the title of a certain shipping provider e.g. DHL.

  1. $title string The shipping provider title.
  2. $slug string The shipping provider slug.
add_filter( "woocommerce_gzd_shipping_provider_title", function( $title, $slug ) {
    // Do something
    return $title;    
}, 10, 2 );

woocommerce_gzd_shipping_provider_unknown_title Filter

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

woocommerce_gzd_shipment_default_address_fields Filter

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

woocommerce_gzd_shipment_{$address_type}_address_fields Filter

  1. $param_1 string
  2. $param_2 string

woocommerce_gzd_shipment_order_shipping_method Filter

Allows adjusting the shipping method for a certain order.

  1. $method \WC_Order_Item_Shipping|false The order item.
  2. $order \WC_Order The order object.
add_filter( "woocommerce_gzd_shipment_order_shipping_method", function( $method, $order ) {
    // Do something
    return $method;    
}, 10, 2 );

woocommerce_gzd_shipment_order_shipping_method_id Filter

Allows adjusting the shipping method id for a certain Order.

  1. $id string The shipping method id.
  2. $order \WC_Order The order object.
add_filter( "woocommerce_gzd_shipment_order_shipping_method_id", function( $id, $order ) {
    // Do something
    return $id;    
}, 10, 2 );

woocommerce_gzd_shipment_status_name Filter

Filter to adjust the shipment status name or title.

  1. $status_name string The status name or title.
  2. $status int The status slug.
add_filter( "woocommerce_gzd_shipment_status_name", function( $status_name, $status ) {
    // Do something
    return $status_name;    
}, 10, 2 );

woocommerce_gzd_shipment_sent_statuses Filter

Filter to adjust which Shipment statuses should be considered as sent.

  1. $statuses array An array of statuses considered as shipped,
add_filter( "woocommerce_gzd_shipment_sent_statuses", function( $statuses ) {
    // Do something
    return $statuses;    
}, 10, 1 );

woocommerce_gzd_shipment_item_class Filter

This filter may adjust the item class added to the shipment details table row on the customer account page.

  1. $item \Vendidero\Germanized\Shipments\ShipmentItem The shipment item instance.
  2. $shipment \Vendidero\Germanized\Shipments\Shipment The shipment instance.
  3. $param_3 string
add_filter( "woocommerce_gzd_shipment_item_class", function( $item, $shipment, $param_3 ) {
    // Do something
    return $item;    
}, 10, 3 );

woocommerce_gzd_format_shipment_dimensions Filter

Filter to adjust the format of Shipment dimensions e.g. LxBxH.

  1. $dimension_string string The dimension string.
  2. $dimensions array Array containing the dimensions.
  3. $unit string The dimension unit.
add_filter( "woocommerce_gzd_format_shipment_dimensions", function( $dimension_string, $dimensions, $unit ) {
    // Do something
    return $dimension_string;    
}, 10, 3 );

woocommerce_gzd_format_shipment_weight Filter

Filter to adjust the format of Shipment weight.

  1. $weight_string string The weight string.
  2. $weight string The Shipment weight.
  3. $unit string The dimension unit.
add_filter( "woocommerce_gzd_format_shipment_weight", function( $weight_string, $weight, $unit ) {
    // Do something
    return $weight_string;    
}, 10, 3 );

woocommerce_gzd_account_shipments_columns Filter

Filter to adjust columns being used to display shipments in a table view on the customer account page.

  1. $columns string[] The columns in key => value pairs.
  2. $type string The shipment type e.g. simple or return.
add_filter( "woocommerce_gzd_account_shipments_columns", function( $columns, $type ) {
    // Do something
    return $columns;    
}, 10, 2 );

woocommerce_gzd_shipments_add_return_shipment_url Filter

Filter to adjust the URL the customer (or guest) might access to add a return to a certain order.

  1. $url string The URL pointing to the add return page.
  2. $order \Vendidero\Germanized\Shipments\Order The order object.
add_filter( "woocommerce_gzd_shipments_add_return_shipment_url", function( $url, $order ) {
    // Do something
    return $url;    
}, 10, 2 );

woocommerce_gzd_order_return_completed_date Filter

Filter to adjust the completed date of an order used to determine whether an order is still returnable by the customer or not. The date is constructed by checking for existence in the following order: 1. The date the order was shipped completely 2. The date the order was marked as completed 3. The date the order was created

  1. $completed_date \WC_DateTime The order completed date.
  2. $order \WC_Order The order instance.
add_filter( "woocommerce_gzd_order_return_completed_date", function( $completed_date, $order ) {
    // Do something
    return $completed_date;    
}, 10, 2 );

woocommerce_gzd_order_is_returnable_by_customer Filter

Filter to decide whether a customer might add return request to a certain order.

  1. $is_returnable bool Whether or not shipment supports customer added returns
  2. $order \WC_Order The order instance for which the return shall be created.
  3. $check_date bool Whether to check for a maximum date or not.
add_filter( "woocommerce_gzd_order_is_returnable_by_customer", function( $is_returnable, $order, $check_date ) {
    // Do something
    return $is_returnable;    
}, 10, 3 );

woocommerce_gzd_get_order_shipping_provider Filter

Filters the shipping provider detected for a specific order.

  1. $provider bool|\Vendidero\Germanized\Shipments\Interfaces\ShippingProvider The shipping provider instance.
  2. $order \WC_Order The order instance.
add_filter( "woocommerce_gzd_get_order_shipping_provider", function( $provider, $order ) {
    // Do something
    return $provider;    
}, 10, 2 );

woocommerce_gzd_customer_can_view_shipments Filter

Filters whether a logged in user (or guest) might view shipments belonging to an order or not.

  1. $can_view_shipments bool Whether the user (or guest) might see shipments or not.
  2. $order_id int The order id.
add_filter( "woocommerce_gzd_customer_can_view_shipments", function( $can_view_shipments, $order_id ) {
    // Do something
    return $can_view_shipments;    
}, 10, 2 );

woocommerce_gzd_customer_return_needs_manual_confirmation Filter

Filter to decide whether a customer added return of a certain order needs manual confirmation by the shop manager or not.

  1. $needs_manual_confirmation bool Whether needs manual confirmation or not.
  2. $order \WC_Order The order instance for which the return shall be created.
add_filter( "woocommerce_gzd_customer_return_needs_manual_confirmation", function( $needs_manual_confirmation, $order ) {
    // Do something
    return $needs_manual_confirmation;    
}, 10, 2 );

woocommerce_gzd_account_shipments_actions Filter

Filter to adjust available actions in the shipments table view on the customer account page for a specific shipment.

  1. $actions string[] Available actions containing an id as key and a URL and name.
  2. $shipment \Vendidero\Germanized\Shipments\Shipment The shipment instance.
add_filter( "woocommerce_gzd_account_shipments_actions", function( $actions, $shipment ) {
    // Do something
    return $actions;    
}, 10, 2 );

woocommerce_gzd_shipments_disable_deferred_sync Filter

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

woocommerce_gzd_email_shipment_items_args Filter

Filter to adjust the arguments passed to retrieving ShipmentItems for display in an Email.

  1. $args array Array containing the arguments passed.
add_filter( "woocommerce_gzd_email_shipment_items_args", function( $args ) {
    // Do something
    return $args;    
}, 10, 1 );

woocommerce_gzd_email_shipment_items_table Filter

Filter that allows adjusting the HTML output of the shipment email item table.

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

woocommerce_gzd_shipment_label_type Filter

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

woocommerce_gzd_shipment_label_types Filter

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

woocommerce_gzd_shipment_label_for_shipment Filter

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

woocommerce_gzd_shipment_label Filter

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

woocommerce_gzd_shipment_label_weight Filter

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

woocommerce_gzd_shipment_label_dimensions Filter

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

woocommerce_gzd_shipments_meta_box_actions Action

Action that fires in the action container for Shipments of a specific order.

  1. $order_shipment \Vendidero\Germanized\Shipments\Order The shipment order object.
add_action( "woocommerce_gzd_shipments_meta_box_actions", function( $order_shipment ) {
    // Do something
        
}, 10, 1 );

woocommerce_gzd_shipment_label_admin_after_download Action

Action that fires after the label download link of a shipment label was outputted.

  1. $label \Vendidero\Germanized\Shipments\Interfaces\ShipmentLabel The label object.
  2. $shipment \Vendidero\Germanized\Shipments\Shipment The shipment object.
add_action( "woocommerce_gzd_shipment_label_admin_after_download", function( $label, $shipment ) {
    // Do something
        
}, 10, 2 );

woocommerce_gzd_shipments_meta_box_shipment_item_after_{$column_name} Action

Action that fires after outputting a shipment item column in admin meta box. The dynamic portion of this hook `$column_name` refers to the column name e.g. name or quantity. Example hook name: woocommerce_gzd_shipments_meta_box_shipment_item_after_name

  1. $item_id int The shipment item id.
  2. $shipment_item \Vendidero\Germanized\Shipments\ShipmentItem The shipment item instance.
  3. $shipment \Vendidero\Germanized\Shipments\Shipment The shipment instance.
  4. $column_name string The column name.

woocommerce_gzd_shipment_admin_before_columns Action

Action that fires before the first column of a Shipment’s meta box is being outputted.

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

woocommerce_gzd_shipments_meta_box_shipment_after_left_column Action

Action that fires after the left column of a Shipment’s meta box admin view.

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