Update delivery process fields and sample form
This commit is contained in:
@@ -85,10 +85,10 @@ class Wiaas_Delivery_Process {
|
||||
* @param $form
|
||||
*/
|
||||
public static function maybe_complete_parent_order($entry_id, $form) {
|
||||
|
||||
$entry = GFAPI::get_entry($entry_id);
|
||||
|
||||
$order_field = GFCommon::get_fields_by_type($form, 'wiaas_order')[0];
|
||||
$order_id = empty($order_field) ? null : absint($entry[$order_field->id]);
|
||||
$order_id = $entry['wiaas_delivery_order_id'];
|
||||
|
||||
if (!isset($order_id)) {
|
||||
return;
|
||||
@@ -97,7 +97,7 @@ class Wiaas_Delivery_Process {
|
||||
$process_entry_id = get_post_meta($order_id, 'wiaas_delivery_process_entry_id', true);
|
||||
|
||||
// order process entry completed, so complete order
|
||||
if (absint($process_entry_id) === $entry_id) {
|
||||
if (absint($process_entry_id) === absint($entry_id)) {
|
||||
$order = wc_get_order($order_id);
|
||||
$order->update_status('completed', 'Completed order delivery process.', true);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user