if (defined('AJAX_REQUEST')) { Tygh::$app['view']->display('addons/ebay/views/ebay/update.tpl'); exit; } } elseif ($mode == 'get_orders') { fn_define('ORDER_MANAGEMENT', true); if (fn_allowed_for('ULTIMATE')) { if (Registry::get('runtime.company_id')) { list($success_orders, $failed_orders) = fn_get_ebay_orders($cart, $customer_auth); if (!empty($success_orders)) { fn_set_notification('N', __('successful'), __('ebay_success_orders_notice', array('[SUCCESS_IDS]' => implode(', ', $success_orders)))); } elseif (!empty($failed_orders)) { fn_set_notification('W', __('warning'), __('ebay_failed_orders_notice', array('[FAILED_EBAY_IDS]' => implode(', ', $failed_orders)))); } else { fn_set_notification('W', __('warning'), 'no orders found'); } } else { fn_set_notification('W', __('warning'), __('store_object_denied', array('[object_type]' => '', '[object_name]' => '')), '', 'store_object_denied'); } } else { list($success_orders, $failed_orders) = fn_get_ebay_orders($cart, $customer_auth); if (!empty($success_orders)) { fn_set_notification('N', __('successful'), __('ebay_success_orders_notice', array('[SUCCESS_IDS]' => implode(', ', $success_orders)))); } elseif (!empty($failed_orders)) { fn_set_notification('W', __('warning'), __('ebay_failed_orders_notice', array('[FAILED_EBAY_IDS]' => implode(', ', $failed_orders)))); } else { fn_set_notification('W', __('warning'), 'no orders found'); } } return array(CONTROLLER_STATUS_REDIRECT, 'orders.manage'); }
exit; } } elseif ($mode == 'get_orders') { if (fn_allowed_for('ULTIMATE')) { if (Registry::get('runtime.company_id')) { list($success_orders, $failed_orders) = fn_get_ebay_orders(); if (!empty($success_orders)) { fn_set_notification('N', __('successful'), __('ebay_success_orders_notice', array('[SUCCESS_IDS]' => implode(', ', $success_orders)))); } if (!empty($failed_orders)) { fn_set_notification('W', __('warning'), __('ebay_failed_orders_notice', array('[FAILED_EBAY_IDS]' => implode(', ', $failed_orders)))); } } else { fn_set_notification('W', __('warning'), __('store_object_denied', array('[object_type]' => '', '[object_name]' => '')), '', 'store_object_denied'); } } else { list($success_orders, $failed_orders) = fn_get_ebay_orders(); if (!empty($success_orders)) { fn_set_notification('N', __('successful'), __('ebay_success_orders_notice', array('[SUCCESS_IDS]' => implode(', ', $success_orders)))); } if (!empty($failed_orders)) { fn_set_notification('W', __('warning'), __('ebay_failed_orders_notice', array('[FAILED_EBAY_IDS]' => implode(', ', $failed_orders)))); } } return array(CONTROLLER_STATUS_REDIRECT, 'orders.manage'); } elseif ($mode == 'delete_template') { if (!empty($_REQUEST['template_id'])) { fn_delete_ebay_template($_REQUEST['template_id']); } return array(CONTROLLER_STATUS_OK, "ebay.manage"); }