dafeder, the submission product in the order has a parent_node in its data array. Here's the code...
<?php
$prods = $order->products;
foreach ($prods as $prod) {
if ( $prod->type=='submission_product') && array_key_exists('parent_node', $prod->data) && !empty($prod->data['parent_node']) ) {
$submitted_node = node_load($prod->data['parent_node']);
actions_do('workflow_select_next_state_action', $submitted_node);
}
}
?>That gets each product in the order that is a submission product and gets the parent_node from its data array. Then loads the node and performs the workflow action.
If you know you're only going to have one product of this type in the cart, then you can break the foreach loop after finding that product. There may also be a way to run the action on multiple node id's in one call so as not to load the entire node object just to change it's state. But I haven't had time to play around with that yet.



Joined: 04/04/2008