コード例 #1
0
ファイル: companies.php プロジェクト: arpad9/bygmarket
         if (Registry::get('settings.General.show_products_from_subcategories') == 'Y') {
             $params['subcats'] = 'Y';
         }
         // [Breadcrumbs]
         $parent_ids = explode('/', $category_data['id_path']);
         array_pop($parent_ids);
         if (!empty($parent_ids)) {
             $cats = fn_get_category_name($parent_ids);
             foreach ($parent_ids as $c_id) {
                 fn_add_breadcrumb($cats[$c_id], "companies.products?category_id={$c_id}&company_id={$company_id}");
             }
         }
         fn_add_breadcrumb($category_data['category']);
     }
     // Get subcategories list for current category
     Tygh::$app['view']->assign('subcategories', fn_get_subcategories($category_id));
     Tygh::$app['view']->assign('category_data', $category_data);
     Tygh::$app['view']->assign('reset_url', fn_url('companies.products?category_id=' . $category_id . '&company_id=' . $company_id));
 } else {
     if (!empty($_REQUEST['q'])) {
         fn_add_breadcrumb($company_data['company'], 'companies.products?company_id=' . $company_id);
         fn_add_breadcrumb(__('search'));
     } else {
         fn_add_breadcrumb($company_data['company']);
     }
     Tygh::$app['view']->assign('reset_url', fn_url('companies.products?company_id=' . $company_id));
 }
 list($products, $search) = fn_get_products($params, Registry::get('settings.Appearance.products_per_page'));
 if (defined('AJAX_REQUEST') && (!empty($params['features_hash']) && !$products)) {
     fn_filters_not_found_notification();
     exit;
コード例 #2
0
ファイル: categories.php プロジェクト: arpad9/bygmarket
 $preview = fn_is_preview_action($auth, $_REQUEST);
 if (!$preview) {
     $_condition .= ' AND (' . fn_find_array_in_set($auth['usergroup_ids'], 'usergroup_ids', true) . ')';
     $_condition .= db_quote(' AND status IN (?a)', $_statuses);
 }
 if (fn_allowed_for('ULTIMATE')) {
     $_condition .= fn_get_company_condition('?:categories.company_id');
 }
 $category_exists = db_get_field("SELECT category_id FROM ?:categories WHERE category_id = ?i ?p", $_REQUEST['category_id'], $_condition);
 if (!empty($category_exists)) {
     // Save current url to session for 'Continue shopping' button
     $_SESSION['continue_url'] = "categories.view?category_id={$_REQUEST['category_id']}";
     // Save current category id to session
     $_SESSION['current_category_id'] = $_SESSION['breadcrumb_category_id'] = $_REQUEST['category_id'];
     // Get subcategories list for current category
     Tygh::$app['view']->assign('subcategories', fn_get_subcategories($_REQUEST['category_id']));
     // Get full data for current category
     $category_data = fn_get_category_data($_REQUEST['category_id'], CART_LANGUAGE, '*', true, false, $preview);
     $category_parent_ids = fn_explode('/', $category_data['id_path']);
     array_pop($category_parent_ids);
     if (!empty($category_data['meta_description']) || !empty($category_data['meta_keywords'])) {
         Tygh::$app['view']->assign('meta_description', $category_data['meta_description']);
         Tygh::$app['view']->assign('meta_keywords', $category_data['meta_keywords']);
     }
     $params = $_REQUEST;
     if ($items_per_page = fn_change_session_param($_SESSION, $_REQUEST, 'items_per_page')) {
         $params['items_per_page'] = $items_per_page;
     }
     if ($sort_by = fn_change_session_param($_SESSION, $_REQUEST, 'sort_by')) {
         $params['sort_by'] = $sort_by;
     }
コード例 #3
0
ファイル: categories.php プロジェクト: diedsmiling/busenika
    $view->assign('root_categories', $root_categories);
} elseif ($mode == 'view') {
    $_statuses = array('A', 'H');
    $_condition = ' AND (' . fn_find_array_in_set($auth['usergroup_ids'], 'usergroup_ids', true) . ')';
    $_condition .= fn_get_localizations_condition('localization', true);
    if ($auth['area'] != 'A' || empty($_REQUEST['action']) || $_REQUEST['action'] != 'preview') {
        $_condition .= db_quote(' AND status IN (?a)', $_statuses);
    }
    $is_avail = db_get_field("SELECT category_id FROM ?:categories WHERE category_id = ?i ?p", $_REQUEST['category_id'], $_condition);
    if (!empty($is_avail)) {
        // Save current url to session for 'Continue shopping' button
        $_SESSION['continue_url'] = "categories.view?category_id={$_REQUEST['category_id']}";
        // Save current category id to session
        $_SESSION['current_category_id'] = $_REQUEST['category_id'];
        // Get subcategories list for current category
        $view->assign('subcategories', fn_get_subcategories($_REQUEST['category_id']));
        // Get full data for current category
        $category_data = fn_get_category_data($_REQUEST['category_id'], CART_LANGUAGE, '*');
        if (!empty($category_data['meta_description']) || !empty($category_data['meta_keywords'])) {
            $view->assign('meta_description', $category_data['meta_description']);
            $view->assign('meta_keywords', $category_data['meta_keywords']);
        }
        $params = $_REQUEST;
        $params['cid'] = $_REQUEST['category_id'];
        $params['type'] = 'extended';
        if (Registry::get('settings.General.show_products_from_subcategories') == 'Y') {
            $params['subcats'] = 'Y';
        }
        list($products, $search) = fn_get_products($params, Registry::get('settings.Appearance.products_per_page'));
        if (!empty($products)) {
            foreach ($products as $k => $v) {
コード例 #4
0
ファイル: companies.php プロジェクト: heg-arc-ne/cscart
         if (Registry::get('settings.General.show_products_from_subcategories') == 'Y') {
             $params['subcats'] = 'Y';
         }
         // [Breadcrumbs]
         $parent_ids = explode('/', $category_data['id_path']);
         array_pop($parent_ids);
         if (!empty($parent_ids)) {
             $cats = fn_get_category_name($parent_ids);
             foreach ($parent_ids as $c_id) {
                 fn_add_breadcrumb($cats[$c_id], "companies.products?category_id={$c_id}&company_id={$company_id}");
             }
         }
         fn_add_breadcrumb($category_data['category']);
     }
     // Get subcategories list for current category
     Registry::get('view')->assign('subcategories', fn_get_subcategories($category_id));
     Registry::get('view')->assign('category_data', $category_data);
     Registry::get('view')->assign('reset_url', fn_url('companies.products?category_id=' . $category_id . '&company_id=' . $company_id));
 } else {
     if (!empty($_REQUEST['q'])) {
         fn_add_breadcrumb($company_data['company'], 'companies.products?company_id=' . $company_id);
         fn_add_breadcrumb(__('search'));
     } else {
         fn_add_breadcrumb($company_data['company']);
     }
     Registry::get('view')->assign('reset_url', fn_url('companies.products?company_id=' . $company_id));
 }
 list($products, $search) = fn_get_products($params, Registry::get('settings.Appearance.products_per_page'));
 fn_gather_additional_products_data($products, array('get_icon' => true, 'get_detailed' => true, 'get_additional' => true, 'get_options' => true));
 if (!empty($products)) {
     $_SESSION['continue_url'] = Registry::get('config.current_url');
コード例 #5
0
ファイル: companies.php プロジェクト: ambient-lounge/site
         if (Registry::get('settings.General.show_products_from_subcategories') == 'Y') {
             $params['subcats'] = 'Y';
         }
         // [Breadcrumbs]
         $parent_ids = explode('/', $category_data['id_path']);
         array_pop($parent_ids);
         if (!empty($parent_ids)) {
             $cats = fn_get_category_name($parent_ids);
             foreach ($parent_ids as $c_id) {
                 fn_add_breadcrumb($cats[$c_id], "companies.products?category_id={$c_id}&company_id={$company_id}");
             }
         }
         fn_add_breadcrumb($category_data['category']);
     }
     // Get subcategories list for current category
     Tygh::$app['view']->assign('subcategories', fn_get_subcategories($category_id, array('company_ids' => $company_data['company_id'])));
     Tygh::$app['view']->assign('category_data', $category_data);
     Tygh::$app['view']->assign('reset_url', fn_url('companies.products?category_id=' . $category_id . '&company_id=' . $company_id));
 } else {
     if (!empty($_REQUEST['q'])) {
         fn_add_breadcrumb($company_data['company'], 'companies.products?company_id=' . $company_id);
         fn_add_breadcrumb(__('search'));
     } else {
         fn_add_breadcrumb($company_data['company']);
     }
     Tygh::$app['view']->assign('reset_url', fn_url('companies.products?company_id=' . $company_id));
 }
 list($products, $search) = fn_get_products($params, Registry::get('settings.Appearance.products_per_page'));
 if (defined('AJAX_REQUEST') && (!empty($params['features_hash']) && !$products)) {
     fn_filters_not_found_notification();
     exit;
コード例 #6
0
ファイル: categories.php プロジェクト: heg-arc-ne/cscart
 $preview = fn_is_preview_action($auth, $_REQUEST);
 if (!$preview) {
     $_condition .= ' AND (' . fn_find_array_in_set($auth['usergroup_ids'], 'usergroup_ids', true) . ')';
     $_condition .= db_quote(' AND status IN (?a)', $_statuses);
 }
 if (fn_allowed_for('ULTIMATE')) {
     $_condition .= fn_get_company_condition('?:categories.company_id');
 }
 $category_exists = db_get_field("SELECT category_id FROM ?:categories WHERE category_id = ?i ?p", $_REQUEST['category_id'], $_condition);
 if (!empty($category_exists)) {
     // Save current url to session for 'Continue shopping' button
     $_SESSION['continue_url'] = "categories.view?category_id={$_REQUEST['category_id']}";
     // Save current category id to session
     $_SESSION['current_category_id'] = $_SESSION['breadcrumb_category_id'] = $_REQUEST['category_id'];
     // Get subcategories list for current category
     Registry::get('view')->assign('subcategories', fn_get_subcategories($_REQUEST['category_id']));
     // Get full data for current category
     $category_data = fn_get_category_data($_REQUEST['category_id'], CART_LANGUAGE, '*', true, false, $preview);
     $category_parent_ids = fn_explode('/', $category_data['id_path']);
     array_pop($category_parent_ids);
     if (!empty($category_data['meta_description']) || !empty($category_data['meta_keywords'])) {
         Registry::get('view')->assign('meta_description', $category_data['meta_description']);
         Registry::get('view')->assign('meta_keywords', $category_data['meta_keywords']);
     }
     $params = $_REQUEST;
     if ($items_per_page = fn_change_session_param($_SESSION, $_REQUEST, 'items_per_page')) {
         $params['items_per_page'] = $items_per_page;
     }
     if ($sort_by = fn_change_session_param($_SESSION, $_REQUEST, 'sort_by')) {
         $params['sort_by'] = $sort_by;
     }