Example #1
0
    $category_id = empty($_REQUEST['category_id']) ? 0 : $_REQUEST['category_id'];
    $category_count = db_get_field("SELECT COUNT(*) FROM ?:ebay_categories WHERE site_id = ?i", $current_site_id);
    $except_id = 0;
    if (!empty($_REQUEST['except_id'])) {
        $except_id = $_REQUEST['except_id'];
        Tygh::$app['view']->assign('except_id', $_REQUEST['except_id']);
    }
    if ($category_count < CATEGORY_THRESHOLD) {
        $params = array('simple' => false, 'b_id' => !empty($_REQUEST['b_id']) ? $_REQUEST['b_id'] : '', 'except_id' => $except_id);
        list($categories_tree, ) = fn_ebay_get_categories($params, $current_site_id, DESCR_SL);
        Tygh::$app['view']->assign('show_all', true);
    } else {
        $params = array('category_id' => $category_id, 'current_category_id' => $category_id, 'b_id' => !empty($_REQUEST['b_id']) ? $_REQUEST['b_id'] : '', 'except_id' => $except_id);
        list($categories_tree, ) = fn_ebay_get_categories($params, $current_site_id, DESCR_SL);
    }
    Tygh::$app['view']->assign('categories_tree', $categories_tree);
    if ($category_count < CATEGORY_SHOW_ALL) {
        Tygh::$app['view']->assign('expand_all', true);
    }
    if (defined('AJAX_REQUEST')) {
        if (!empty($_REQUEST['random'])) {
            Tygh::$app['view']->assign('random', $_REQUEST['random']);
        }
        Tygh::$app['view']->assign('category_id', $category_id);
    }
    Tygh::$app['view']->assign('ebay_sites', fn_get_ebay_sites($used_site_ids));
    Tygh::$app['view']->assign('current_site_id', $current_site_id);
    Tygh::$app['view']->assign('company_id', $company_id);
    Tygh::$app['view']->display('addons/ebay/pickers/categories/picker_contents.tpl');
    exit;
}
/**
 * Get languages list for customer language
 */
function fn_settings_variants_addons_ebay_site_id()
{
    return fn_get_ebay_sites();
}