Beispiel #1
0
 function do_detail($info = array(), $info_lang = array())
 {
     global $ttH;
     $data = array_merge($info, $info_lang);
     $data["link_action"] = $ttH->site->get_link('product', '', $info_lang['friendly_link']);
     $data["picture"] = $ttH->func->get_src_mod('product/' . $info["picture"], 300, 300, 1, 0, array('fix_width' => 1));
     $data["brand_name"] = get_brand_name($info["brand_id"], 'link');
     $data["group_name"] = get_group_name($info["group_id"], 'link');
     $data["price"] = $ttH->func->get_price_format($info["price"]);
     $sql = "select option_id,title  \n\t\t\t\t\t\tfrom product_option \n\t\t\t\t\t\twhere is_show=1 \n\t\t\t\t\t\torder by show_order desc, date_create asc";
     //echo $sql;
     $result = $ttH->db->query($sql);
     $html_row = "";
     while ($row = $ttH->db->fetch_row($result)) {
         if (isset($data['arr_option'][$row['option_id']])) {
             $row['content'] = $data['arr_option'][$row['option_id']];
             $ttH->temp_act->assign('row', $row);
             $ttH->temp_act->parse("detail.info_row");
         }
     }
     $ttH->temp_act->assign('data', $data);
     $ttH->temp_act->parse("detail.btn_add_cart");
     $data['other'] = list_other(" and a.item_id!='" . $data['item_id'] . "'");
     $ttH->temp_act->assign('data', $data);
     $ttH->temp_act->parse("detail");
     $nd = array('title' => $data['title'], 'content' => $ttH->temp_act->text("detail"));
     return $ttH->html->temp_box("box_main", $nd);
 }
Beispiel #2
0
 function do_detail($info = array(), $info_lang = array())
 {
     global $ttH;
     $ttH->func->include_css($ttH->dir_skin . 'js/jcarousel-master/connected-carousels/product.css');
     $ttH->func->include_js($ttH->dir_skin . 'js/jcarousel-master/dist/jquery.jcarousel.min.js');
     $ttH->func->include_js($ttH->dir_skin . 'js/jcarousel-master/connected-carousels/jcarousel.connected-carousels.js');
     $data = array_merge($info, $info_lang);
     $data["link_action"] = $ttH->site->get_link('product', '', $info_lang['friendly_link']);
     //$data["link_cart"] = $ttH->site->get_link ('product',$ttH->setting['product']['ordering_friendly_link'],$ttH->setting['product']['ordering_cart_link']).'/?item_id='.$data['item_id'];
     $data["link_cart"] = $ttH->site_func->get_link_popup('product', 'cart', array('item_id' => $data['item_id']));
     $data["img_detail"] = $this->pic_slide($data);
     $data["brand_name"] = get_brand_name($info["brand_id"], 'link');
     $data["group_name"] = get_group_name($info["group_id"], 'link');
     $data["price"] = $ttH->func->get_price_format($info["price_s"]);
     $data["price_buy"] = $ttH->func->get_price_format($info["price_l"]);
     $data["price_s"] = $ttH->func->get_price_format($info["price_s"]);
     if ($info["price"] > $info["price_buy"] && $info["price_buy"] > 0) {
         $ttH->temp_act->assign('price', $data['price']);
         $ttH->temp_act->parse("detail.info_row_price");
     }
     if ($info["made_country"] != "") {
         $ttH->temp_act->assign('made_country', $info['made_country']);
         $ttH->temp_act->parse("detail.made_country");
     }
     if ($info["price_s"] > 0) {
         $ttH->temp_act->assign('price_s', $info['price_s']);
         $ttH->temp_act->parse("detail.price_s");
     }
     if ($info["price_l"] > 0) {
         $ttH->temp_act->assign('price_l', $info['price_l']);
         $ttH->temp_act->parse("detail.price_l");
     }
     if ($info["quantity"] != "") {
         $ttH->temp_act->assign('quantity', $info['quantity']);
         $ttH->temp_act->parse("detail.quantity");
     }
     $sql = "select option_id,title  \n\n\t\t\t\t\t\tfrom product_option \n\n\t\t\t\t\t\twhere is_show=1 \n\n\t\t\t\t\t\tand lang= '" . $ttH->conf['lang_cur'] . "'\n\n\t\t\t\t\t\torder by show_order desc, date_create asc";
     //echo $sql;
     $result = $ttH->db->query($sql);
     $html_row = "";
     while ($row = $ttH->db->fetch_row($result)) {
         if (isset($data['arr_option'][$row['option_id']])) {
             $row['content'] = $data['arr_option'][$row['option_id']];
             $ttH->temp_act->assign('row', $row);
             $ttH->temp_act->parse("detail.info_row");
         }
     }
     $data["list_color"] = list_color($info["item_id"], $info["list_color"]);
     if (!empty($data["list_color"])) {
         $row = array();
         $row['info_row_class'] = 'list_color';
         $row['title'] = $ttH->lang['product']['color'];
         $row['content'] = $data["list_color"];
         $ttH->temp_act->assign('row', $row);
         $ttH->temp_act->parse("detail.info_row");
     }
     $data["list_size"] = list_size($info["item_id"], $info["list_size"]);
     if (!empty($data["list_size"])) {
         $row = array();
         $row['info_row_class'] = 'list_size';
         $row['title'] = $ttH->lang['product']['size'];
         $row['content'] = $data["list_size"];
         $ttH->temp_act->assign('row', $row);
         $ttH->temp_act->parse("detail.info_row");
     }
     //$data["list_combine"] = list_combine ($info["item_id"]);
     /*$data["list_code_pic"] = list_code_pic ($info["item_id"], $info["list_code_pic"]);
     
     		if(!empty($data["list_code_pic"])) {
     
     			$row = array();
     
     			$row['title'] = $ttH->lang['product']['code_pic'];
     
     			$row['content'] = $data["list_code_pic"];
     
     			$ttH->temp_act->assign('row', $row);
     
     			$ttH->temp_act->parse("detail.info_row");
     
     		}*/
     $data["link_cart"] = $ttH->site_func->get_link_popup('product', 'cart');
     $data["list_quantity"] = list_quantity('quantity', 1, ' class="quantity"');
     $ttH->temp_act->assign('data', $data);
     $ttH->temp_act->parse("detail.btn_add_cart");
     /*$arr_order_method = $ttH->load_data->data_table ('order_method', 'method_id', 'method_id,name_action,title', "is_show=1 and lang='".$ttH->conf['lang_cur']."' order by show_order desc, date_create desc");
     
     		$data['order_method'] = '';
     
     		foreach($arr_order_method as $k => $v) {
     
     			$data['order_method'] .= '<li>'.$v['title'].'</li>';
     
     		}
     
     		if($data['order_method']) {
     
     			$data['order_method'] = '<ul class="list_none order_method-list">'.$data['order_method'].'</ul>';
     
     			$ttH->temp_act->assign('order_method', $data['order_method']);
     
     			$ttH->temp_act->parse("detail.order_method");
     
     		}*/
     $arr_content = array('content', 'content1', 'content2', 'content3', 'content4', 'content5');
     $has_content = 0;
     $index = 10;
     foreach ($arr_content as $k) {
         if ($data[$k]) {
             $index--;
             $has_content = 1;
             $ttH->temp_act->assign('tab', array('key' => $k, 'index' => $index, 'title' => $ttH->lang['product'][$k]));
             $ttH->temp_act->parse("detail.tab.title");
             $ttH->temp_act->assign('tab', array('key' => $k, 'content' => $data[$k]));
             $ttH->temp_act->parse("detail.tab.content");
         }
     }
     if ($has_content == 1) {
         $ttH->temp_act->parse("detail.tab");
     }
     $data['navigation'] = $ttH->navigation;
     $data['date_update'] = date('d-m-Y', $data['date_update']);
     //$data['other'] = list_other (" and a.item_id!='".$data['item_id']."'");
     //$data['other'] = $this->do_other ($data);
     $ttH->temp_act->assign('data', $data);
     $ttH->temp_act->parse("detail");
     return $ttH->temp_act->text("detail");
     $nd = array('title' => $data['title'], 'content' => $ttH->temp_act->text("detail"));
     return $ttH->html->temp_box("box_main", $nd);
 }