add missing file

This commit is contained in:
Bilal Catic
2018-10-21 16:43:52 +02:00
parent 69c74d9340
commit b91341c5df

View File

@@ -0,0 +1,22 @@
<?php
add_action( 'wp_ajax_wiaas_create_order_delivery_process', 'wiaas_ajax_create_order_delivery_process' );
/**
* Creates delivery process for order
*/
function wiaas_ajax_create_order_delivery_process() {
check_ajax_referer('wiaas_create_order_delivery_process');
$error = new WP_Error('-1', 'Failed to create order delivery process');
if (!isset($_POST['order']) || !isset($_POST['form'])){
wp_send_json_error($error);
}
$order_id = intval( $_POST['order'] );
$form_id = intval( $_POST['form'] );
if (Wiaas_Delivery_Process::create_delivery_process_for_order($order_id, $form_id)){
wp_send_json_success();
}
wp_send_json_error($error);
}