} if ($order_info['is_parent_order'] == 'Y') { $child_ids = db_get_fields("SELECT order_id FROM ?:orders WHERE parent_order_id = ?i", $_REQUEST['order_id']); return array(CONTROLLER_STATUS_REDIRECT, 'orders.search?period=A&order_id=' . implode(',', $child_ids)); } if (fn_allowed_for('MULTIVENDOR')) { Registry::get('view')->assign('take_surcharge_from_vendor', fn_take_payment_surcharge_from_vendor($order_info['products'])); } // Repay functionality $statuses = fn_get_statuses(STATUSES_ORDER, array(), true); if (Registry::get('settings.Checkout.repay') == 'Y' && (!empty($statuses[$order_info['status']]['params']['repay']) && $statuses[$order_info['status']]['params']['repay'] == 'Y')) { fn_prepare_repay_data(empty($_REQUEST['payment_id']) ? 0 : $_REQUEST['payment_id'], $order_info, $auth); } $navigation_tabs = array('general' => array('title' => __('general'), 'js' => true, 'href' => 'orders.details?order_id=' . $_REQUEST['order_id'] . '&selected_section=general')); list($shipments) = fn_get_shipments_info(array('order_id' => $order_info['order_id'], 'advanced_info' => true)); $use_shipments = !fn_one_full_shipped($shipments); if (!fn_allowed_for('ULTIMATE:FREE')) { if (Registry::get('settings.General.use_shipments') == 'Y' || $use_shipments) { $navigation_tabs['shipment_info'] = array('title' => __('shipment_info'), 'js' => true, 'href' => 'orders.details?order_id=' . $_REQUEST['order_id'] . '&selected_section=shipment_info'); $use_shipments = true; } } Registry::get('view')->assign('shipments', $shipments); Registry::get('view')->assign('use_shipments', $use_shipments); Registry::set('navigation.tabs', $navigation_tabs); Registry::get('view')->assign('order_info', $order_info); Registry::get('view')->assign('status_settings', $statuses[$order_info['status']]['params']); if (!empty($_REQUEST['selected_section'])) { Registry::get('view')->assign('selected_section', $_REQUEST['selected_section']); } if (!empty($_REQUEST['active_tab'])) {
function fn_print_order_invoices($order_ids, $pdf = false, $area = AREA, $lang_code = CART_LANGUAGE) { $view = Registry::get('view'); $html = array(); $view->assign('order_status_descr', fn_get_simple_statuses(STATUSES_ORDER, true, true)); $view->assign('profile_fields', fn_get_profile_fields('I')); if (!is_array($order_ids)) { $order_ids = array($order_ids); } foreach ($order_ids as $order_id) { $order_info = fn_get_order_info($order_id, false, true, false, true); if (empty($order_info)) { continue; } if (fn_allowed_for('MULTIVENDOR')) { $view->assign('take_surcharge_from_vendor', fn_take_payment_surcharge_from_vendor($order_info['products'])); } list($shipments) = fn_get_shipments_info(array('order_id' => $order_info['order_id'], 'advanced_info' => true)); $use_shipments = !fn_one_full_shipped($shipments); $view->assign('order_info', $order_info); $view->assign('shipments', $shipments); $view->assign('use_shipments', $use_shipments); $view->assign('payment_method', fn_get_payment_data(!empty($order_info['payment_method']['payment_id']) ? $order_info['payment_method']['payment_id'] : 0, $order_info['order_id'], $lang_code)); $view->assign('order_status', fn_get_status_data($order_info['status'], STATUSES_ORDER, $order_info['order_id'], $lang_code, $order_info['company_id'])); $view->assign('status_settings', fn_get_status_params($order_info['status'])); $view->assign('company_data', fn_get_company_placement_info($order_info['company_id'], $lang_code)); if ($pdf == true) { fn_disable_live_editor_mode(); $html[] = $view->displayMail('orders/print_invoice.tpl', false, $area, $order_info['company_id'], $lang_code); } else { $view->displayMail('orders/print_invoice.tpl', true, $area, $order_info['company_id'], $lang_code); if ($order_id != end($order_ids)) { echo "<div style='page-break-before: always;'> </div>"; } } } if ($pdf == true) { Pdf::render($html, __('invoices') . '-' . implode('-', $order_ids)); } return true; }
function fn_qwintry_save_order_invoice($order_id, $area = AREA, $lang_code = CART_LANGUAGE) { $view = Tygh::$app['view']; $html = array(); $view->assign('order_status_descr', fn_get_simple_statuses(STATUSES_ORDER, true, true)); $view->assign('profile_fields', fn_get_profile_fields('I')); $order_info = fn_get_order_info($order_id, false, true, false, true); if (empty($order_info)) { return; } if (fn_allowed_for('MULTIVENDOR')) { $view->assign('take_surcharge_from_vendor', fn_take_payment_surcharge_from_vendor($order_info['products'])); } list($shipments) = fn_get_shipments_info(array('order_id' => $order_info['order_id'], 'advanced_info' => true)); $use_shipments = !fn_one_full_shipped($shipments); $view->assign('order_info', $order_info); $view->assign('shipments', $shipments); $view->assign('use_shipments', $use_shipments); $view->assign('payment_method', fn_get_payment_data(!empty($order_info['payment_method']['payment_id']) ? $order_info['payment_method']['payment_id'] : 0, $order_info['order_id'], $lang_code)); $view->assign('order_status', fn_get_status_data($order_info['status'], STATUSES_ORDER, $order_info['order_id'], $lang_code, $order_info['company_id'])); $view->assign('status_settings', fn_get_status_params($order_info['status'])); $view->assign('company_data', fn_get_company_placement_info($order_info['company_id'], $lang_code)); fn_disable_live_editor_mode(); $html[] = $view->displayMail('orders/print_invoice.tpl', false, $area, $order_info['company_id'], $lang_code); $filename = QWINTRY_DIR_INVOICES . $order_id . '.pdf'; if (Pdf::render($html, $filename, true)) { return $filename; } return false; }