I have an API that can be called: https://broadcast.plainviewplugins.com/doc/developer-api/
As a suggestion, without knowing anything about the Restful API, you can hook into an action there and broadcast the product to other sites:
add_action( 'restful_product_updated', function( $product_id )
{
ThreeWP_Broadcast()->api()->broadcast_children( $product_id, [ 2, 3, 4 ] );
} );
Something like that…
Thanks Edward,
I have added the update_children into the “save_post” action, it is working now. The draw back is that the Restful Post is taking long time to finish, I guessed once it called the “update_children” , the process to broadcast is slow.
Do you have any api that we can do it like push the “update_children” into the broadcast queue, which is like the process we click product “update” button ?
Oh, if you want things put into the queue then put the API into low priority.
$api = ThreeWP_Broadcast()->api();
$api->low_priority();
$api->broadcast_children( $product_id, [ 2, 3, 4 ] );
Hope that works better for you.
Thanks Edward, with the low_priority(), the process is working fine now.