Exemplo n.º 1
0
 private function nc_header()
 {
     /*在导航的商品分类*/
     $header_product_class = $this->obj_product_class->getSpecificClass(array('show_type' => 'header'));
     $this->output('header_product_class', $header_product_class);
     /*在导航的文章分类*/
     $header_article_class = $this->obj_article_class->getArticleClass(array('article_class_menu' => 1));
     $this->output('header_article_class', $header_article_class);
     /*语言包选择*/
     require_once "moduleLanguage.class.php";
     $module_language = new ModuleLanguageClass();
     $conditon_array = array();
     $language_array = $module_language->getLanguageList($conditon_array);
     $this->output('language_array', $language_array);
     /*判断选中的语言包类型*/
     if ($_SESSION['language'] != '') {
         $language_ver = $_SESSION['language'];
     } else {
         $language_ver = $this->_configinfo['websit']['versionarea'];
     }
     $this->output('language_ver', $language_ver);
     /*购物车*/
     require_once "shopCart.class.php";
     $shop_cart = new ShopCartClass();
     $this->output('cart_count', $shop_cart->GoodsCount());
     /*导航菜单选中*/
     $show_menu = '';
     $show_product_menu = '';
     $show_article_menu = '';
     $menu_name = basename($_SERVER['PHP_SELF']);
     if ($menu_name == 'index.php') {
         $show_menu = 'index';
     } elseif ($menu_name == 'product_subject.php') {
         $show_menu = 'subject';
     } elseif ($menu_name == 'product_brand.php') {
         $show_menu = 'brand';
     } elseif ($menu_name == 'article_class.php') {
         $show_article_menu = $this->_input['id'];
         if ($show_article_menu == '') {
             $show_article_menu = 'article';
         }
     } elseif ($menu_name == 'product_class.php') {
         $show_product_menu = $this->_input['classid'];
     }
     $this->output('show_menu', $show_menu);
     $this->output('show_product_menu', $show_product_menu);
     $this->output('show_article_menu', $show_article_menu);
     $this->showpage('header');
 }
Exemplo n.º 2
0
 /**
  * 显示商品分类页面
  *
  */
 private function showClass()
 {
     if (intval($this->_input['classid']) == 0) {
         header("Location:index.php");
         exit;
     }
     include BasePath . "/share/" . NC_SHOP_DIR . "goods_class_show.php";
     $array = array();
     foreach ($node_cache as $k => $v) {
         if ($v[0] == intval($this->_input['classid'])) {
             $array['class_id'] = $v[0];
             $array['class_top_id'] = $v[1];
             $array['class_name'] = $v[2];
             $array['class_keywords'] = $v[6];
             $array['class_description'] = $v[7];
             $array['key_id'] = $k;
             break;
         }
     }
     /*当前分类信息*/
     $this->output('class_info', $array);
     /*分类导航*/
     $class_menu = $this->obj_product_class->prductClassMenu($array);
     $this->output('class_menu', $class_menu);
     /*下一级分类*/
     $sub_array = $this->obj_product_class->getSpecificClass(array('sub_class_id' => $array['class_id']));
     $this->output('sub_class', $sub_array);
     $this->output('sub_class_num', count($sub_array));
     /*创建分页对象*/
     $view_list_num = $this->_viewinfo['websit']['other_goods_class'] == '1' ? (int) $this->_viewinfo['websit']['other_goods_class_num'] : 0;
     if (intval($this->_input['goods_nums']) != 0) {
         $view_list_num = intval($this->_input['goods_nums']);
     }
     require_once "commonpage.class.php";
     $obj_page = new CommonPage();
     $obj_page->pagebarnum($view_list_num);
     //每页显示商品数
     $product_array = $this->obj_product_class->productClassList($array, $obj_page, '*', $this->_input['goods_show']);
     $product_class_page = $obj_page->show(6);
     $this->output('product_class_page', $product_class_page);
     $this->output('product_array', $product_array);
     /*商品品牌*/
     $brand_array = $this->obj_brand->getBrandList(array('show_type' => 'class_show'));
     $this->output('brand_array', $brand_array);
     /*当前类热卖商品*/
     $hot_array = $this->obj_product_class->productClassList($array, '', 'goods.goods_name,goods.goods_id,goods.shop_goods_id', '', ' order by goods.goods_click desc', 8);
     $this->output('hot_array', $hot_array);
     /*浏览过的商品*/
     if ($this->getCookies('c_product_viewed') != '') {
         $view_goods_array = $this->obj_product_class->productClassList(array('c_product_viewed' => $this->getCookies('c_product_viewed')), '', 'goods.goods_name,goods.goods_id,goods.goods_small_image,shop_goods_id');
         $this->output('view_goods_array', $view_goods_array);
     }
     $this->showpage('product_class');
 }