show link to delivery process page

This commit is contained in:
Bilal Catic
2018-11-03 07:13:30 +01:00
parent 01b35dbac5
commit 24e8515b30
2 changed files with 19 additions and 2 deletions

View File

@@ -98,6 +98,22 @@ class Wiaas_Delivery_Process {
return $result;
}
public static function get_active_step($order_id){
$process_entry_id = get_post_meta($order_id, 'wiaas_delivery_process_entry_id');
if (empty($process_entry_id)) {
return null;
}
$process_instance = GFAPI::get_entry($process_entry_id);
$api = new Gravity_Flow_API($process_instance['form_id']);
$steps_info = $api->get_steps();
foreach ( $steps_info as $step_info ) {
return $api->get_step( $step_info->get_id(), $process_instance );
}
return null;
}
/**
* Retrieves delivery process instance for order
*