} else { $tabs['configure']['hidden'] = 'Y'; } if (Registry::get('runtime.company_id') && Registry::get('runtime.company_id') != $shipping['company_id']) { unset($tabs['configure']); Tygh::$app['view']->assign('hide_for_vendor', true); } Registry::set('navigation.tabs', $tabs); Tygh::$app['view']->assign('services', $services); Tygh::$app['view']->assign('carriers', fn_get_carriers_from_services($services)); Tygh::$app['view']->assign('taxes', fn_get_taxes()); Tygh::$app['view']->assign('usergroups', fn_get_usergroups(array('type' => 'C', 'status' => array('A', 'H')), DESCR_SL)); // Show all shipping methods } elseif ($mode == 'manage') { $company_id = Registry::ifGet('runtime.company_id', null); Tygh::$app['view']->assign('shippings', fn_get_available_shippings($company_id)); Tygh::$app['view']->assign('usergroups', fn_get_usergroups(array('type' => 'C', 'status' => array('A', 'H')), DESCR_SL)); } function fn_delete_rate_values($delete_rate_data, $shipping_id, $destination_id) { $rate_values = db_get_field("SELECT rate_value FROM ?:shipping_rates WHERE shipping_id = ?i AND destination_id = ?i", $shipping_id, $destination_id); if (!empty($rate_values)) { $rate_values = unserialize($rate_values); } foreach ((array) $rate_values as $rate_type => $rd) { foreach ((array) $rd as $amount => $data) { if (isset($delete_rate_data[$rate_type][$amount]) && $delete_rate_data[$rate_type][$amount] == 'Y') { unset($rate_values[$rate_type][$amount]); } } }
} else { $tabs['configure']['hidden'] = 'Y'; } if (Registry::get('runtime.company_id') && Registry::get('runtime.company_id') != $shipping['company_id']) { unset($tabs['configure']); Registry::get('view')->assign('hide_for_vendor', true); } Registry::set('navigation.tabs', $tabs); Registry::get('view')->assign('services', $services); Registry::get('view')->assign('carriers', fn_get_carriers_from_services($services)); Registry::get('view')->assign('taxes', fn_get_taxes()); Registry::get('view')->assign('usergroups', fn_get_usergroups(array('type' => 'C', 'status' => array('A', 'H')), DESCR_SL)); // Show all shipping methods } elseif ($mode == 'manage') { $company_id = Registry::ifGet('runtime.company_id', null); Registry::get('view')->assign('shippings', fn_get_available_shippings($company_id)); Registry::get('view')->assign('usergroups', fn_get_usergroups(array('type' => 'C', 'status' => array('A', 'H')), DESCR_SL)); } function fn_delete_rate_values($delete_rate_data, $shipping_id, $destination_id) { $rate_values = db_get_field("SELECT rate_value FROM ?:shipping_rates WHERE shipping_id = ?i AND destination_id = ?i", $shipping_id, $destination_id); if (!empty($rate_values)) { $rate_values = unserialize($rate_values); } foreach ((array) $rate_values as $rate_type => $rd) { foreach ((array) $rd as $amount => $data) { if (isset($delete_rate_data[$rate_type][$amount]) && $delete_rate_data[$rate_type][$amount] == 'Y') { unset($rate_values[$rate_type][$amount]); } } }
exit; } elseif ($mode == 'details') { $_REQUEST['order_id'] = empty($_REQUEST['order_id']) ? 0 : $_REQUEST['order_id']; $order_info = fn_get_order_info($_REQUEST['order_id'], false, true, true, true); fn_check_first_order($order_info); if (empty($order_info)) { return array(CONTROLLER_STATUS_NO_PAGE); } if (!empty($order_info['is_parent_order']) && $order_info['is_parent_order'] == 'Y') { // Get children orders $children_order_ids = db_get_fields('SELECT order_id FROM ?:orders WHERE parent_order_id = ?i', $order_info['order_id']); return array(CONTROLLER_STATUS_REDIRECT, 'orders.manage?order_id=' . implode(',', $children_order_ids)); } if (isset($order_info['need_shipping']) && $order_info['need_shipping']) { $company_id = !empty($order_info['company_id']) ? $order_info['company_id'] : null; $shippings = fn_get_available_shippings($company_id); Registry::get('view')->assign('shippings', $shippings); } Registry::set('navigation.tabs', array('general' => array('title' => __('general'), 'js' => true), 'addons' => array('title' => __('addons'), 'js' => true))); if (fn_allowed_for('MULTIVENDOR')) { Registry::get('view')->assign('take_surcharge_from_vendor', fn_take_payment_surcharge_from_vendor($order_info['products'])); } $downloads_exist = false; foreach ($order_info['products'] as $k => $v) { if (!$downloads_exist && !empty($v['extra']['is_edp']) && $v['extra']['is_edp'] == 'Y') { $downloads_exist = true; } $order_info['products'][$k]['main_pair'] = fn_get_cart_product_icon($v['product_id'], $order_info['products'][$k]); } if ($downloads_exist) { Registry::set('navigation.tabs.downloads', array('title' => __('downloads'), 'js' => true));
function fn_hw_restrict_get_data() { //$params = array(); //$params['status'] = 'A'; //$hw_restrict['payments'] = fn_get_payments($params); $lang_code = CART_LANGUAGE; $hw_restrict['payments'] = db_get_array("SELECT ?:payments.*, ?:payment_descriptions.* FROM ?:payments LEFT JOIN ?:payment_descriptions ON ?:payment_descriptions.payment_id = ?:payments.payment_id AND ?:payment_descriptions.lang_code = ?s WHERE ?:payments.status='A' ORDER BY ?:payments.position", $lang_code); $company_id = Registry::ifGet('runtime.company_id', null); $hw_restrict['shippings'] = fn_get_available_shippings($company_id); return $hw_restrict; }