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'); } elseif ($mode == 'product_logs') { $params = $_REQUEST; if (isset($params['product_ids'])) { $params['product_ids'] = array_filter(explode(',', $params['product_ids'])); } // Init filter $params = \Tygh\Navigation\LastView::instance()->update('ebay_product_logs', $params); list($logs, $search) = \Ebay\ProductLogger::getList($params, Registry::get('settings.Appearance.admin_elements_per_page')); $types = \Ebay\ProductLogger::getTypes(); $actions = \Ebay\ProductLogger::getActions(); $templates = fn_get_ebay_templates(array(), 0, DESCR_SL, true); Tygh::$app['view']->assign('logs', $logs); Tygh::$app['view']->assign('ebay_types', $types); Tygh::$app['view']->assign('ebay_actions', $actions); Tygh::$app['view']->assign('ebay_templates', $templates); Tygh::$app['view']->assign('search', $search); } elseif ($mode == 'categories_picker') { $company_id = !empty($_REQUEST['company_id']) ? $_REQUEST['company_id'] : null; $used_site_ids = \Ebay\Template::getUsedSiteIds($company_id); if (isset($_REQUEST['site_id']) && in_array($_REQUEST['site_id'], $used_site_ids)) { $current_site_id = $_REQUEST['site_id']; } else { $current_site_id = reset($used_site_ids); } $category_id = empty($_REQUEST['category_id']) ? 0 : $_REQUEST['category_id'];
/** * @param Product $product * @param Response $response * @param int $action */ protected static function checkResponse(Product $product, Response $response, $action) { $errors = $response->getErrors(); $warnings = $response->getWarnings(); foreach ($errors as $error) { ProductLogger::error($action, $product, $error['message'], $error['code']); static::setError($error['code'], $error['message']); } foreach ($warnings as $warning) { ProductLogger::warning($action, $product, $warning['message'], $warning['code']); } }