$cache_id = sprintf('%X', crc32($_REQUEST['id'] . '-' . $_CFG['lang'])); if (!$smarty->is_cached('xspace_show.dwt', $cache_id)) { /* 文章详情 */ $article = get_article_info($article_id); if (empty($article)) { ecs_header("Location: ./\n"); exit; } if (!empty($article['link']) && $article['link'] != 'http://' && $article['link'] != 'https://') { ecs_header("location:{$article['link']}\n"); exit; } include_once ROOT_PATH . 'includes/lib_order.php'; $order_goods_list = order_goods($article["order_id"]); foreach ($order_goods_list as $key => $value) { $order_goods_list[$key]['goods_thumb'] = get_goods_thumb($value['goods_id']); $order_goods_list[$key]['market_price'] = price_format($value['market_price'], false); $order_goods_list[$key]['goods_price'] = price_format($value['goods_price'], false); $order_goods_list[$key]['subtotal'] = price_format($value['subtotal'], false); } $smarty->assign('order_goods_list', $order_goods_list); $smarty->assign('article_categories', article_categories_tree($article_id)); //文章分类树 $smarty->assign('categories', get_categories_tree()); // 分类树 $smarty->assign('helps', get_shop_help()); // 网店帮助 $smarty->assign('top_goods', get_top10()); // 销售排行 $smarty->assign('best_goods', get_recommend_goods('best')); // 推荐商品
function insert_cart_data() { $cart = get_cart_data(); $list = $cart['goods_list']; $total = $cart_goods['total']; $str = ''; if ($list) { $total_price = 0; $str .= '<ul id="JS_header_cart" class="cartUL">'; foreach ($list as $item) { if ($item['extension_code'] == 'package_buy') { $index = 1; foreach ($item['package_goods_list'] as $packitem) { if ($index == 1) { $img_src = get_goods_thumb($packitem['goods_id']); } $index = $index + 1; } } else { $img_src = $item['goods_thumb'] == '' ? 'themes/meilele/images/blank.gif' : $item['goods_thumb']; } $str .= '<li id="JS_cart_list_index_0"> <div class="tImg"><a href="goods.php?id=' . $item['goods_id'] . '" target="_blank" title="' . $item['short_name'] . '"><img src="' . $img_src . '" alt="' . $item['short_name'] . '" height="86" width="86"></a></div> <div class="gInfo"> <p class="gn"><a href="goods.php?id=' . $item['goods_id'] . '" target="_blank" title="' . $item['short_name'] . '">' . $item['short_name'] . '</a></p> <p class="gt"><strong class="Left"><span class="cl yen"><span id="JS_danjia0">' . $item['goods_price'] . '</span></span>×' . $item['goods_number'] . '</strong><a class="Right" href="javascript:drop_cart_goods(\'' . $item['rec_id'] . '\');" data-index="0" data-recid="9136371" data-num="1">删除</a></p> </div> </li>'; $total_price = $total_price + $item['total_price']; } $total_price = price_format($total_price, false); $str .= '</ul> <div class="cartDiv clearfix"> <p class="totaoFee">共<strong class="red f14" id="JS_num">' . insert_cart_count() . '</strong>件商品,共计<strong class="yen red num"><span id="JS_total">' . $total_price . '</span></strong></p> <div class="clearfix"><a class="toPay" href="flow.php">立刻购买</a></div> </div>'; } else { $str = '<div class="loadLay" style="color:#626262;">您的购物车中还没有商品,先去选购吧!</div>'; } return $str; }