Probo Connect for WooCommerce

Actions & Hooks Reference

This document lists all custom WordPress actions and filters provided by the Probo Connect plugin. These hooks allow developers to customize and extend the plugin's functionality.

Action Hooks

probo_save_order_item_meta_{$uploader_type}

Fires when saving order item meta for a specific uploader type during checkout.

File: includes/frontend/class-probo-hooks.php

Parameters:

Parameter Type Description
$item WC_Order_Item_Product Order item being saved
$uploader_values array Uploader values from cart
$order WC_Order Order object

Example:

add_action( 'probo_save_order_item_meta_custom_uploader', function ( $item, $uploader_values, $order ) {
    $item->add_meta_data( '_custom_uploader_file', $uploader_values['file_id'] );
}, 10, 3 );

probo_order_status_change

Fires when any Probo order status changes via API callback.

File: includes/probo/class-probo-actions.php

Parameters:

Parameter Type Description
$order_id int WooCommerce order ID
$status string New Probo order status

Example:

add_action( 'probo_order_status_change', function ( $order_id, $status ) {
    error_log( "Order {$order_id} changed to status: {$status}" );
}, 10, 2 );

probo_order_status_change_{$status}

Fires when a Probo order reaches a specific status.

File: includes/probo/class-probo-actions.php

Parameters:

Parameter Type Description
$order_id int WooCommerce order ID

Example:

add_action( 'probo_order_status_change_delivered', function ( $order_id ) {
    wp_mail( get_option( 'admin_email' ), 'Order Delivered', "Order #{$order_id} delivered." );
} );

Filter Hooks

Order Payload Filters

probo_order_payload_filter_payload

File: includes/probo/helpers/class-probo-order.php

Parameters:

Parameter Type Description
$payload array Complete order payload
$order WC_Order WooCommerce order

Example:

add_filter( 'probo_order_payload_filter_payload', function ( $payload, $order ) {
    $payload['metadata']['source'] = 'custom_integration';
    return $payload;
}, 10, 2 );

probo_order_payload_filter_order_id

Parameters:

Parameter Type Description
$order_id `string int`

Example:

add_filter( 'probo_order_payload_filter_order_id', function ( $order_id ) {
    return 'SHOP-' . $order_id;
} );

probo_order_payload_filter_order_reference

Parameters:

Parameter Type Description
$order_reference string Order reference
$probo_order_prefix string Configured prefix
$order_number `string int`

Example:

add_filter( 'probo_order_payload_filter_order_reference', function ( $ref, $prefix, $number ) {
    return sprintf( '%s-%s-%s', $prefix, date( 'Ymd' ), $number );
}, 10, 3 );

probo_order_payload_filter_delivery_address

Parameters:

Parameter Type Description
$delivery_address array Address data
$order WC_Order WooCommerce order

Example:

add_filter( 'probo_order_payload_filter_delivery_address', function ( $address, $order ) {
    $address['department'] = $order->get_meta( '_delivery_department' );
    return $address;
}, 10, 2 );

Uploader Type Filters

probo_order_uploader_type_{$uploader_type}

Parameters:

Parameter Type Description
$uploader_data array Default uploader data
$product_id int Product ID
$item_id int Order item ID
$default_array array Default structure

Example:

add_filter( 'probo_order_uploader_type_my_uploader', function ( $data, $product_id, $item_id ) {
    $item = new WC_Order_Item_Product( $item_id );
    return [
        'file_url'  => $item->get_meta( '_file_url' ),
        'file_name' => $item->get_meta( '_file_name' ),
    ];
}, 10, 3 );

probo_uploader_generate_{$uploader_type}

Parameters:

Parameter Type Description
$cart_item_data array Cart item data

Example:

add_filter( 'probo_uploader_generate_my_uploader', function ( $cart_item_data ) {
    $cart_item_data['my_uploader'] = [
        'file_id' => sanitize_text_field( $_POST['file_id'] ),
    ];
    return $cart_item_data;
} );

API Response Filters

probo_client_response_filter_{$method}

Parameters:

Parameter Type Description
$response array API response data

Example:

add_filter( 'probo_client_response_filter_price', function ( $response ) {
    foreach ( $response['meta_data']['prices'] as &$price ) {
        $price['amount'] = 1.1;
    }
    return $response;
} );

Shipping Filters

probo_shipping_delivery_date

Parameters:*

Parameter Type Description
$delivery_date array Delivery date
$price_option array Price option

Example:

add_filter( 'probo_shipping_delivery_date', function ( $date, $price ) {
    $date['label'] .= ' (estimated)';
    return $date;
}, 10, 2 );

Cart & Frontend Filters

probo_store_cart_render

Parameters:

Parameter Type Description
$data array Cart data

Example:

add_filter( 'probo_store_cart_render', function ( $data ) {
    $data['custom_label'] = 'Made to order';
    return $data;
} );

Configurator Block Filters

probo_configurator_block_render_{$section}

Parameters:

Parameter Type Description
$product_data array Product configuration

Hook Naming Conventions

Pattern Purpose
probo_order_payload_filter_* Modify order payload
probo_client_response_filter_* Modify API responses
probo_shipping_* Shipping customization
probo_configurator_block_render_* Configurator UI
probo_*_uploader_* Uploader extensions
probo_order_status_change_* Order status events