Handle assigment for order delivery flow
This commit is contained in:
@@ -27,16 +27,7 @@ class Wiaas_Delivery_Process_Step extends Gravity_Flow_Step {
|
||||
$form_choices[] = array( 'label' => esc_html__( 'Select a Form', 'wiaas' ), 'value' => '' );
|
||||
foreach ( $forms as $form ) {
|
||||
|
||||
$delivery_settings = rgar($form, 'wiaas_delivery_process');
|
||||
|
||||
$code = $form['id'];
|
||||
|
||||
if (! empty($delivery_settings['delivery_action_code'])) {
|
||||
|
||||
$code = $delivery_settings['delivery_action_code'];
|
||||
}
|
||||
|
||||
$form_choices[] = array( 'label' => $form['title'], 'value' => $code );
|
||||
$form_choices[] = array( 'label' => $form['title'], 'value' => $form['id'] );
|
||||
}
|
||||
|
||||
$settings = array(
|
||||
@@ -215,26 +206,12 @@ class Wiaas_Delivery_Process_Step extends Gravity_Flow_Step {
|
||||
|
||||
/**
|
||||
* Retrieves forms that are valid options for delivery step action
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function get_action_forms_choices() {
|
||||
|
||||
$forms = GFAPI::get_forms();
|
||||
|
||||
$action_forms = array();
|
||||
|
||||
foreach ( $forms as $form ) {
|
||||
|
||||
$delivery_settings = rgar($form, 'wiaas_delivery_process');
|
||||
|
||||
if ( ! empty($delivery_settings) && $delivery_settings['delivery_form_type'] === 'action'){
|
||||
|
||||
$action_forms[] = $form;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
return $action_forms;
|
||||
return Wiaas_Delivery_Process_Action::get_action_forms();
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user