Hi,
I am trying to change a order status depending on a payment_id. But i can't get the payment_id inside a controller. When i am testing i can get the order id, but the payment_id returns returns 0.
What am i doing wrong? See example below.
Thanks in advange
if ($_SERVER['REQUEST_METHOD'] == 'POST') { if ($mode == 'generate') {$order_id = empty($_REQUEST['order_id']) ? 0 : $_REQUEST['order_id']; $payment_id = db_get_field("SELECT payment_id FROM ?:orders WHERE order_id =?i", $_REQUEST['order_id']); $order_info = Tygh::$app['view']->getTemplateVars('order_info'); $check_payment = array(12); if (in_array($order_info['payment_id'], $check_payment )) { fn_change_order_status($order_id, 'Q'); fn_print_die($order_id, $check_payment ,$payment_id); } else { fn_change_order_status($order_id, 'C');
fn_print_die($order_id, $check_payment ,$payment_id);
}return array(CONTROLLER_STATUS_OK, "orders.details?order_id=$order_id".$suffix); }
}